“Complexity kills. It sucks the life out of developers, it makes products difficult to plan, build and test, it introduces security challenges, and it causes end-user and administrator frustration.” (Ray Ozzie)


LaTeX cheat sheet

I don’t mind admitting that I don’t have any formal academic qualifications in maths, barring A-Level.  And let’s face it back then I was more interested in girls than differential equations so I didn’t do brilliantly.

However, lately I find myself needing a lot of linear algebra and playing with matrices – so.  Time to make things easy for myself and make a cheat-sheet of all the stuff I’ll need.

Maybe it’ll be of some small use to someone else, but usual disclaimers as to accuracy apply.  Up to a few weeks ago the math notation used in most text books was all Greek to me (oho!), so forgive me if this is elementary.

A great resource for this stuff is here, and another good one is here.  Also, when you’re trying to find out the \LaTeX command for a particular symbol, try detexify - you can draw what you want and it’ll present you with a list of trained examples!  Very nice, comes in iPad flavour too.  I’ve tried out a few of the examples on this page, as an exercise.

I’m using quick LaTeX which is by far the best plugin I’ve tried. Thoroughly recommended.

My favourite \LaTeX symbol is \Im. Good to know.

Symbols

\alpha, \Alpha, \beta, \Beta, \gamma, \Gamma, \pi, \Pi, \phi, \varphi, \Phi means:

alpha, Alpha, beta, Beta, gamma, Gamma, pi, Pi, phi, varphi, Phi. (Missing characters mean just use normal uppercase roman characters, like A

Lambda (\lambda)-ish calc notation

\forall x \in X,\quad \exists y \leq \epsilon means:

For all x in X, exists Y less than equal to epsilon

A \subset B and A \subseteq B denote  A is a subset of B.  However, \subset is more properly used to denote a proper subset. (Set Theory)

Geometry

Thus, something like \{x_i\}_{i=1}^{m} \subseteq \mathds{R} should refer to a vector of values for x indexed at 1 and of m length, that is a subset of real numbers.  However, \mathds{R}^n would refer instead to the Cartesian product of n copies of R, i.e. essentially an n-length cartesian coordinate describing a point in n-dimensional space.  That is to say, when used in the context of the above example, we are now looking at a vector of coordinates in n-dimensional space, where i is a number between 1 and m, and x_i is a cartesian coordinate describing a point in space.

Math

\sum_{i=1}^{10} t_i means:

The sum of all values for t where the value of i is between 1 and 10.

\prod_{i=1}^{n} t_i means:

The same except the range of values is the variable n and you multiply each value instead of summing it.

\sqrt{ \dfrac{\sum_{i=1}^{j}(n_i)\vspace{20pt}}{\vspace{20pt}\prod_{i=1}^{j}( n_i)}} means:

The root of n divided by the product of all values of n.

x \equiv y means:

The equivalent of

E(...) refers to:

Expected values of whatever

\|x\| means:

The magnitude/length of x, or more correctly its norm (length seems more meaningful, but who am I to argue?)

\mid x\mid means:

Can mean the same as the above! Or an absolute value of a scalar; or the determinant of a matrix.

\|x_i-y_i\| means:

The distance between x and y (or the magnitude of the delta of x and y, same thing)

x \ldotp y means:

The dot product of x and y.

\bar x

Can mean the compliment of x (i.e. a subset of it); hence the symbol for mean, which refers to a subset of the total population of x?

Matrices

Capitalised characters M, I are used to denote a Matrix.  Lowercase roman letters denote variables or vectors, such as in: x, k

Generic matrix with equation numbering:

(1)    \begin{equation*} A_{m,n} = \begin{pmatrix} a_{1,1} & a_{1,2} & \cdots & a_{1,n} \\ a_{2,1} & a_{2,2} & \cdots & a_{2,n} \\ \vdots  & \vdots  & \ddots & \vdots  \\ a_{m,1} & a_{m,2} & \cdots & a_{m,n} \end{pmatrix} \end{equation*}

Variation… m, n, refer to rows, cols

(2)    \begin{equation*} B_{2,4} = \begin{bmatrix} 1, 2, 3, 4\\ 5, 6, 7, 8 \end{bmatrix} \end{equation*}

Probability

P(y=1|x;\theta) = 0.7 means the probability that y is equal to 1, given x parameterised by theta, is 0.7
x \sim \mathscr{N}(\mu,\sigma^{2}) x is distributed as N(params).
Geometry

Aymptote = curve that approaches zero distance to a line or axis as it approaches infinity.

Leave a Reply