SlideShare a Scribd company logo
1 of 39
Download to read offline
Stat310
          Discrete random variables


                            Hadley Wickham
Thursday, 4 February 2010
Quiz

                    β€’ Pick up quiz on your way in
                    β€’ Start at 1pm
                    β€’ Finish at 1:10pm
                    β€’ Closed book




Thursday, 4 February 2010
Quiz
                            Due 1:10pm


Thursday, 4 February 2010
http://xkcd.com/696/
Thursday, 4 February 2010
1. Quiz!
                2. Feedback
                3. Discrete uniform distribution
                4. More on the binomial distribution
                5. Poisson distribution



Thursday, 4 February 2010
What you like
                    ––––––––––––––––––––– half–complete proofs
                    –––––––––––––––– video lecture
                    ––––––––––––– examples/applications
                    –––––––– entertaining/engaging
                    –––––––– your turn
                    ––––––– homework
                    –––––– help sessions
                    ––––– website


Thursday, 4 February 2010
What you’d like
                              changed:
                    ––––––––– more examples/applications
                    ––––––– go slower
                    –––––– calling on people randomly
                    –––– less sex
                    ––– owlspace



Thursday, 4 February 2010
Thursday, 4 February 2010
+                         βˆ†
                            ––––––––––––      homework         ––––


                               –––––––––     help sessions     ––––


                                ––––––––       reading         –––––––––––––––––––––––


                                    –––    practice problems   –––––


                                    –––         notes

                                    –––     going to class     –




Thursday, 4 February 2010
Slower, more details and
                              basic math practice:
                            http://khanacademy.org/



Thursday, 4 February 2010
Discrete uniform



Thursday, 4 February 2010
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
Binomial distribution



Thursday, 4 February 2010
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
●
        0.35



        0.30

                                                               ●


        0.25


                                                                       ●

        0.20
 pred




        0.15

                                                           ●


        0.10



        0.05
                                                       ●



                                                   ●
        0.00        ●       ●   ●   ●   ●




                    0           2       4              6       8       10
                                            grid
Thursday, 4 February 2010
What if we wanted to
                   do the same thing for
                        all games?


Thursday, 4 February 2010
All games                                                                                                   ●
                                                                                                                           ●
                                                                                                                           ●
                                                                                                                            ●
                                                                                                                            ●
                                                                                                                            ●
                                                                                                                           ●
                                                                                                                               ●
                                                                                                                           ●
                                                                                                                               ●
        0.04                                                                                                               ●
                                                                                                                               ●

                                                                                                                           ●
                                                                                                                               ●

                                                                                                                       ●

                                                                                                                               ●
        0.03                                                                                                           ●

                                                                                                                                ●
                                                                                                                       ●
 pred




                                                                                                                                   ●
                                                                                                                       ●

                                                                                                                                   ●
        0.02                                                                                                           ●

                                                                                                                                   ●
                                                                                                                       ●


                                                                                                                   ●               ●


                                                                                                                   ●               ●

        0.01                                                                                                       ●                ●

                                                                                                                   ●                   ●
                                                                                                                   ●                   ●
                                                                                                                   ●
                                                                                                                                       ●
                                                                                                                  ●
                                                                                                                  ●                    ●
                                                                                                                  ●                    ●
                                                                                                                 ●                      ●
                                                                                                                 ●
                                                                                                                 ●                      ●
                                                                                                                                        ●
                                                                                                                ●
                                                                                                                ●                        ●
                                                                                                                                         ●●●●●●●●●●●●
        0.00        ●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●
                    ●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●
                     ●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●
                     ●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●
                    ●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●                          ●●●●●●●●●●●●
                                                                                                                                          ●●●●●●●●●●●
                                                                                                                                          ●●●●●●●●●●●
                                                                                                                                          ●●●●●●●●●●●




                    0                 100                  200                 300                  400                            500
                                                                        grid
Thursday, 4 February 2010
Zoomed in                                                                                                    ●
                                                                                                                                ●
                                                                                                                                    ● ●
                                                                                                                                          ●
                                                                                                                                              ●
                                                                                                                        ●
                                                                                                                                                  ●
                                                                                                                    ●
                                                                                                                                                      ●
        0.04                                                                                                    ●
                                                                                                                                                          ●

                                                                                                            ●
                                                                                                                                                              ●

                                                                                                        ●

                                                                                                                                                                  ●
        0.03                                                                                        ●

                                                                                                                                                                      ●
                                                                                                ●
 pred




                                                                                                                                                                          ●
                                                                                            ●

                                                                                                                                                                              ●
        0.02                                                                            ●

                                                                                                                                                                                  ●
                                                                                    ●


                                                                                ●                                                                                                     ●


                                                                            ●                                                                                                             ●

        0.01                                                            ●                                                                                                                     ●

                                                                    ●                                                                                                                             ●
                                                                ●                                                                                                                                     ●
                                                            ●
                                                                                                                                                                                                          ●
                                                        ●
                                                    ●                                                                                                                                                         ●
                                                ●                                                                                                                                                                 ●
                                            ●                                                                                                                                                                         ●
                                        ●                                                                                                                                                                                 ● ●
                                    ● ●                                                                                                                                                                                       ● ● ●
                              ● ● ●
        0.00        ● ● ● ● ●                                                                                                                                                                                                       ●




                  450                 460                                   470                                     480                                   490                                     500                             510
                                                                                                            grid
Thursday, 4 February 2010
Sums

                    X ~ Binomial(n, p)
                    Y ~ Binomial(m, p)
                    Z=X+Y
                    Then Z ~ ?




Thursday, 4 February 2010
Poisson distribution



                                       3.2.2 p. 119
Thursday, 4 February 2010
Conditions
                    X = 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
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
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
Basketball
                    Many 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=2008
Thursday, 4 February 2010
The data
              0.08




              0.06
 Proportion




              0.04




              0.02




              0.00

                            80   90   100       110   120   130
                                            o
Thursday, 4 February 2010
Data + distribution
              0.08




              0.06
 Proportion




              0.04                                                                                                          ● ● ●
                                                                                                                        ● ●       ●
                                                                                                                    ●                 ●
                                                                                                                ●                         ●
                                                                                                            ●                                 ●
                                                                                                        ●                                         ●
                                                                                                    ●                                                 ●
                                                                                                ●                                                         ●
                                                                                            ●                                                                 ●
                                                                                        ●                                                                         ●
                                                                                    ●                                                                                 ●
              0.02                                                                                                                                                        ●
                                                                                ●
                                                                                                                                                                              ●
                                                                            ●
                                                                                                                                                                                  ●
                                                                        ●
                                                                                                                                                                                      ●
                                                                    ●                                                                                                                     ●
                                                               ●                                                                                                                              ●
                                                           ●                                                                                                                                      ●
                                                       ●                                                                                                                                              ●
                                                   ●                                                                                                                                                      ●
                                               ●                                                                                                                                                              ●
                                           ●                                                                                                                                                                      ●
                                       ●                                                                                                                                                                              ● ●
                                   ● ●                                                                                                                                                                                    ●
                               ● ●
              0.00     ● ● ● ●




                              80                               90                                   100                           110                                     120                                     130
                                                                                                                o
Thursday, 4 February 2010
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
1                           2                           3

              0.08

              0.06

              0.04

              0.02

              0.00
                                4                           5                           6

              0.08
 Proportion




              0.06

              0.04

              0.02

              0.00
                                7                           8                           9

              0.08

              0.06

              0.04

              0.02

              0.00
                     80 90 100 110 120 130 140   80 90 100 110 120 130 140   80 90 100 110 120 130 140
                                                        value
Thursday, 4 February 2010
1                           2                           3

              0.08

              0.06

              0.04

              0.02

              0.00
                                4                           5                           6

              0.08
 Proportion




              0.06

              0.04

              0.02

              0.00
                                7                           8                           9

              0.08

              0.06

              0.04

              0.02

              0.00
                     80 90 100 110 120 130 140   80 90 100 110 120 130 140   80 90 100 110 120 130 140
                                                        value
Thursday, 4 February 2010
But


                    The distribution can’t be poisson. Why?




Thursday, 4 February 2010
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
Challenge


                    What’s the probability they score over 100
                    points? (How could you work this out?)




Thursday, 4 February 2010
1.0                                                                                                                                                                                              ●●   ●●●●●●●●●●●●●●●●●●
                                                                                                                                                                                                       ●   ●●●
                                                                                                                                                                                                   ●
                                                                                                                                                                                                ●●
                                                                                                                                                                                            ●
                                                                                                                                                                                        ●
                                                                                                                                                                                    ●
                                                                                                                                                                                ●
                                                                                                                                                                            ●
                                                                                                                                                                        ●
                                                                                                                                                                    ●
                                                                                                                                                                ●
              0.8                                                                                                                                           ●
                                                                                                                                                        ●
                                                                                                                                                    ●
                                                                                                                                                ●
                                                                                                                                            ●

                                                                                                                                        ●

                                                                                                                                    ●
              0.6
                                                                                                                                ●
 cumulative




                                                                                                                            ●

                                                                                                                        ●

                                                                                                                    ●

                                                                                                                ●
              0.4
                                                                                                            ●

                                                                                                        ●

                                                                                                    ●
                                                                                                ●
                                                                                            ●
                                                                                        ●
              0.2                                                                   ●
                                                                                ●
                                                                            ●
                                                                        ●
                                                                    ●
                                                                ●
                                                            ●
                                                        ●
                                                    ●
                                            ●   ●
                                    ●●   ●●
              0.0   ●●●●●●●●●●●●●




                             80                                                             100                                                                             120                                           140
                                                                                                                            grid
Thursday, 4 February 2010
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
Multiplication

                    X ~ Poisson(Ξ»)
                    Y = tX
                    Then Y ~ Poisson(Ξ»t)




Thursday, 4 February 2010
Summary



Thursday, 4 February 2010
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
Recognise

                    Discrete uniform
                    Bernoulli
                    Binomial
                    Poisson




Thursday, 4 February 2010
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

More Related Content

Viewers also liked

Viewers also liked (10)

2014mrt25 booosting portisa frederike cernoia van portisa
2014mrt25 booosting portisa   frederike cernoia van portisa2014mrt25 booosting portisa   frederike cernoia van portisa
2014mrt25 booosting portisa frederike cernoia van portisa
Β 
Master and Student Reunited
Master and Student ReunitedMaster and Student Reunited
Master and Student Reunited
Β 
Hiring and Recruiting Talent
Hiring and Recruiting TalentHiring and Recruiting Talent
Hiring and Recruiting Talent
Β 
Booosting building holland12 concepthouseprototype_19apr12
Booosting building holland12 concepthouseprototype_19apr12Booosting building holland12 concepthouseprototype_19apr12
Booosting building holland12 concepthouseprototype_19apr12
Β 
Naruto 486 Fists
Naruto 486 FistsNaruto 486 Fists
Naruto 486 Fists
Β 
Booosting 24sept13 bim nut en noodzaak van revit joost heijnis cepezed
Booosting 24sept13 bim nut en noodzaak van revit   joost heijnis cepezedBooosting 24sept13 bim nut en noodzaak van revit   joost heijnis cepezed
Booosting 24sept13 bim nut en noodzaak van revit joost heijnis cepezed
Β 
Creating An Intelligent City
Creating An Intelligent CityCreating An Intelligent City
Creating An Intelligent City
Β 
Naruto 488 The Villlages
Naruto 488 The VilllagesNaruto 488 The Villlages
Naruto 488 The Villlages
Β 
Naruto Manga 484
Naruto Manga 484Naruto Manga 484
Naruto Manga 484
Β 
Effective Online Communications (Web 2 0)
Effective Online Communications (Web 2 0)Effective Online Communications (Web 2 0)
Effective Online Communications (Web 2 0)
Β 

Similar to 07 Discrete

08 Continuous
08 Continuous08 Continuous
08 Continuousguest2a47eb7
Β 
Los Angeles R users group - July 12 2011 - Part 1
Los Angeles R users group - July 12 2011 - Part 1Los Angeles R users group - July 12 2011 - Part 1
Los Angeles R users group - July 12 2011 - Part 1rusersla
Β 
17 Sampling Dist
17 Sampling Dist17 Sampling Dist
17 Sampling DistHadley Wickham
Β 
How People Use Facebook -- And Why It Matters
How People Use Facebook -- And Why It MattersHow People Use Facebook -- And Why It Matters
How People Use Facebook -- And Why It MattersMat Morrison
Β 

Similar to 07 Discrete (12)

21 Ml
21 Ml21 Ml
21 Ml
Β 
13 Bivariate
13 Bivariate13 Bivariate
13 Bivariate
Β 
08 Continuous
08 Continuous08 Continuous
08 Continuous
Β 
08 Continuous
08 Continuous08 Continuous
08 Continuous
Β 
02 Large
02 Large02 Large
02 Large
Β 
02 large
02 large02 large
02 large
Β 
14 case-study
14 case-study14 case-study
14 case-study
Β 
Los Angeles R users group - July 12 2011 - Part 1
Los Angeles R users group - July 12 2011 - Part 1Los Angeles R users group - July 12 2011 - Part 1
Los Angeles R users group - July 12 2011 - Part 1
Β 
17 Sampling Dist
17 Sampling Dist17 Sampling Dist
17 Sampling Dist
Β 
How People Use Facebook -- And Why It Matters
How People Use Facebook -- And Why It MattersHow People Use Facebook -- And Why It Matters
How People Use Facebook -- And Why It Matters
Β 
04 Wrapup
04 Wrapup04 Wrapup
04 Wrapup
Β 
01 intro
01 intro01 intro
01 intro
Β 

Recently uploaded

Mcleodganj Call Girls πŸ₯° 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls πŸ₯° 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls πŸ₯° 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls πŸ₯° 8617370543 Service Offer VIP Hot ModelDeepika Singh
Β 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
Β 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
Β 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
Β 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
Β 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
Β 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
Β 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
Β 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
Β 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
Β 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
Β 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
Β 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
Β 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
Β 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
Β 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
Β 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Christopher Logan Kennedy
Β 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
Β 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
Β 

Recently uploaded (20)

Mcleodganj Call Girls πŸ₯° 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls πŸ₯° 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls πŸ₯° 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls πŸ₯° 8617370543 Service Offer VIP Hot Model
Β 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Β 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
Β 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
Β 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
Β 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
Β 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
Β 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Β 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
Β 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Β 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
Β 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
Β 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
Β 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
Β 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Β 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Β 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Β 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
Β 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Β 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
Β 

07 Discrete

  • 1. Stat310 Discrete random variables Hadley Wickham Thursday, 4 February 2010
  • 2. Quiz β€’ Pick up quiz on your way in β€’ Start at 1pm β€’ Finish at 1:10pm β€’ Closed book Thursday, 4 February 2010
  • 3. Quiz Due 1:10pm Thursday, 4 February 2010
  • 5. 1. Quiz! 2. Feedback 3. Discrete uniform distribution 4. More on the binomial distribution 5. Poisson distribution Thursday, 4 February 2010
  • 6. What you like ––––––––––––––––––––– half–complete proofs –––––––––––––––– video lecture ––––––––––––– examples/applications –––––––– entertaining/engaging –––––––– your turn ––––––– homework –––––– help sessions ––––– website Thursday, 4 February 2010
  • 7. What you’d like changed: ––––––––– more examples/applications ––––––– go slower –––––– calling on people randomly –––– less sex ––– owlspace Thursday, 4 February 2010
  • 9. + βˆ† –––––––––––– homework –––– ––––––––– help sessions –––– –––––––– reading ––––––––––––––––––––––– ––– practice problems ––––– ––– notes ––– going to class – Thursday, 4 February 2010
  • 10. Slower, more details and basic math practice: http://khanacademy.org/ Thursday, 4 February 2010
  • 12. 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
  • 14. 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
  • 15. ● 0.35 0.30 ● 0.25 ● 0.20 pred 0.15 ● 0.10 0.05 ● ● 0.00 ● ● ● ● ● 0 2 4 6 8 10 grid Thursday, 4 February 2010
  • 16. What if we wanted to do the same thing for all games? Thursday, 4 February 2010
  • 17. All games ● ● ● ● ● ● ● ● ● ● 0.04 ● ● ● ● ● ● 0.03 ● ● ● pred ● ● ● 0.02 ● ● ● ● ● ● ● 0.01 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●●●●●●●●●●●● 0.00 ●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●● ●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●● ●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●● ●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●● ●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●● ●●●●●●●●●●●● ●●●●●●●●●●● ●●●●●●●●●●● ●●●●●●●●●●● 0 100 200 300 400 500 grid Thursday, 4 February 2010
  • 18. Zoomed in ● ● ● ● ● ● ● ● ● ● 0.04 ● ● ● ● ● ● 0.03 ● ● ● pred ● ● ● 0.02 ● ● ● ● ● ● ● 0.01 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 0.00 ● ● ● ● ● ● 450 460 470 480 490 500 510 grid Thursday, 4 February 2010
  • 19. Sums X ~ Binomial(n, p) Y ~ Binomial(m, p) Z=X+Y Then Z ~ ? Thursday, 4 February 2010
  • 20. Poisson distribution 3.2.2 p. 119 Thursday, 4 February 2010
  • 21. Conditions X = 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
  • 22. 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
  • 23. 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
  • 24. Basketball Many 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=2008 Thursday, 4 February 2010
  • 25. The data 0.08 0.06 Proportion 0.04 0.02 0.00 80 90 100 110 120 130 o Thursday, 4 February 2010
  • 26. Data + distribution 0.08 0.06 Proportion 0.04 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 0.02 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 0.00 ● ● ● ● 80 90 100 110 120 130 o Thursday, 4 February 2010
  • 27. 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
  • 28. 1 2 3 0.08 0.06 0.04 0.02 0.00 4 5 6 0.08 Proportion 0.06 0.04 0.02 0.00 7 8 9 0.08 0.06 0.04 0.02 0.00 80 90 100 110 120 130 140 80 90 100 110 120 130 140 80 90 100 110 120 130 140 value Thursday, 4 February 2010
  • 29. 1 2 3 0.08 0.06 0.04 0.02 0.00 4 5 6 0.08 Proportion 0.06 0.04 0.02 0.00 7 8 9 0.08 0.06 0.04 0.02 0.00 80 90 100 110 120 130 140 80 90 100 110 120 130 140 80 90 100 110 120 130 140 value Thursday, 4 February 2010
  • 30. But The distribution can’t be poisson. Why? Thursday, 4 February 2010
  • 31. 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
  • 32. Challenge What’s the probability they score over 100 points? (How could you work this out?) Thursday, 4 February 2010
  • 33. 1.0 ●● ●●●●●●●●●●●●●●●●●● ● ●●● ● ●● ● ● ● ● ● ● ● ● 0.8 ● ● ● ● ● ● ● 0.6 ● cumulative ● ● ● ● 0.4 ● ● ● ● ● ● 0.2 ● ● ● ● ● ● ● ● ● ● ● ●● ●● 0.0 ●●●●●●●●●●●●● 80 100 120 140 grid Thursday, 4 February 2010
  • 34. 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
  • 35. Multiplication X ~ Poisson(Ξ») Y = tX Then Y ~ Poisson(Ξ»t) Thursday, 4 February 2010
  • 37. 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
  • 38. Recognise Discrete uniform Bernoulli Binomial Poisson Thursday, 4 February 2010
  • 39. 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