200 likes | 286 Views
Probabilities. Addition Rule: p(A or B) = p(A) + p(B) - p(A&B). A. B. A & B. Probabilities. Addition Rule: p(A or B) = p(A) + p(B) - p(A&B). A. B. A & B. Probabilities. Multiplication Rule: p(A & B) = p(A) · p(B|A). Calculate: p(Liar), p(Lawyer), p(Liar | Lawyer), p(Lawyer | Liar)
E N D
Probabilities Addition Rule: p(A or B) = p(A) + p(B) - p(A&B) A B A & B
Probabilities Addition Rule: p(A or B) = p(A) + p(B) - p(A&B) A B A & B
Probabilities Multiplication Rule: p(A & B) = p(A) · p(B|A) Calculate: p(Liar), p(Lawyer), p(Liar | Lawyer), p(Lawyer | Liar) p(Liar & Lawyer), p(Liar or Lawyer)
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
Compare p(Lawyer) and p(Lawyer | Liar) p(Liar) and p(Liar | Lawyer)
Compare p(Delinq.) and p(Delinq. | Male) p(Delinq.) and p(Delinq. | Female) What if you only had info. on delinquents?
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)?
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)?
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)
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?
Probabilities and sampling • So, we end up withp(r & r) = .3 * .3 = .09p(b & b) = .7 * .7 = .49p(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
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.
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
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?
Puzzle (cont.) Find p(Gold | Gold)
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?
Sampling Etc.
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?
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