Transcript Probabilities
Probabilities
Addition Rule: p(A or B) = p(A) + p(B) - p(A&B) A A & B B
1
Probabilities
Addition Rule: p(A or B) = p(A) + p(B) - p(A&B) A A & B B
2
Probabilities
Multiplication Rule: p(A & B) = p(A) · p(B|A)
Liars Yes No Total Yes 20 Lawyers No 10 20 40 50 60 Total 30 70 100
Calculate: p(Liar), p(Lawyer), p(Liar | Lawyer), p(Lawyer | Liar) p(Liar & Lawyer), p(Liar or Lawyer)
3
Crosstabulation
A table that displays the joint distribution of two categorical variables Basic tool for analysis of data Basic tool for understanding relationships between variables Liars Yes No Total Yes Lawyers No 20 20 40 10 50 60 Total 30 70 100 4
Liars
Compare
Yes No Total Yes 20 Lawyers No 10 20 40 50 60
p(Lawyer) and p(Lawyer | Liar) p(Liar) and p(Liar | Lawyer)
Total 30 70 100 5
Sex
Compare
Male Femal Total Delinquent Yes 50 30 80 No 500 300 800
p(Delinq.) and p(Delinq. | Male) p(Delinq.) and p(Delinq. | Female) What if you only had info. on delinquents?
Total 550 330 880 6
Probabilities and sampling
Imagine a population of 10 marbles, 3 red and 7 black in a jar Imagine drawing one marble from the jar What is p(red)?
What is p(black)?
7
Probabilities and sampling
Now, from that same jar, draw a marble, note its color, return it, and shake them up and draw a second marble.
What is p(red & red)?
What is p(red & black)?
What is p(black & black)?
8
Probabilities and sampling
To solve this problem, we have to imagine all possible samples that might be drawn from the jar.
Start with p(red & red) How many ways can we get two red marbles? Only one! Why?
p(red & red) = p(red) * p(red | red) 9
Probabilities and sampling
How many ways can we get two black marbles? Only one! Why?
p(black & black) = p(black) * p(black) How many ways can we get one black and one red? Two! Why?
P(red & black) = 1 - p(r&r) - p(b&b). Why?
10
Probabilities and sampling
So, we end up with p(r & r) = .3 * .3 = .09
p(b & b) = .7 * .7 = .49
p(r & b) = 1 - .09 - .49 = .42
Note also p(r & b) = p(getting a red followed by a black) + p(getting a black followed by a red) = (.3 * .7) + (.7 * .3) And, this is .21 + .21 = .42
11
Combinations and Permutations
Permutations are the ordering of events.
In cards, the combination A & K & Q can be ordered in different ways you don’t care if you draw: AKQ, AQK, QKA, QAK, KAQ, KQA There are 6 possible orderings or ways to get an A and a K and a Q If order is important we are interested in the permutations, if not, we are interested in the combinations.
12
Combinations and Permutations
If order is important, then the permutation getting first an A, then a K, then a Q is (1/13)*(1/13)*(1/13) = 1 / 2179 If order is not important then there are 6 mutually exclusive ways to get the combination AKQ, each of which has p = 1 / 2179, so all together the p(A&K&Q) = 6 / 2179 13
Puzzle
You have three identical small chests each with two drawers. In one chest, each drawer has a gold coin. In another chest, each drawer has a silver coin. In the third chest one drawer has a gold coin, and one has a silver coin.
You open a drawer at random and find a gold coin. What is the probability the other drawer has a gold coin?
14
Puzzle (cont.)
A Gold Gold B Silver Gold
Find p(Gold | Gold)
C Silver Silver 15
Red and black marbles (again)
The jar had 7 black and 3 red.
Consider a sampling problem We will draw (with replacement) 5 marbles.
What are the possible outcomes?
What is the probability of each?
16
Sampling
Etc.
17
Sampling (cont.)
1 way of getting all black 5 of getting one red 10 of getting two red 10 of getting three red 5 of getting four red 1 of getting five red WHY?
18
Sampling (cont.)
All black = .7 * .7 * .7 * .7 * .7 = .17
One red = 5 * .3 * .7 * .7 * .7 * .7 = .36
Two red = 10 * .3 * .3 * .7 * .7 *.7 = .31
Three red = 10 * .3 * .3 * .3 * .7 * .7 = .13
Four red = 5 * .3 * .3 * .3 * .3 * .7 = .03
Five red = .3 * .3 * .3 * .3 * .3 = .002
Total = .17+.36+.31+.13+.03+.002= 1.00
19
Probability of r red marbles
0.4
0.35
0.3
0.25
0.2
0.15
0.1
0.05
0 0 1 2 3 4
Number of Red Marbles
5 20