Posted on September 24, 2013 @ 11:16:00 AM by Paul Meagher
MathJax is a javascript library (www.mathjax.org) that makes writing math on the web easier and more professional looking. It is generally not difficult to install or get working. I had issues with escape "/" characters and php's stripslashes function not working together very well and I also needed to add a config option for dealing with escape delimiters. After these issues were resolved, MathJax appears to work as advertised on their site.
To take MathJax for a tour, I first downloaded the "source code" for a classic textbook, Introduction to Probability, by Grimstead and Snell. The "source code" I downloaded was the tex code used to write the book with. I figured that one way to learn how to use the tex language to write math symbols would be to see how it was used in a beautifully typeset textbook whose content I want to read.
So here are a few sample sentences taken from the textbook, now reproduced online using MathJax:
Let $X$ be a numerically-valued discrete random
variable with sample space $\Omega$ and distribution function $m(x)$. The expected value $E(X)$ is defined by $$ E(X) = \sum_{x \in \Omega} x m(x)\ , $$ We often refer to the expected value as the mean and denote $E(X)$ by $\mu$ for short.
The probability of getting \(k\) heads when flipping \(n\) coins is:
\[P(E) = {n \choose k} p^k (1-p)^{ n-k} \]
P.S. I had the opportunity to correspond with one of the authors of the Introduction to Probability textbook, Laurie Snell, a few years back on a few probability concepts (Markov Processes, Analysis of Repeated Surveys, and Chi Square analysis). Snell was around 80 at that time but still very active in the probability community spearheading the Chance News project. Snell also collaborated with Kemeny on writing a Finite Math textbook. Kemeny was the originator of the BASIC programming language.
|