introduction to random variables
DESCRIPTION
TRANSCRIPT
![Page 1: Introduction to random variables](https://reader034.vdocument.in/reader034/viewer/2022051209/5482ed21b07959570c8b48e3/html5/thumbnails/1.jpg)
Hadley Wickham
Stat310Random variables
![Page 2: Introduction to random variables](https://reader034.vdocument.in/reader034/viewer/2022051209/5482ed21b07959570c8b48e3/html5/thumbnails/2.jpg)
1. Feedback
2. Recap
3. Introduction to random variables
4. Expectation
![Page 3: Introduction to random variables](https://reader034.vdocument.in/reader034/viewer/2022051209/5482ed21b07959570c8b48e3/html5/thumbnails/3.jpg)
Feedback
![Page 4: Introduction to random variables](https://reader034.vdocument.in/reader034/viewer/2022051209/5482ed21b07959570c8b48e3/html5/thumbnails/4.jpg)
Reading through text
Did homework early
Did homework
Taking good notes
Attending class
0 4 8 12 16 20
![Page 5: Introduction to random variables](https://reader034.vdocument.in/reader034/viewer/2022051209/5482ed21b07959570c8b48e3/html5/thumbnails/5.jpg)
Reading through text
Did homework early
Did homework
Taking good notes
Attending class
0 4 8 12 16 20
Start homework earlier
More work outside of class
Read book
![Page 6: Introduction to random variables](https://reader034.vdocument.in/reader034/viewer/2022051209/5482ed21b07959570c8b48e3/html5/thumbnails/6.jpg)
Recaps
Powerpoints
Website
Clear presentation/explanations
Interactivity & Feedback
Examples
0 5 10 15 20 25
![Page 7: Introduction to random variables](https://reader034.vdocument.in/reader034/viewer/2022051209/5482ed21b07959570c8b48e3/html5/thumbnails/7.jpg)
Recaps
Powerpoints
Website
Clear presentation/explanations
Interactivity & Feedback
Examples
0 5 10 15 20 25
T shirts
Accent
![Page 8: Introduction to random variables](https://reader034.vdocument.in/reader034/viewer/2022051209/5482ed21b07959570c8b48e3/html5/thumbnails/8.jpg)
Improvements
Board skills: mistakes, more details & structure, straight lines
Pace: 5 good, 5 too fast, 2 too slow
Office hours. Homework answers online.
Connection to text/more practice.
Class mailing list / forums?
![Page 9: Introduction to random variables](https://reader034.vdocument.in/reader034/viewer/2022051209/5482ed21b07959570c8b48e3/html5/thumbnails/9.jpg)
Notation
!
i!{1,...,k}
xi
k!
i=1
xi
!xi
![Page 10: Introduction to random variables](https://reader034.vdocument.in/reader034/viewer/2022051209/5482ed21b07959570c8b48e3/html5/thumbnails/10.jpg)
Recap
What is the law of total probability?
What is the multiplication rule?
What is Bayes rule?
![Page 11: Introduction to random variables](https://reader034.vdocument.in/reader034/viewer/2022051209/5482ed21b07959570c8b48e3/html5/thumbnails/11.jpg)
Recap
A, B and C are independent events.
What is P(A ∪ B ∪ C)?
![Page 12: Introduction to random variables](https://reader034.vdocument.in/reader034/viewer/2022051209/5482ed21b07959570c8b48e3/html5/thumbnails/12.jpg)
Random variables
![Page 13: Introduction to random variables](https://reader034.vdocument.in/reader034/viewer/2022051209/5482ed21b07959570c8b48e3/html5/thumbnails/13.jpg)
Why?
Probability is a set function. Kind of tricky to deal with. Easier to deal with functions of numbers.
Want to ignore details of problem (e.g. specific events) and focus on essence.
Real world ➙ mathematical world
![Page 14: Introduction to random variables](https://reader034.vdocument.in/reader034/viewer/2022051209/5482ed21b07959570c8b48e3/html5/thumbnails/14.jpg)
Definition
A random variable is a function from the sample space to the real line
Usually given a capital letter like X, Y or Z
The space (or support) of a random variable is the range of the function (analogous to the sample space)
(Usually just call the result a random variable)
![Page 15: Introduction to random variables](https://reader034.vdocument.in/reader034/viewer/2022051209/5482ed21b07959570c8b48e3/html5/thumbnails/15.jpg)
Discrete vs. continuous
Space of X is countable = can be mapped to integers = discrete
Space of X is uncountable = can be mapped to real numbers = continuous
(We’ll focus on discrete to start with)
![Page 16: Introduction to random variables](https://reader034.vdocument.in/reader034/viewer/2022051209/5482ed21b07959570c8b48e3/html5/thumbnails/16.jpg)
Example
Select a family at random and observe their children. What is the sample space?
What random variables could we create from this experiment?
![Page 17: Introduction to random variables](https://reader034.vdocument.in/reader034/viewer/2022051209/5482ed21b07959570c8b48e3/html5/thumbnails/17.jpg)
Example
Pick someone at random out of this class. Measure their height.
What random variables could we create from this experiment?
![Page 18: Introduction to random variables](https://reader034.vdocument.in/reader034/viewer/2022051209/5482ed21b07959570c8b48e3/html5/thumbnails/18.jpg)
Random variables
For a countable sample space, usually a count. (But many things we could count)
For a uncountable sample space, usually just the value. (Typically fewer logical possibilities)
![Page 19: Introduction to random variables](https://reader034.vdocument.in/reader034/viewer/2022051209/5482ed21b07959570c8b48e3/html5/thumbnails/19.jpg)
Random event Random variable
Anything Numbers
ProbabilityProbability mass
function
![Page 20: Introduction to random variables](https://reader034.vdocument.in/reader034/viewer/2022051209/5482ed21b07959570c8b48e3/html5/thumbnails/20.jpg)
Discrete pmf
f(x) > 0 !x " S
!
x!S
f(x) = 1
P (X ! A) =!
x!A
f(x)
![Page 21: Introduction to random variables](https://reader034.vdocument.in/reader034/viewer/2022051209/5482ed21b07959570c8b48e3/html5/thumbnails/21.jpg)
Example
• If X=1, f(x) = 0.9
• If X=2,3,4,5 or 6, f(x) = c/x
• (How to write and read more mathematically)
• Is this function is a pmf? What is c?
![Page 22: Introduction to random variables](https://reader034.vdocument.in/reader034/viewer/2022051209/5482ed21b07959570c8b48e3/html5/thumbnails/22.jpg)
Why?
Once we have random variable + pmf, we don’t need any more information about the original experiment.
Means we can apply the same tools to completely different types of experiments.
![Page 23: Introduction to random variables](https://reader034.vdocument.in/reader034/viewer/2022051209/5482ed21b07959570c8b48e3/html5/thumbnails/23.jpg)
Example
Draw two cards (with replacement) out of a shuffled pack. Let X be the number of hearts and clubs. What is the pmf of X?
Pick two people at random. Let Y be the number of males. What is the pmf of Y?
How are these pmfs related?
![Page 24: Introduction to random variables](https://reader034.vdocument.in/reader034/viewer/2022051209/5482ed21b07959570c8b48e3/html5/thumbnails/24.jpg)
Expectation
E[u(X)] =!
x!S
u(x)f(x)
Summarises a function of a random number with a single number
![Page 25: Introduction to random variables](https://reader034.vdocument.in/reader034/viewer/2022051209/5482ed21b07959570c8b48e3/html5/thumbnails/25.jpg)
Properties
E[c] = c
E[cu(X)] = cE[u(X)]E[au1(X) + bu2(X)] = aE[u1(X)] + bE[u2(X)]
What are c and u?
All conditions together imply E is a linear operator