.. title: Engineering Probability Class 3 Mon 2021-02-01
.. slug: class03
.. date: 2021-02-01
.. tags: class
.. link: 
.. description: 
.. type: text
.. has_math: true

.. sectnum::
.. contents:: Table of contents::
..


Homework 2
----------

is online, due in a week.


Probability in the real world - enrichment
------------------------------------------

`How MIT Students Won $8 Million in the Massachusetts Lottery <http://newsfeed.time.com/2012/08/07/how-mit-students-scammed-the-massachusetts-lottery-for-8-million/>`_.


Chapter 2 ctd
-------------

#. Corollory 6:

   :math:`\begin{array}{c} P\left[\cup_{i=1}^n A_i\right] = \\    \sum_{i=1}^n P[A_i] \\ - \sum_{i<j} P[A_i\cap A_j] \\    + \sum_{i<j<k} P[A_i\cap A_j\cap A_k] \cdots \\ + (-1)^{n+1}    P[\cap_{i=1}^n A_i] \end{array}`

   a. Example Q=queen card, H=heart, F= `face card <http://en.wikipedia.org/wiki/Face_card>`_.

      i. P[Q]=4/52, P[H]=13/52, P[F]=12/52, 
      #. P[Q :math:`\cap` H]=1/52, P[Q :math:`\cap` F] = ''you tell me''
      #. P[H :math:`\cap` F]= ''you tell me''
      #. P[Q :math:`\cap` H  :math:`\cap` F] =  ''you tell me''
      #. So  P[Q :math:`\cup` H  :math:`\cup` F] = ?

   #. Example from `Roulette <http://en.wikipedia.org/wiki/Roulette>`_:
      
      i. R=red, B=black, E=even, A=1-12
      #. P[R] = P[B] = P[E] = 16/38.  P[A]=12/38
      #. :math:`P[R\cup E \cup A]` = ?

#. Corollory 7: if :math:`A\subset B` then P[A] <= P[B]

   Example: Probability of a repeated coin toss having its first head in the
   2nd-4th toss (1/2+1/4+1/8) :math:`\ge` Probability of it happening in the 3rd toss (1/4).

#. 2.2.1 Discrete sample space

   a. If sample space is finite, probabilities of all the outcomes tell you
      everything.
   #. sometimes they're all equal.   
   #. Then P[event]} :math:`= \frac{\text{#. outcomes in event}}{\text{total # outcomes}}`
   #. For countably infinite sample space, probabilities of all the outcomes
      also tell you everything.
   #. E.g. fair coin.  P[even] = 1/2
   #. E.g. example 2.9.   Try numbers from `random.org <http://random.org/>`_.
   #. What probabilities to assign to outcomes is a good question.
   #. Example 2.10.  Toss coin 3 times.

      i. Choice 1: outcomes are TTT ... HHH, each with probability 1/8
      #. Choice 2: outcomes are # heads: 0...3, each with probability 1/4.
      #. Incompatible.  What are probabilities of # heads for choice 1?
      #. Which is correct?   
      #. Both might be mathematically ok.
      #. It depends on what physical system you are modeling.
      #. You might try doing the experiment and observing.
      #. You might add a new assumption: The coin is fair and the tosses independent.

#. Example 2.11: countably infinite sample space.

   a. Toss fair coin, outcome is # tosses until 1st head.
   #. What are reasonable probabilities?
   #. Do they sum to 1?

#. 2.2.2 Continuous sample spaces

   a. Usually we can't assign probabilities to points on real line.  (It just
      doesn't work out mathematically.)
   #. Work with set of intervals, and Boolean operations on them.
   #. Set may be finite or countable.
   #. This set of events is a ''Borel set''.
   #. Notation:  

      i. [a,b] closed. includes both.   a<=x<=b
      #. (a,b) open. includes neither.   a<x<b
      #. [a,b) includes a but not b,  a<=x<b
      #. (a,b] includes b but not a, a<x<=b

   #. Assign probabilities to intervals (open or closed).
   #. E.g., uniform distribution on [0,1] :math:`P[a\le x\le b] = \frac{1}{b-a}`
   #. Nonuniform distributions are common.
   #. Even with a continuous sample space, a few specific points might have
      probabilities.  The following is mathematically a valid probability
      distribution.   However I can't immediately think of a physical system
      that it models.

      i.  :math:`S = \{ x | 0\le x\le 1 \}`
      #.  :math:`p(x=1) = 1/2`
      #.  For :math:`0\le x_0 \le 1, p(x<x_0) = x_0/2`

#. For fun: `Heads you win, tails... you win. You can beat the toss of a coin 
   and here's how... <http://www.dailymail.co.uk/sciencetech/article-1239823/Heads-win-tails--win-You-beat-toss-coin-heres-.html?ITO=1490>`_.

#. Example 2.13, page 39, nonuniform distribution: chip lifetime.

   a. Propose that P[(t, :math:`\infty` )] = :math:`e^{-at}`  for t>0.
   #. Does this satisfy the axioms?
   #. I: yes >0
   #. II: yes, P[S] = :math:`e^0` = 1
   #. III here is more like a definition for the probability of a finite interval
   #. P[(r,s)] = P[(r, :math:`\infty` )] - P[(s, :math:`\infty` )] = :math:`e^{-ar} - e^{-as}`

#. Probability of a precise value occurring is 0, but it still can occur, since
   SOME value has to occur.

#. Example 2.14: picking 2 numbers randomly in a unit square.

   a. Assume that the probability of a point falling in a particular region is
      proportional to the area of that region.
   #. E.g.  P[x>1/2 and y<1/10] = 1/20
   #. P[x>y] = 1/2

#. Recap:

   a. Problem statement defines a random experiment
   #. with an experimental procedure and set of measurements and observations
   #. that determine the possible outcomes and sample space
   #. Make an initial probability assignment
   #. based on experience or whatever
   #. that satisfies the axioms.



To watch
--------

Rich Radke's Probability Bites:

6. Combinatorics Practice Problems
#. Continuous Sample Spaces
#. Conditional Probability



https://www.youtube.com/playlist?list=PLuh62Q4Sv7BXkeKW4J_2WQBlYhKs_k-pj


Xkcd comic
----------

`P-Values <https://xkcd.com/1478/>`_
