.. title: Engineering Probability Class 7 Thurs 2021-02-18
.. slug: class07
.. date: 2021-02-18
.. tags: class
.. link: 
.. description: 
.. type: text
.. has_math: true

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


Link to lecture videos
----------------------

is now in the top menu bar.


Midterm exam 1
--------------

Will be on Mon March 1.   To accommodate students in China, the exam will be administered twice.


Fictional university, try 2
---------------------------

#. Consider a fictional university that has both undergrads and grads.  It
   also has both Engineers and others:

   .. image:: /images/venn-stu.png

#. Compute P[E|U], P[E|U'], P[U|E], etc.

   
Bayes theorem ctd
-----------------

#. `Wikipedia on Bayes theorem <https://en.wikipedia.org/wiki/Bayes%27_theorem>`_.

   We'll do the defective item example, using both numbers and Bayes rule.
   
#. We'll do these examples from Leon-Garcia in class.

#. Example 2.28, page 51.  Assume P[A0]=1/3.  P[e]=.1  What is P[A0|B0]?

   
#. Example 2.30, page 53, chip quality control: For example 2.28, how long do we have
   to burn in chips so that the survivors have a 99% probability of being
   good?  p=0.1, a=1/20000.   




Chapter 2 ctd: Independent events
---------------------------------

#. 2.5 Independent events
   
   a. :math:`P[A\cap B] = P[A] P[B]`
   #. P[A|B] = P[A],  P[B|A] = P[B]

#. A,B independent means that knowing A doesn't help you with B.

#. Mutually exclusive events w.p.>0 must be dependent.

#. Example 2.32, page 55.
   
#. Example 2.33, page 56.  

   .. image:: /images/fig214.jpg

#. More that 2 events:
   
   a. N events are independent iff the occurrence of no combo of the events
      affects another event.
   #. Each pair is independent.
   #. Also need :math:`P[A\cap B\cap C] = P[A] P[B] P[C]`
   #. *This is not intuitive*  A, B, and C might be pairwise independent,
      but, as a group of 3, are dependent.
   #. See example 2.32, page 55.  A: x>1/2.  B: y>1/2.  C: x>y

#. Common application: independence of experiments in a sequence.

#. Example 2.34: coin tosses are assumed to be independent of each other.

   P[HHT] = P[1st coin is H] P[2nd is H] P[3rd is T].

#. Example 2.35, page 58. System reliability
   
   a. Controller and 3 peripherals.
   #. System is up iff controller and at least 2 peripherals are up.
   #. Add a 2nd controller.

#. 2.6 p59 Sequential experiments:  *maybe* independent

#. 2.6.1 Sequences of independent experiments
   
   a. Example 2.36 

#. 2.6.2 Binomial probability
   
   a. *Bernoulli trial* flip a possibly unfair coin once. *p* is
      probability of head.
   #. (Bernoulli did stats, econ, physics, ... in 18th century.)
   
#. Example 2.37
   
   a. P[TTH] = :math:`(1-p)^2 p`
   #. P[1 head] =  :math:`3 (1-p)^2 p`

#. Probability of exactly k successes = :math:`p_n(k) = {n \choose k} p^k (1-p)^{n-k}`

#. :math:`\sum_{k=0}^n p_n(k) = 1`

#. Example 2.38

#. Can avoid computing n! by computing :math:`p_n(k)` recursively, or by using
   approximation.  Also, in C++, using double instead of float helps.
   (Almost always you should use double instead of float.  It's the same
   speed on normal CPUs.)

#. Example 2.39 

#. Example 2.40 Error correction coding



