## Useful mathematical symbols

symbol tex digraph how it reads
<: is a subtype of
\vDash <bar> = entails
\vdash <bar> - infers
\to -> is mapped to maps sets to sets
\mapsto <bar> > is mapped to maps elements to elements

## Euler’s Characteristic

The second most beautiful equation and its surprising applications - YouTube

Not every shape has an Euler Characteristic that equals 2.

For example, donut or torus.

This is a specific case where it equals 2
$$V - E + F = 2$$

For any convex polyhedron the vertices, minus edges, plus faces will always equal 2.

It also holds on curved surfaces (e.g. the longitude and latitude lines on a sphere).

The Euler characteristic remains the same under homeomorphisms (topological stretching).

## Sphere packing

• square contains $$2^2 = 4$$ circles, one for each quadrant
• cube contains $$2^3 = 8$$ spheres, one for each octant
• 9D-hypercube contains $$2^9 = 512$$ 9D hyperspheres, one for each division

A 9D-cube is able to fit one hypersphere between and touching all 512 which tangents on all the edges of the hypercube too.

As the number of dimensions goes up, the distance between opposing faces of the cube stay the same while the diagonal distance between opposite corners gets longer and longer

## Bayes theorem

 1 2 3   P(Netflix|chill) P(chill) P(chill|Netflix) = ------------------------- P(Netflix)
Posterior probability
P(Netflix)
Likelihood
P(Netflix|chill)
Prior probability
P(chill)

## 5-Sided Square

5-Sided Square - Numberphile - YouTube

3-sided squares are possible if you draw right angles on a sphere.

A sphere has constant Gaussian curvature.

You can make a pseudosphere.

A pseudosphere has constant negative curvature.

Hyperbolic secants and co-secants.

Hyperbolic space is amazing.

A sphere can create a 3-sided square

A pseudosphere can create a 5-sided square.

If spacetime is curved, does this mean we can use curvature to create atomic structures that could not exist in regular, flat space?

The universe appears to have some kind of negative curvature.

This means that at a large scale things appear to fit inside it which could not otherwise fit if there was not equal curvature.

## Glossary

 1 2 3 4 5 6 7 8  Particle filters Sequential Monte Carlo method SMC method [set of MC algorithms] Used to solve filtering problems arising in signal processing and Bayesian statistical inference.

## Pascal’s Triangle

### Generate it with code

 1 2 3  #+BEGIN_SRC sh -n :async :results verbatim drawer pascals-triangle #+END_SRC
  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17  #!/bin/bash export TTY is_tty() { # If stout is a tty [[ -t 1 ]] } pager() { if is_tty; then vs $@ else cat fi } runhaskell$HOME/scripts/pascals-triangle.hs 10 | tabulate | tr '\t' ' ' | pager
  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38  #!/home/shane/scripts/runhaskell import Data.List (transpose) import System.Environment (getArgs) import Text.Printf (printf) -- Pascal's triangle. pascal :: [[Int]] pascal = iterate (\row -> 1 : zipWith (+) row (tail row) ++ )  -- The n by n Pascal lower triangular matrix. pascLow :: Int -> [[Int]] pascLow n = zipWith (\row i -> row ++ replicate (n-i) 0) (take n pascal) [1..] -- The n by n Pascal upper triangular matrix. pascUp :: Int -> [[Int]] pascUp = transpose . pascLow -- The n by n Pascal symmetric matrix. pascSym :: Int -> [[Int]] pascSym n = take n . map (take n) . transpose $pascal -- Format and print a matrix. printMat :: String -> [[Int]] -> IO () printMat title mat = do putStrLn$ title ++ "\n" -- mapM_ (putStrLn . concatMap (printf " %2d")) mat mapM_ (putStrLn . concatMap (printf "\t%2d")) mat putStrLn "\n" main :: IO () main = do ns <- fmap (map read) getArgs case ns of [n] -> do printMat "Lower triangular" $pascLow n printMat "Upper triangular"$ pascUp n printMat "Symmetric" $pascSym n _ -> error "Usage: pascmat " ### Output   1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40  Lower triangular 1 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 2 1 0 0 0 0 0 0 0 1 3 3 1 0 0 0 0 0 0 1 4 6 4 1 0 0 0 0 0 1 5 10 10 5 1 0 0 0 0 1 6 15 20 15 6 1 0 0 0 1 7 21 35 35 21 7 1 0 0 1 8 28 56 70 56 28 8 1 0 1 9 36 84 126 126 84 36 9 1 Upper triangular 1 1 1 1 1 1 1 1 1 1 0 1 2 3 4 5 6 7 8 9 0 0 1 3 6 10 15 21 28 36 0 0 0 1 4 10 20 35 56 84 0 0 0 0 1 5 15 35 70 126 0 0 0 0 0 1 6 21 56 126 0 0 0 0 0 0 1 7 28 84 0 0 0 0 0 0 0 1 8 36 0 0 0 0 0 0 0 0 1 9 0 0 0 0 0 0 0 0 0 1 Symmetric 1 1 1 1 1 1 1 1 1 1 1 2 3 4 5 6 7 8 9 10 1 3 6 10 15 21 28 36 45 55 1 4 10 20 35 56 84 120 165 220 1 5 15 35 70 126 210 330 495 715 1 6 21 56 126 252 462 792 1287 2002 1 7 28 84 210 462 924 1716 3003 5005 1 8 36 120 330 792 1716 3432 6435 11440 1 9 45 165 495 1287 3003 6435 12870 24310 1 10 55 220 715 2002 5005 11440 24310 48620 ### Explanation   1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49  Lower triangular To get the fibonacci sequence, sum the diagonals. 1 1 2 3 etc. / / / / 1 / / / / 1 / 1 / / / 2 1 / 1 / 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1 1 6 15 20 15 6 1 1 7 21 35 35 21 7 1 1 8 28 56 70 56 28 8 1 1 9 36 84 126 126 84 36 9 1 Upper triangular To get the fibonacci sequence, sum the diagonals as above. 1 1 1 1 1 1 1 1 1 1 1 2 3 4 5 6 7 8 9 1 3 6 10 15 21 28 36 1 4 10 20 35 56 84 1 5 15 35 70 126 1 6 21 56 126 1 7 28 84 1 8 36 1 9 1 Symmetric This is the traditional pascal's triangle. To get the fibonaccy sequence, translate across the grid in an L shape. 1 right, 2 up. 1 1 1 1 1 1 1 1 1 1 1 2 3 4 5 6 7 8 9 10 1 3 6 10 15 21 28 36 45 55 1 4 10 20 35 56 84 120 165 220 1 5 15 35 70 126 210 330 495 715 1 6 21 56 126 252 462 792 1287 2002 1 7 28 84 210 462 924 1716 3003 5005 1 8 36 120 330 792 1716 3432 6435 11440 1 9 45 165 495 1287 3003 6435 12870 24310 1 10 55 220 715 2002 5005 11440 24310 48620 ## Bayes’ Rule   1 2 3 4 5 6 7 8 9 10 11  \begin{equation} \underbrace{p(\mathbf{z} \mid \mathbf{x})}_{\text{Posterior}} = \underbrace{p(\mathbf{z})}_{\text{Prior}} \times \frac{\overbrace{p(\mathbf{x} \mid \mat hbf{z})}^{\text{Likelihood}}}{\underbrace{\int p(\mathbf{x} \mid \mathbf{z}) \, p(\mathbf{z}) \, \mathrm{d}\mathbf{z}}_{\text{Marginal Likelihood}}} \enspace , \end{equation} where$\mathbf{z}$denotes latent parameters we want to infer and$\mathbf{x}$denotes data. \begin{equation} \underbrace{p(\mathbf{z} \mid \mathbf{x})}_{\text{Posterior}} = \underbrace{p(\mathbf{z})}_{\text{Prior}} \times \frac{\overbrace{p(\mathbf{x} \mid \mathbf{z})}^{\text{Likelihood}}}{\underbrace{\int p(\mathbf{x} \mid \mathbf{z}) , p(\mathbf{z}) , \mathrm{d}\mathbf{z}}_{\text{Marginal Likelihood}}} \enspace , \end{equation} where $$\mathbf{z}$$ denotes latent parameters we want to infer and $$\mathbf{x}$$ denotes data.** Euclid  1 2 3 4 5 6 7 8 9  \Procedure{Euclid}{$a,b$} \State$r\gets a\bmod b$\While{$r\not=0$} \State$a\gets b$\State$b\gets r$\State$r\gets a\bmod b$\EndWhile \State \textbf{return}$b\$ \EndProcedure

#### Appendix

This person talks about math related to statistics and computing.