.. title: Engineering Probability Class 8 Mon 2020-02-10
.. slug: class08
.. date: 2020-02-10
.. tags: class
.. link: 
.. description: 
.. type: text
.. has_math: true

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


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

`Oct. 5, 1960: The moon tricks a radar <https://www.nytimes.com/2018/01/13/us/false-alarm-missile-alerts.html>`_.

Where would YOU make the tradeoff between type I and type II errors?


Chapter 3 ctd
-------------
   
#. 3.4 page 111 Conditional pmf

#. Example 3.24 Residual waiting time
   
   #. X, time to xmit message, is uniform in 1...L.
   #. If X is over m, what's probability that remaining time is j?
   #. :math:`p_X(m+j|X>m) = \frac{P[X =m+j]}{P[X>m]} = \frac{1/L}{(L-m)/L} = 1/(L-m)`

#. :math:`p_X(x) = \sum p_X(x|B_i) P[B_i]`

#. Example 3.25 p 113 device lifetimes
   
   #. 2 classes of devices, geometric lifetimes.
   #. Type 1, probability :math:`\alpha`, parameter r.  Type 2 parameter s.
   #. What's pmf of the total set of devices?

#. Example 3.26, p114.

#. 3.5 p115 More important discrete r.v

#. Table 3.1: We haven't seen :math:`G_X(z)` yet.
 
#. 3.5.1 p 117 The Bernoulli Random Variable

   We'll do mean and variance.

#. Example 3.28  p119 Variance of a Binomial Random Variable

#. Example 3.29 Redundant Systems

#. 3.5.3 p119 The Geometric Random Variable

   It models the time between two consecutive occurrences in a sequence of independent random events.  E.g., the length of a run of white bits in a scanned image (if the bits are independent).

#. 3.5.4 Poisson r.v.
   
   #. The experiment is observing how many of a large number of rare events happen in, say, 1 minute.  
   #. E.g., how many cosmic particles hit your DRAM, how many people call to call center.
   #. The individual events are independent.  *(In the real world this might be false.   If a black hole occurs, you're going to get a lot of cosmic particles.   If the ATM network crashes, there will be a lot of calls.)*
   #. The r.v. is the number that happen in that period.
   #. There is one parameter, :math:`\alpha`.  Often this is called    :math:`\lambda`.

      .. math::
	 
	 p(k) = \frac{\alpha^k}{k!}e^{-\alpha}
	 
   #. Mean and std dev are both :math:`\alpha`.
   #. In the real world, events might be dependent.

#. Example 3.32 p123 Errors in Optical Transmission

#. 3.5.5 p124 The Uniform Random Variable   

Poisson vs Binomial vs Normal distributions
-------------------------------------------

The binomial distribution is the exact formula for the probability of k successes from n trials (with replacement).

When n and k are large but p=k/n is small, then the Poisson distribution is a good approximation to the binomial.  Roughly, n>10, k<5.   

When n is large and p is not too small or too large, then the normal distribution, which we haven't seen yet, is an excellent approximation.  Roughly, n>10 and :math:`|n-k|>2\ \sqrt{n}` .

For big n, you cannot use binomial, and for really big n, cannot use Poisson.   Imagine that your experiment is to measure the number of atoms decaying in this `uranium ore <https://www.amazon.com/Images-SI-Uranium-Ore/dp/B000796XXM>`_ .  How would you compute :math:`\left(10^{23}\right)!` ?   

OTOH, for small n, you can compute binomial by hand.  Poisson and normal probably require a calculator.



   
      
Chapter 4
---------

#. I will try to ignore most of the theory at the start of the chapter.
#. Now we will see continuous random variables.  

   a. The probability of the r.v being any exact value is infinitesimal,
   #. so we talk about the probability that it's in a range.

#. Sometimes there are mixed discrete and continuous r.v.   

   a. Let X be the time X to get a taxi at the airport.
   #. 80% of the time a taxi is already there, so p(X=0)=.8.
   #. Otherwise we wait a uniform time from 0 to 20 minutes, so p(a<x<b)=.01(b-a), for 0<a<b<20.

#. Remember that for discrete r.v. we have a **probability mass function (pmf)**.
#. For continuous r.v. we now have a **probability density function**
   **(pdf)**, :math:`f_X(x)`.
#. p(a<x<a+da) = f(a)da
#. For any r.v., we have a **cumulative distribution function (cdf)**  :math:`F_X(x)`.
#. The subscript is interesting only when we are using more than one cdf and
   need to tell them apart.
#. Definition: F(x) = P(X<=x).
#. The <= is relevant only for discrete r.v.
#. As usual Wikipedia isn't bad, and is deeper than we need here, `Cumulative_distribution_function <http://en.wikipedia.org/wiki/Cumulative_distribution_function>`_.
#. We compute means and other moments by the obvious integrals.


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

`Seashell <https://xkcd.com/1236/>`_
	
