440 likes | 564 Views
Great Theoretical Ideas In Computer Science. Pitfalls of Probability. Lecture 18. CS 15-251. 2. 7. 6. 1. 9. 5. 3. 4. 8. You have 3 dice:. Higher Number Wins. A. 2 Players each rolls a die. The player with the higher number wins. B. Which die is best to have – A , B , or C ?.
E N D
Great Theoretical Ideas In Computer Science Pitfalls of Probability Lecture 18 CS 15-251
2 7 6 1 9 5 3 4 8 You have 3 dice: Higher Number Wins A 2 Players each rolls a die. The player with the higher number wins B Which die is best to have – A, B, or C ? C
2 7 6 1 9 5 A is better than B • When they are rolled, there are 9 equally likes outcomes A beats B 5/9 of the time
1 9 5 3 4 8 B is better than C • When they are rolled, there are 9 equally likes outcomes B beats C 5/9 of the time
A beats B with Prob. 5/9B beats C with Prob. 5/9 • QUESTION: Without explicitly doing the calculation, can you see the probability that Awill beatC ? • QUESTION: If you chose first, which die would you take? • QUESTION: If you chose the second, which die would you take?
2 7 6 3 4 8 C is better than A! • When they are rolled, there are 9 equally likes outcomes C beats A 5/9 of the time!
2 7 6 1 9 5 3 4 8
First Moral • “Obvious” properties, such as transitivity, associativity, commutativity, etc… need to be rigorously argued because sometimes they are FALSE.
Second Moral • When reasoning about probabilities…. • Stay on your toes!
Third Moral • To make money from a sucker in a bar, offer him the first choice of die. (allow him to change to your “lucky” die any time he wants)
Coming up next… • More of the pitfalls of probability…
A single summary statistic (such as an average) may have several different possible explanations…
US News & World Report 1983 • “Physicians are growing in number, but not in pay” Thrust of article: Market forces are at work Possibility: Doctors earn more than ever, but many old doctors have retired and been replaced with younger ones.
Namea body part that almost everyone on earth had an above average number of • Fingers • Almost everyone has 10 • More people are missing some than have extras (total fingers missing > # of extras) • Average: 9.99 …
Rare Disease • A person is selected at random and given a test for the rare disease “painanosufulitis” • Only 1/10,000 people have it • The test is 99% accurate: it gives the wrong answer (positive/negative) only 1% of the time • The Person tests POSITIVE • Does he have the disease? • What is the probability that he has the disease?
Suppose there are k people in the population • At most k/10,000have the disease • But k/100 have false test results • So k/100 – k/10,000 have false test results but have no disease! • That’s about 100 times more likely he got a false positive.
Several years ago Berkeley faced a law suit … • % of make applicants admitted to graduate school was 10% • % of female applicants admitted to graduate school was 5% Grounds for discrimination? SUIT
Berkeley did a survey of its departments to find out which ones were at fault • The result was • SHOCKING…
Every Department is more likely to admit a female than a male • #of females accepted to department X #of males accepted to department X > #of female applicants to department X #of male applicants to department X
Answer • Women tend to apply to departmebts that admit a smaller percentage of their applicants
Let’s assume 3) Males and females have the same distribution of academic success
1987Department of Transportation requires that each month all airlines report their “on-time record” • # of on-time flights landing at nation’s 30 busiest airports # of total flights into those airports
Newpapers would publish these data… • Meaningless junk!
Different airlines serve different airports with different frequency • An airline sending most of its planes into fair weather airports will crush an airline fling mostly into foggy airports It can even happen that an airline has a better record at each airport, but gets a worse overall rating by this method.
American WestB) Alaska Airlines A beats B in each airport B has a better overall rating!
Computer Performance Analysis • Ratio of total: 6502 takes 4.7% more than 8080 • 6502 as base: 6502 takes 1% less than 8080 • 8080 as base: 6502 takes 6% more than 8080
Patterson and Sequin (1982) Code Size on RISC-I vs. Z8002
A Bridge Hand has 13 cards. What distribution of the 4 suits is most likely? • Examples: 5 3 3 2 ? 4 4 3 2 ? 4 4 3 3 ? 4 3 3 3 ?
4 3 3 3 4 4 3 2 5 3 3 2
You walk into a pet shop. There are two parrots in a cage. • Shop owner says “At least one of the two is male” • What is the chance they are both male? • FF • FM 1/3 chance they are both • MF male • MM • Shop owner says “The dark one is male” • FF • FM 1/2 chance they are both • MF male MM
Oct 93. Press Release • Crime Crisis in Florida • 9 foreign tourists killed that year in the state of Florida • Result: • German’s Advise their citizens not to visit Florida • All Indicative markings are removed from US. Rental Cars
Suppose that each day there is a low probability p=1/365 of some foreign tourist dying somwhere in Florida (independent)(Thus, we get that the expected # of fatalities is 1 per year --- fairly low) • Probability of 9 means in a given year Fairly low
Probability that in a given decade Florida will have a bloody year for foreign tourists: • 1 - (1 - 0.012) 10 = 0.2179 = 21% • The killing could easily be random fluctuations, not sufficient evidence to damage their economy and scare people
A Voting Puzzle • N (odd) people, each of whom has a random bit (50/50) on his/her forhead. No communication allowed. Each person goes to a private voting booth and casts a vote for either 1 or 0. If the outcome of the election coincided with the parity of the N bits, we say the voters “win” the election • How do voters maximize the probability of winning?
Notice:Each individual has no information about the parity • Beware of the Fallacy! • Since each individual is wrong half the time, the outcome of the election is wrong half the time • Cf. [BG] Random Oracles • PARITY – PR PPR
Solution:NOTE – To know parity is equivalent to knowing the bit on your forehead • STRATEGY: Each person assumes the bit on his/her head is the same as the majority of bits sh/she sees. Vote accordingly (in the case of even split, vote 0). • ANALYSIS: The strategy works so long as the number of 1’s is not exactly one more than the number of 0’s. • Probability • Of winning
Optimal Strategy • IF N = 1 mod 4 Vote your Bit • N = 3 mod 4 Vote opposite Bit • 50% + 1/O(N) chance of winning • EX: N = 3 Correct 6/8 = 75% of the time
0 | 0 1 | 0 0 1 1 | 0 0 0 0 1 1 1 1 • The guy in the first packet assumes he has a zero on his forehead. He votes accordingly. • If the other guys see that he indeed have a zero in his head, they assure his vote carries the election by splitting the vote in each packet.
0 | 0 1 | 0 0 1 1 | 0 0 0 0 1 1 1 1 • The guys in the second packet assume the of their two bits is zero. • If they are correct, the guys in the later packets slit their votes..
In general, if the people in a packet see that some lower packet has a bit-wise of 0, they slit their vote. Otherwise they assume their packet ’s to 0 and vote accordingly.
New Chicago Puzzle • Each person has a private random bit • Now, what is their chance of winning the election?
Voting in Chicago • In Chicago people can vote as many times as they please • Strategy: each person behaves as a packet • Number the people from 1 to N. Person I votes 0 times if any lower number person has a 0 on his head. Otherwise person I assumes he has a 0 on his head and votes 2 times. Correct with probability 1/2N This is clearly optimal