probability-discrete.rst
changeset 15 f606de7b91b0
parent 13 8a32b268e8bf
equal deleted inserted replaced
14:d9c9bc2d2ac9 15:f606de7b91b0
    80 
    80 
    81 :def:`Variance` is a:
    81 :def:`Variance` is a:
    82 
    82 
    83 .. math::
    83 .. math::
    84 
    84 
    85   var[X] = E[(X - E[X])^2] = E[X^2] - E^2[X]
    85   var[X] = E[(X - E[X])²] = E[X²] - (E[X])²
    86 
    86 
    87 :def:`Standard deviation` is a:
    87 :def:`Standard deviation` is a:
    88 
    88 
    89 .. math::
    89 .. math::
    90 
    90 
   103 Let :math:`A_i ∩ A_j = ∅` for :math:`i ≠ j` and :math:`∑_i\ A_i = Ω`:
   103 Let :math:`A_i ∩ A_j = ∅` for :math:`i ≠ j` and :math:`∑_i\ A_i = Ω`:
   104 
   104 
   105 .. math::
   105 .. math::
   106 
   106 
   107   p_X(x) = Σ_i P(A_i)·p_{X|A_i}(x)
   107   p_X(x) = Σ_i P(A_i)·p_{X|A_i}(x)
       
   108 
       
   109 * https://en.wikipedia.org/wiki/Law_of_total_probability
   108 
   110 
   109 Conditional PMF on event
   111 Conditional PMF on event
   110 ========================
   112 ========================
   111 
   113 
   112 :def:`Conditional PMF on event` is:
   114 :def:`Conditional PMF on event` is:
   494        negative;
   496        negative;
   495             x
   497             x
   496        ------------
   498        ------------
   497         2
   499         2
   498        x  - 2 x + 1
   500        x  - 2 x + 1
       
   501 
       
   502 .. math::
       
   503 
       
   504   E[(geom(p))²] = ∑_{x=1..∞} x²·p·(1-p)^(x-1)
       
   505 
       
   506   = p·∑_{x=1..∞} x²·(1-p)^(x-1)
       
   507 
       
   508   = p/(1-p)·∑_{x=0..∞} x²·(1-p)^x
       
   509 
       
   510   = p/(1-p)·(1-p)·(1-p+1)/(1 - (1-p))³ = p·(2-p)/p³ = (2-p)/p²
       
   511 
       
   512 .. NOTE::
       
   513 
       
   514    Maxima calculation::
       
   515 
       
   516     load("simplify_sum");
       
   517     (%i3) assume(x>0);
       
   518     (%o3)                               [x > 0]
       
   519     (%i4) assume(x<1);
       
   520     (%o4)                               [x < 1]
       
   521 
       
   522     (%i8) simplify_sum(sum(k^2 * x^k, k, 0, inf));
       
   523                                               2
       
   524                                          x + x
       
   525     (%o8)                        - -------------------
       
   526                                     3      2
       
   527                                    x  - 3 x  + 3 x - 1
       
   528 
       
   529 So:
       
   530 
       
   531 .. math:: var(geom(p)) = E[(geom(p))²] - E[geom(p)]² = (2-p)/p² - 1/p² = (1-p)/p²