Download presentation
Presentation is loading. Please wait.
Published byCori Jackson Modified over 6 years ago
1
Mathematics for Computer Science MIT 6.042J/18.062J
Great Expectations Copyright © Radhika Nagpal, 2002. Prof. Albert Meyer & Dr. Radhika Nagpal
2
Abstractions in Probability
Random Variables R(s) = r Probability Distribution Pr (R=r) Expected Value
3
Expected Value Fortune Telling Average of future values
4
Definition Expected value of a random variable R
5
A Simple Example R = value thrown by a dice Expected value of R
= 1(1/6) + 2(1/6) + 3 (1/6) + 4(1/6) + 5(1/6) + 6(1/6) = 3.5
6
Example 2: Space Station Mir
Suppose that main computer has a probability p of failing every second When do we expect it to first fail?
7
Space Station Mir T = time of the first failure
E[T] = 1 . Pr (fails on the 1st second, T=1) + 2 . Pr (fails on the on 2nd second, T=2) + 3 . Pr (fails on the 3rd second, T=3) ….
8
Space Station Mir Pr (fails on the 1st second, T=1) = p
Pr (fails on the on 2nd second, T=2) = (1-p) p Pr (fails on the 3rd second, T=3) = (1-p) (1-p) p
9
Space Station Mir Probability that it fails on ith second
Pr (T=i) = (1-p)i-1 p no failures in first i-1 seconds
10
Space Station Mir similar to geometric series
11
More About Mir How many times should I expect to roll a fair dice before I get a 6? 6 times Mir contains 10,000 components How many failures do we expect to see per year of operation?
12
Other Applications Algorithms Gambling
Analysis of sorting: given a sequence of n numbers, on average how many numbers are out of order? Gambling Will the Patriots win the Superbowl? How many rounds of 5 card draw do I expect to play before I finally win?
13
Pitfalls of Expectation
Expected value does not tell us the distribution Expected value may never actually occur Model is not Reality
14
In Class Problems 1 and 2
15
Example 2: Birthday Problem
In a class with 100 people, what is the probability that two people have the same birthday? 99% How many pairs of people with the same birthday do we expect to see?
16
Actual Data 12 pairs in entire class Dates:
Should you expect to see something similar in other classes? Jan 24, Jan 25, Feb 16, Feb 23 Mar 6, Mar 17, Mar 22 Jul 6, Jul 12, Aug 19 Oct 13, Oct 25
17
Birthday Problem R = number of pairs with same birthday Pr (R = 0)
Pr (exactly one pair, R=1) Pr (exactly two pairs, R=2) = ? Starts becoming very messy …
18
Linearity of Expectation
19
Birthdays Let Ri = 1 if ith pair has same birthday, = 0 if not
Pr (Ri = 1) = 1/365 Pr (Ri = 0) = 1 – (1/365) E[Ri] = 1 (1/365) = 1/365 = 1/Y
20
Expected Number of Birthday Pairs
E[# of Pairs] = E[R1] + E[R2] + E[R3]…. = (n choose 2) . E[Ri] = n2 / 2Y ~ 14 pairs for 6.042
21
The Same Question N wireless devices randomly pick identifiers from a range R. How many identifier collisions do you expect to see?
22
The Same Question N wireless devices randomly pick identifiers from a range R. How many identifier collisions do you expect to see? = N2 / 2R
23
Experiment: The Hat Check Game:
Everyone puts there name in a hat, then each person randomly draws out a name. How many people expect to get their own name back? Collect stats per table
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.