SlideShare a Scribd company logo
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

Similar to 07 Discrete

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
 
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
Mat Morrison
 

Similar to 07 Discrete (10)

13 Bivariate
13 Bivariate13 Bivariate
13 Bivariate
 
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
 

More from Hadley Wickham (20)

27 development
27 development27 development
27 development
 
27 development
27 development27 development
27 development
 
24 modelling
24 modelling24 modelling
24 modelling
 
23 data-structures
23 data-structures23 data-structures
23 data-structures
 
Graphical inference
Graphical inferenceGraphical inference
Graphical inference
 
R packages
R packagesR packages
R packages
 
22 spam
22 spam22 spam
22 spam
 
21 spam
21 spam21 spam
21 spam
 
20 date-times
20 date-times20 date-times
20 date-times
 
19 tables
19 tables19 tables
19 tables
 
18 cleaning
18 cleaning18 cleaning
18 cleaning
 
17 polishing
17 polishing17 polishing
17 polishing
 
16 critique
16 critique16 critique
16 critique
 
15 time-space
15 time-space15 time-space
15 time-space
 
13 case-study
13 case-study13 case-study
13 case-study
 
12 adv-manip
12 adv-manip12 adv-manip
12 adv-manip
 
11 adv-manip
11 adv-manip11 adv-manip
11 adv-manip
 
11 adv-manip
11 adv-manip11 adv-manip
11 adv-manip
 
10 simulation
10 simulation10 simulation
10 simulation
 
10 simulation
10 simulation10 simulation
10 simulation
 

Recently uploaded

Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
ArianaBusciglio
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
Celine George
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
goswamiyash170123
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
Assignment_4_ArianaBusciglio Marvel(1).docx
Assignment_4_ArianaBusciglio Marvel(1).docxAssignment_4_ArianaBusciglio Marvel(1).docx
Assignment_4_ArianaBusciglio Marvel(1).docx
ArianaBusciglio
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
Celine George
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Delivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and TrainingDelivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and Training
AG2 Design
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 

Recently uploaded (20)

Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
Assignment_4_ArianaBusciglio Marvel(1).docx
Assignment_4_ArianaBusciglio Marvel(1).docxAssignment_4_ArianaBusciglio Marvel(1).docx
Assignment_4_ArianaBusciglio Marvel(1).docx
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Delivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and TrainingDelivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and Training
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 

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