.. title: Engineering Probability Class 3 Thu 2018-01-25
.. slug: class03
.. date: 2018-01-25
.. tags: mathjax
.. category: class
.. link: 
.. description: 
.. type: text

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

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

#. `How Did Economists Get It So Wrong? <http://www.nytimes.com/2009/09/06/magazine/06Economic-t.html?ref=magazine>`_ is an article by Paul
   Krugman (2008 Nobel Memorial Prize in Economic Science).  It says, "the economics profession went astray
   because economists, as a group, mistook beauty, clad in
   impressive-looking mathematics, for truth."  You might see a certain
   relevance to this course.  You have to get the model right before trying
   to solve it.

   Though I don't know much about it, I'll cheerfully try to answer any
   questions about econometrics.

   Another relevance to this course, in an enrichment sense, is that some
   people believe that the law of large numbers does not apply to certain
   variables, like stock prices.  They think that larger and larger sample
   frequencies do not converge to a probability, because the variance of the
   underlying distribution is infinite.  See
   `Do financial returns have finite or infinite variance? A paradox and 
   an explanation <http://www.informaworld.com/smpp/content~db=all~content=a924378018~frm=titlelink>`_ . This also is beyond this course.


#. More articles on MIT students gaming the Mass lottery:

   #. `How a Group of MIT Students Gamed the Massachusetts State Lottery <https://www.theatlantic.com/business/archive/2016/02/how-mit-students-gamed-the-lottery/470349/>`_
   #. `A Calculated Approach to Winning the Lottery <https://alum.mit.edu/slice/calculated-approach-winning-lottery>`_
     

Iclicker questions
------------------

#. Answer this question (won't be graded):  2+2=?

   a. 1
   #. 2
   #. 3.9999
   #. 4
   #. Whatever you want it to be (you're an accountant).

   Continuous probability:

   #. S is the real interval [0,1].   
   #. P([a,b]) = b-a if 0<=a<=b<=1.   
   #. Event A = [.2,.6].
   #. Event B = [.4,1].

   Questions:

#. What is P[A]?

   a. .2
   #. .4
   #. .6
   #. .8
   #. 1.

#. What is P[B]?

   a. .2
   #. .4
   #. .6
   #. .8
   #. 1.

#. What is P[A :math:`\cup` B]?

   a. .2
   #. .4
   #. .6
   #. .8
   #. 1.

#. What is P[A :math:`\cap` B]?

   a. .2
   #. .4
   #. .6
   #. .8
   #. 1.

#. What is P[A :math:`\cup` B :math:`^c` ]?

   a. .2
   #. .4
   #. .6
   #. .8
   #. 1.


#. Retransmitting a noisy bit 3 times: Set e=0.1.  What is
   probability of no error in 3 bits:

   a. 0.1
   #. 0.3
   #. 0.001
   #. 0.729
   #. 0.9

#. Flipping a fair coin until we get heads:   How many times will it take until the probability of seeing a head is >=.8?

   a. 1
   #. 2
   #. 3
   #. 4
   #. 5

#. This time, the coin is weighted so that p[H]=.6.   How many times will it take until the probability of seeing a head is >=.8?

   a. 1
   #. 2
   #. 3
   #. 4
   #. 5



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

#. Corollory 5:
   :math:`P[A\cup B] = P[A] + P[B] - P[A\cap B]` 

   a. Proof from the fact that :math:`P[A], P[B], P[A\cap B]` are disjoint. 
   #. Example: Queens and hearts.  
      P[Q]=4/52,  P[H]=13/52, P[Q :math:`\cup` H]=16/52,  P[Q :math:`\cap` H]=1/52.
   #. :math:`P[A\cup B] \le P[A] + P[B]` 

#. 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.










      
Material added after class
--------------------------

#. `My handwritten tablet notes <../../handwritten/125.pdf>`_.   

