summaryrefslogtreecommitdiff
path: root/info/mathtrip/src/prob.tex
blob: fa0c8efd5e0681973159fae30aa9463f43efbdda (plain)
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
%This command provides the text of the last column (Probability)
%on page 3
%
%The macro has one parameter:
%         1) The width of the text
%
\newcommand\TThreeProb[1]{%
    \parbox[t]{#1}{%
      \DisplaySpace{\TThreeDisplaySpace}{\TThreeDisplayShortSpace}


      %Formula 9
      \TThreeTitle{Normal (Gaussian) distribution:}
      \begin{DisplayFormulae}{1}{0pt}{2ex plus 1ex minus 1ex}{\BigChar}{\StyleWithoutNumber}
          \Fm{p(x) = \frac{1}{\sqrt{2 \pi} \sigma} e^{-(x-\mu)^2/2\sigma^2}}, 
          \Fm{\E[X] = \mu}
      \end{DisplayFormulae}

      %Formula 10
       \TThreeTitle{Continuous distributions:}%
             If $\Pr[a<X<b] = \int_{a}^b p(x)\dx$,
             then $p$ is the probability density function of $X$.

             If $\Pr[X<a] = P(a)$,
             then $P$ is the distribution function of $X$.

             If $P$ and $p$ both exist then
             $P(a) =  \int_{-\infty}^a p(x)\dx$.
                    
      %Formula 11
       \TThreeTitle{Expectation:}
         If $X$ is discrete
         $\E[g(X)] = \sum_x g(x) \Pr[X=x]$.

       \begin{DisplayFormulae}{1}{0pt}{3ex plus 1ex minus 1ex}{\SmallChar}{\StyleWithoutNumber}
         \unskip
         If $X$ continuous then
         \def\FirstPart{\E[g(X)]\mbox{}}
         \FmPartA{\FirstPart = \int_{-\infty}^{\infty} g(x) p(x)\dx}
         \FmPartB{\FirstPart}{= \int_{-\infty}^{\infty} g(x) \, d P(x)}.
       \end{DisplayFormulae}

      %Formula 12
       \TThreeTitle{Variance, standard deviation:}
       \begin{DisplayFormulae}{1}{0pt}{3ex plus 1ex minus 1ex}{\BigChar}{\StyleWithoutNumber}
          \Fm{\Var[X] = \E[X^2] - \E[X]^2},
          \Fm{\sigma = \sqrt{\Var[X]}}
       \end{DisplayFormulae}

      %Formula 13
       \TThreeTitle{For events $A$ and $B$:}%
       \begin{DisplayFormulae}{1}{0pt}{3ex plus 1ex minus 1ex}{\BigChar}{\StyleWithoutNumber}
           \Fm{\Pr[A \Or B] = \Pr[A] + \Pr[B]  - \Pr[A \And B]}
           \FmPartA{\MathRemark[\relax]{\text{iff $A$ and $B$ are independent:}}}
           %Small initial space to show that the remark is only for
           %this equation
           \FmPartB{xxxx}{\Pr[A \And B] =\Pr[A] \cdot \Pr[B]}
           \Fm{\Pr[A \vert B] = \frac{\Pr[A \And B]}{\Pr[B]}}
       \end{DisplayFormulae}%

      %Formula 14
      \TThreeTitle{For random variables $X$ and $Y$:}%
       \begin{DisplayFormulae}{1}{0pt}{3ex plus 1ex minus 1ex}{\BigChar}{\StyleWithoutNumber}
           \FmPartA{\MathRemark[\relax]{\text{if $X$ and $Y$ are independent:}}}
           %Small initial space to show that the remark is only for
           %this equation
           \FmPartB{xxxx}{\E[X \cdot Y] = \E[X] \cdot \E[Y]}
           \Fm{\E[X + Y] = \E[X] + \E[Y]}
           \Fm{\E[c X] = c \E[X]} 
       \end{DisplayFormulae}

      %Formula 15
       \TThreeTitle{Bayes' theorem:}%
       \begin{DisplayFormulae}{1}{0pt}{3ex plus 1ex minus 1ex}{\BigChar}{\StyleWithoutNumber}
           \Fm{\Pr[A_i\vert B] = 
                        \frac{\Pr[B\vert A_i] \Pr[A_i]}{\sum_{j=1}^n \Pr[A_j] \Pr[B\vert A_j]}}
       \end{DisplayFormulae}

      %Formula 16
       \TThreeTitle{Inclusion-exclusion:}
       \begin{DisplayFormulae}{1}{0pt}{3ex plus 1ex minus 1ex}{\BigChar}{\StyleWithoutNumber}
            \raggedright
            \def\FirstPart{\Pr\Big[\bigvee^n_{i=1} X_i \Big] = \mbox{}}
            \FmPartA{\FirstPart \sum^n_{i=1} \Pr[X_i] +} 
            \FmPartB{\FirstPart}{\sum_{k=2}^n (-1)^{k+1} \sum_{\smash{i_i<\cdots <i_k}} 
                        \Pr\Big[\bigwedge^k_{j=1} X_{i_j}\Big]}
       \end{DisplayFormulae}

      %Formula 17
      \TThreeTitle{Moment inequalities:}
       \begin{DisplayFormulae}{1}{0pt}{3ex plus 1ex minus 1ex}{\BigChar}{\StyleWithoutNumber}
           \Fm{\Pr\big[\vert X\vert \geq \lambda \E[X]\big] \leq \frac{1}{\lambda}},
           \Fm{\Pr\Big[\big\vert X - \E[X]\big\vert \geq \lambda \cdot \sigma \Big] 
               \leq \frac{1}{\lambda^2}}
       \end{DisplayFormulae}

      %Formula 18
       \TThreeTitle{Geometric distribution:}%
       \begin{DisplayFormulae}{1}{0pt}{3ex plus 1ex minus 1ex}{\BigChar}{\StyleWithoutNumber}
             \Fm{\Pr[X = k] = pq^{k-1}\MathRemark{q = 1-p}}, 
             \Fm{\E[X] = \sum^\infty_{k=1} kpq^{k-1} = \frac{1}{p}}
       \end{DisplayFormulae}

      \AdjustSpace{2ex plus 1ex minus .5ex}
      \noindent
      The ``coupon collector'':
      We are given a random coupon each day,
      and there are $n$ different types of coupons.
      The distribution of coupons is uniform.

      The expected number of days to pass before we to collect all $n$ types is
      $n=H_n$.
   }%
}