Lecture13 Randomvariables
Lecture13 Randomvariables
Random Variables
Logistics
Formally:
An event in a sample space
P(X = k)
“The probability that the random variable X takes the value k”
Mean n
Expected value
1
x xi
n i 1
Variance Variance
n
2 1 2
s
X i ( x x )
(n 1) i 1
Each observation has equal Each possible outcome in
weight (1/n) the sample space receives
its own weight (pi)
1. Variance-Mean relationship
Examples:
Transformation: converting degrees F to degrees C
Combination: adding your midterm and final exam scores
Linear combinations: Z = X + Y, Z = aX + bY
E ( a) a Var (a ) 0
E (bX ) b E ( X ) Var(bX ) b 2 Var ( X )
E ( a bX ) a b E ( X ) Var (a bX ) b 2 Var ( X )
UH covers this:
Let a, b and c be constants, and X and Y be independent random variables
E ( X Y ) E ( X ) E (Y )
E ( X Y ) E ( X ) E (Y )
E (a bX cY ) a bE ( X ) cE (Y )
If the individuals all text each other and decide to either all show
up or all not show up (attendance for each individual is now
dependent), we will always have either 0 or 10 individuals. The
average is still 5, but the outcomes are more extreme
Summary
There are simple rules for expectations and variances
Coin tosses:
Each individual toss is an RV with 2 outcomes
Let X be the random variable for each toss: = {H,T}
X ~ Bernoulli ( p)
X ~ Bernoulli ( p)
The Binomial describes the probability distribution of
counts of successful trials
What about
What is the probability of each outcome
p k (1 p ) 2 k
k n k
And in general:
... p (1 p)
Stat 311 Summer 2016 28
How many outcomes satisfy
This is a counting problem
HTT HHT
THT HTH
TTT TTH THHHHH
n 3 3 3 3
, , ,
k 0 1 2 3
1, 3, 3, 1
is referred to as the binomial coefficient in this context
n k n k
X ~ Bin(n; p) P ( X k ) p (1 p )
k
E ( X ) X Var ( X ) X2
n n
E ( Y ) Var ( Y )
i 1 i 1
n
n Y2 *
E (Y ) *
i 1 np (1 p )
nY
np
* Using E(Z+W) = E(Z) + E(W) * Using Var(Z+W) = Var(Z) + Var(W)
for independent RVs Z and W
Stat 311 Summer 2016 32
Binomial Summary
For any repeated Bernoulli trial, the count of successes, X,
has a Binomial distribution:
X ~ Bin (n; p )
n
f ( x; n, p) p x (1 p) n x
x
X np
X2 np(1 p )
We can calculate the mean, variance, and the probability of any value
of X from just two values: n and p
for x ≥ 0
e x
f ( x; ) P( X x)
x!
X X2
What is the probability that 15 cars pass through the intersection in an hour?