07 discrete
DESCRIPTION
TRANSCRIPT
![Page 1: 07 Discrete](https://reader033.vdocuments.net/reader033/viewer/2022061114/54626fb1b4af9f5d1c8b47e7/html5/thumbnails/1.jpg)
Hadley Wickham
Stat310Discrete random variables
Thursday, 4 February 2010
![Page 2: 07 Discrete](https://reader033.vdocuments.net/reader033/viewer/2022061114/54626fb1b4af9f5d1c8b47e7/html5/thumbnails/2.jpg)
Quiz
• Pick up quiz on your way in
• Start at 1pm
• Finish at 1:10pm
• Closed book
Thursday, 4 February 2010
![Page 3: 07 Discrete](https://reader033.vdocuments.net/reader033/viewer/2022061114/54626fb1b4af9f5d1c8b47e7/html5/thumbnails/3.jpg)
QuizDue 1:10pm
Thursday, 4 February 2010
![Page 5: 07 Discrete](https://reader033.vdocuments.net/reader033/viewer/2022061114/54626fb1b4af9f5d1c8b47e7/html5/thumbnails/5.jpg)
1. Quiz!
2. Feedback
3. Discrete uniform distribution
4. More on the binomial distribution
5. Poisson distribution
Thursday, 4 February 2010
![Page 6: 07 Discrete](https://reader033.vdocuments.net/reader033/viewer/2022061114/54626fb1b4af9f5d1c8b47e7/html5/thumbnails/6.jpg)
What you like––––––––––––––––––––– half–complete proofs
–––––––––––––––– video lecture
––––––––––––– examples/applications
–––––––– entertaining/engaging
–––––––– your turn
––––––– homework
–––––– help sessions
––––– website
Thursday, 4 February 2010
![Page 7: 07 Discrete](https://reader033.vdocuments.net/reader033/viewer/2022061114/54626fb1b4af9f5d1c8b47e7/html5/thumbnails/7.jpg)
What you’d like changed:
––––––––– more examples/applications
––––––– go slower
–––––– calling on people randomly
–––– less sex
––– owlspace
Thursday, 4 February 2010
![Page 8: 07 Discrete](https://reader033.vdocuments.net/reader033/viewer/2022061114/54626fb1b4af9f5d1c8b47e7/html5/thumbnails/8.jpg)
Thursday, 4 February 2010
![Page 9: 07 Discrete](https://reader033.vdocuments.net/reader033/viewer/2022061114/54626fb1b4af9f5d1c8b47e7/html5/thumbnails/9.jpg)
+ ∆
–––––––––––– homework ––––
––––––––– help sessions ––––
–––––––– reading –––––––––––––––––––––––
––– practice problems –––––
––– notes
––– going to class –
Thursday, 4 February 2010
![Page 10: 07 Discrete](https://reader033.vdocuments.net/reader033/viewer/2022061114/54626fb1b4af9f5d1c8b47e7/html5/thumbnails/10.jpg)
Slower, more details and basic math practice:
http://khanacademy.org/
Thursday, 4 February 2010
![Page 11: 07 Discrete](https://reader033.vdocuments.net/reader033/viewer/2022061114/54626fb1b4af9f5d1c8b47e7/html5/thumbnails/11.jpg)
Discrete uniform
Thursday, 4 February 2010
![Page 12: 07 Discrete](https://reader033.vdocuments.net/reader033/viewer/2022061114/54626fb1b4af9f5d1c8b47e7/html5/thumbnails/12.jpg)
Discrete uniform
Equally likely events
f(x) = 1/(b - a) x = a, ..., b
X ~ DiscreteUniform(a, b)
What is the mean?
What is the variance?
Thursday, 4 February 2010
![Page 13: 07 Discrete](https://reader033.vdocuments.net/reader033/viewer/2022061114/54626fb1b4af9f5d1c8b47e7/html5/thumbnails/13.jpg)
Binomial distribution
Thursday, 4 February 2010
![Page 14: 07 Discrete](https://reader033.vdocuments.net/reader033/viewer/2022061114/54626fb1b4af9f5d1c8b47e7/html5/thumbnails/14.jpg)
Your turn
In the 2008–09 season, Kobe Bryant attempted 564 field goals and made 483 of them.
In the first game of the next season he makes 7 attempts. How many do you expect he makes? What’s the probability he doesn’t make any? What’s the probability he makes them all?
What assumptions did you make?
Thursday, 4 February 2010
![Page 15: 07 Discrete](https://reader033.vdocuments.net/reader033/viewer/2022061114/54626fb1b4af9f5d1c8b47e7/html5/thumbnails/15.jpg)
grid
pred
0.00
0.05
0.10
0.15
0.20
0.25
0.30
0.35
● ● ● ● ●●
●
●
●
●
●
0 2 4 6 8 10
Thursday, 4 February 2010
![Page 16: 07 Discrete](https://reader033.vdocuments.net/reader033/viewer/2022061114/54626fb1b4af9f5d1c8b47e7/html5/thumbnails/16.jpg)
What if we wanted to do the same thing for
all games?
Thursday, 4 February 2010
![Page 17: 07 Discrete](https://reader033.vdocuments.net/reader033/viewer/2022061114/54626fb1b4af9f5d1c8b47e7/html5/thumbnails/17.jpg)
grid
pred
0.00
0.01
0.02
0.03
0.04
●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●●●●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●
0 100 200 300 400 500
All games
Thursday, 4 February 2010
![Page 18: 07 Discrete](https://reader033.vdocuments.net/reader033/viewer/2022061114/54626fb1b4af9f5d1c8b47e7/html5/thumbnails/18.jpg)
grid
pred
0.00
0.01
0.02
0.03
0.04
● ● ● ● ● ● ● ● ● ● ●●
●●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●● ●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●●
●● ● ● ● ● ●
450 460 470 480 490 500 510
Zoomed in
Thursday, 4 February 2010
![Page 19: 07 Discrete](https://reader033.vdocuments.net/reader033/viewer/2022061114/54626fb1b4af9f5d1c8b47e7/html5/thumbnails/19.jpg)
Sums
X ~ Binomial(n, p)
Y ~ Binomial(m, p)
Z = X + Y
Then Z ~ ?
Thursday, 4 February 2010
![Page 20: 07 Discrete](https://reader033.vdocuments.net/reader033/viewer/2022061114/54626fb1b4af9f5d1c8b47e7/html5/thumbnails/20.jpg)
Poisson distribution
3.2.2 p. 119Thursday, 4 February 2010
![Page 21: 07 Discrete](https://reader033.vdocuments.net/reader033/viewer/2022061114/54626fb1b4af9f5d1c8b47e7/html5/thumbnails/21.jpg)
ConditionsX = Number of times some event happens
(1) If number of events occurring in non–overlapping times is independent, and
(2) probability of exactly one event occurring in short interval of length h is ∝ λh, and
(3) probability of two or more events in a sufficiently short internal is basically 0
Thursday, 4 February 2010
![Page 22: 07 Discrete](https://reader033.vdocuments.net/reader033/viewer/2022061114/54626fb1b4af9f5d1c8b47e7/html5/thumbnails/22.jpg)
Poisson
X ~ Poisson(λ)
Sample space: positive integers
λ ∈ [0, ∞)
Arises as limit of binomial distribution when np is fixed and n → ∞ = law of rare events.
Thursday, 4 February 2010
![Page 23: 07 Discrete](https://reader033.vdocuments.net/reader033/viewer/2022061114/54626fb1b4af9f5d1c8b47e7/html5/thumbnails/23.jpg)
Examples
Number of alpha particles emitted from a radioactive source
Number of calls to a switchboard
Number of eruptions of a volcano
Number of points scored in a game
Thursday, 4 February 2010
![Page 24: 07 Discrete](https://reader033.vdocuments.net/reader033/viewer/2022061114/54626fb1b4af9f5d1c8b47e7/html5/thumbnails/24.jpg)
BasketballMany people use the poisson distribution to model scores in sports games. For example, last season, on average the LA lakers scored 109.6 points per game, and had 101.8 points scored against them. So:
O ~ Poisson(109.6)D ~ Poisson(101.8)
How can we check if this is reasonable?
http://www.databasebasketball.com/teams/teamyear.htm?tm=LAL&lg=n&yr=2008Thursday, 4 February 2010
![Page 25: 07 Discrete](https://reader033.vdocuments.net/reader033/viewer/2022061114/54626fb1b4af9f5d1c8b47e7/html5/thumbnails/25.jpg)
o
Proportion
0.00
0.02
0.04
0.06
0.08
80 90 100 110 120 130
The data
Thursday, 4 February 2010
![Page 26: 07 Discrete](https://reader033.vdocuments.net/reader033/viewer/2022061114/54626fb1b4af9f5d1c8b47e7/html5/thumbnails/26.jpg)
o
Proportion
0.00
0.02
0.04
0.06
0.08
● ● ● ● ● ● ● ● ●●
●●
●●
●
●
●
●
●
●
●
●
●
●
●
●●
●● ● ● ● ●
●●
●●
●
●
●
●
●
●
●
●
●
●●
●●
●●
●●
● ● ●
80 90 100 110 120 130
Data + distribution
Thursday, 4 February 2010
![Page 27: 07 Discrete](https://reader033.vdocuments.net/reader033/viewer/2022061114/54626fb1b4af9f5d1c8b47e7/html5/thumbnails/27.jpg)
Simulation
Comparing to underlying distribution works well if we have a very large number of trials. But only have 108 here.
Instead we can randomly draw 108 numbers from the specified distribution and see if they look like the real data.
Thursday, 4 February 2010
![Page 28: 07 Discrete](https://reader033.vdocuments.net/reader033/viewer/2022061114/54626fb1b4af9f5d1c8b47e7/html5/thumbnails/28.jpg)
value
Proportion
0.00
0.02
0.04
0.06
0.08
0.00
0.02
0.04
0.06
0.08
0.00
0.02
0.04
0.06
0.08
1
4
7
80 90 100 110 120 130 140
2
5
8
80 90 100 110 120 130 140
3
6
9
80 90 100 110 120 130 140
Thursday, 4 February 2010
![Page 29: 07 Discrete](https://reader033.vdocuments.net/reader033/viewer/2022061114/54626fb1b4af9f5d1c8b47e7/html5/thumbnails/29.jpg)
value
Proportion
0.00
0.02
0.04
0.06
0.08
0.00
0.02
0.04
0.06
0.08
0.00
0.02
0.04
0.06
0.08
1
4
7
80 90 100 110 120 130 140
2
5
8
80 90 100 110 120 130 140
3
6
9
80 90 100 110 120 130 140
Thursday, 4 February 2010
![Page 30: 07 Discrete](https://reader033.vdocuments.net/reader033/viewer/2022061114/54626fb1b4af9f5d1c8b47e7/html5/thumbnails/30.jpg)
But
The distribution can’t be poisson. Why?
Thursday, 4 February 2010
![Page 31: 07 Discrete](https://reader033.vdocuments.net/reader033/viewer/2022061114/54626fb1b4af9f5d1c8b47e7/html5/thumbnails/31.jpg)
Example
O ~ Poisson(109.6). D ~ Poisson(101.8)
On average, do you expect the Lakers to win or lose? By how much?
What’s the probability that they score exactly 100 points?
Thursday, 4 February 2010
![Page 32: 07 Discrete](https://reader033.vdocuments.net/reader033/viewer/2022061114/54626fb1b4af9f5d1c8b47e7/html5/thumbnails/32.jpg)
Challenge
What’s the probability they score over 100 points? (How could you work this out?)
Thursday, 4 February 2010
![Page 33: 07 Discrete](https://reader033.vdocuments.net/reader033/viewer/2022061114/54626fb1b4af9f5d1c8b47e7/html5/thumbnails/33.jpg)
grid
cumulative
0.0
0.2
0.4
0.6
0.8
1.0
●●●●●●●●●●●●●●●●●●●●●
●●●●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●●●●●●●
●●●●●●●●●●●●●●●●●●●●●●●●●●
80 100 120 140
Thursday, 4 February 2010
![Page 34: 07 Discrete](https://reader033.vdocuments.net/reader033/viewer/2022061114/54626fb1b4af9f5d1c8b47e7/html5/thumbnails/34.jpg)
Score difference
What about if we’re interested in the winning/losing margin (offence – defence)?
What is the distribution of O – D?
It’s not trivial to determine. We’ll learn more about it when we get to transformations.
Thursday, 4 February 2010
![Page 35: 07 Discrete](https://reader033.vdocuments.net/reader033/viewer/2022061114/54626fb1b4af9f5d1c8b47e7/html5/thumbnails/35.jpg)
Multiplication
X ~ Poisson(λ)
Y = tX
Then Y ~ Poisson(λt)
Thursday, 4 February 2010
![Page 36: 07 Discrete](https://reader033.vdocuments.net/reader033/viewer/2022061114/54626fb1b4af9f5d1c8b47e7/html5/thumbnails/36.jpg)
Summary
Thursday, 4 February 2010
![Page 37: 07 Discrete](https://reader033.vdocuments.net/reader033/viewer/2022061114/54626fb1b4af9f5d1c8b47e7/html5/thumbnails/37.jpg)
For a new distribution:
Compute expected value and variance from definition (given partial proof to complete)
Compute the mgf (given random mathematical fact)
Compute the mean and variance from the mgf (remembering variance isn’t second moment)
Thursday, 4 February 2010
![Page 38: 07 Discrete](https://reader033.vdocuments.net/reader033/viewer/2022061114/54626fb1b4af9f5d1c8b47e7/html5/thumbnails/38.jpg)
Recognise
Discrete uniform
Bernoulli
Binomial
Poisson
Thursday, 4 February 2010
![Page 39: 07 Discrete](https://reader033.vdocuments.net/reader033/viewer/2022061114/54626fb1b4af9f5d1c8b47e7/html5/thumbnails/39.jpg)
Thursday
Continuous random variables.
New conditions & new definitions.
New distributions: uniform, exponential, gamma and normal
Read: 3.2.3, 3.2.5
Thursday, 4 February 2010