Docsity

Probability Theory: Lecture 27 - Conditional Probability and Expected Values, Study notes of Discrete Structures and Graph Theory

Partial preview of the text

Download Probability Theory: Lecture 27 - Conditional Probability and Expected Values and more Study notes Discrete Structures and Graph Theory in PDF only on Docsity!

CSci 243

Discrete Structures

Lecture 27

Probability II

Outline

  • Review/Application: Random Binary Trees
  • Conditional Probability
  • Independence Revisited
  • Expected Values
  • Random Variables

Review: Random Binary Trees

  • Chance of at least one child node
  • p(left U right) = ½ + ½ – (½)(½) = ¾
  • Same as 1 – chance of not making a child node
  • 1-p(not left)×p(not right) = 1 – (½)(½) = ¾

Intro to Conditional Probability

  • So far we’ve dealt with independent events where we know the probabilities of each event
  • Example: The probability of having a boy given that you already have a boy is ½.
  • What if the second event depends on the first?
  • What if we know the overall probability of two events happening and the probability of the first, but not the probability of the second?

Conditional Probability: Example 1

  • E: The event that three coin tosses results in an odd number of heads
  • F: The event that the first flip is a head
  • The outcomes of E are affected by F’s outcome
  • Let’s look at the outcomes…
  • Conditional Probability: Example

Quick Check

  • Suppose a politician wants to “get in touch” with working voters by visiting a constituent at random. The politician wants to know the probability of choosing a woman, given that the person to be chosen must be employed.
  • p(W | E) =?

Employed Unemployed Total Male 460 40 500 Female 140 260 400 Total 600 300 900

Independence

  • It’s nice when we know that one event is independent of another. - e.g. The probability of flipping a coin and getting a head can be computed irrespective of previous flips
  • Independent events : Events A and B are independent iff p(B|A)=p(B) and p(A|B)=p(A)
  • Or…: Events A and B are independent iff p(AIB)=p(A)p(B)

Combinations of Events Revisited

  • Recall from last lecture: The probability that both of two independent events occur - p(E 1 I E 2 ) = p(E 1 ) × p(E 2 )
  • We can generalize now: The probability that both of two ( possibly dependent ) events occur - p(E 1 I E 2 ) = p(E 1 ) × p(E 2 |E 1 )
  • Get previous result if we know independence
    • p(E 2 |E 1 )=p(E 2 )

Next up… Random Vars, Expected Vals

Probability of Random Variable

  • p(X=r): The probability that a random variable X has value r.
  • The sum of probabilities for outcomes s where X(s) = r
  • Example: Three coin flips, what is the probability that there are 2 heads? - {HHH, HHT, HTH, THH, TTH, THT, HTT, TTT} - Each has a 1/8 chance - p(X=2) = 1/8+1/8+1/8 = 3/

Expected Values

  • Now let’s average the number of heads in 3 flips
    • Number of heads times number of such outcomes
    • (all possibilities!)
  • Or, recalling :

  • Expected value of X(s):

3 ( 18 )+ 2 (^38 )+ 1 (^38 )+ 0 (^18 ) = 1. 5

S

E

p ( E ) =

∈

s S

E ( X ) X ( s ) p ( s )

Expected Value: Example

  • What is the expected value of the sum of the numbers when a fair die is rolled twice?
  • Outcomes and their sums: (1,1)=2, (1,2)=3, (1,3)=4, (1,4)=5, (1,5)=6, (1,6)=7, (2,1)=3, (2,2)=4, (2,3)=5, (2,4)=6, (2,5)=7, (2,6)=8, (3,1)=4, (3,2)=5, (3,3)=6, (3,4)=7, (3,5)=8, (3,6)=9, (4,1)=5, (4,2)=6, (4,3)=7, (4,4)=8, (4,5)=9, (4,6)=10, (5,1)=6, (5,2)=7, (5,3)=8, (5,4)=9, (5,5)=10, (5,6)=11, (6,1)=7, (6,2)=8, (6,3)=9, (6,4)=10, (6,5)=11, (6,6)=
  • 4 of 36 ways for X=5, so p(X=5) = 4/

Expected Value: Example (cont)

  • p(X=2) = p(X=12) = 1/36 {(1,1)} p(X=3) = p(X=11) = 2/36 {(1,2), (2,1)} p(X=4) = p(X=10) = 3/36 {(1,3), (3,1), (2,2)} p(X=5) = p(X=9) = 4/36 {(1,4), (2,3), …} p(X=6) = p(X=8) = 5/36 {(1,5), (2,4), …} p(X=7) = 6/36 {(1,6), (2,5), …}

• E(X) = 2×1/36 + 3×2/36 + 4×3/36 + 5×4/36 +

6×5/36 + 7×6/36 + 8×5/36 + 9×4/36 +

10×3/36 + 11×2/36 + 12×1/36 = 7