STAT 111 Recitation 3 Linjun Zhang stat.wharton.upenn.edu/~linjunz/ September 23, 2017
Misc. The unpicked-up homeworks will be put in the STAT 111 box in the Stats Department lobby (It s on the 4th floor of JMHH. Turn right when you exit the elevator). 1
Misc. The unpicked-up homeworks will be put in the STAT 111 box in the Stats Department lobby (It s on the 4th floor of JMHH. Turn right when you exit the elevator). 2
Homework Problem Problem Show that if A and B are independent events then A c and B c are also independent events. 3
Homework Problem Problem Show that if A and B are independent events then A c and B c are also independent events. Solutions Goal: Prob(A c B c ) = Prob(A c ) Prob(B c ). 3
Homework Problem Problem Show that if A and B are independent events then A c and B c are also independent events. Solutions Goal: Prob(A c B c ) = Prob(A c ) Prob(B c ). Prob(A c B c ) = 1 Prob(A B). 3
Homework Problem Problem Show that if A and B are independent events then A c and B c are also independent events. Solutions Goal: Prob(A c B c ) = Prob(A c ) Prob(B c ). Prob(A c B c ) = 1 Prob(A B). 1 Prob(A B) = 1 (Prob(A) + Prob(B) Prob(A B)) = 1 (Prob(A) + Prob(B) Prob(A) Prob(B)) = 1 Prob(A) Prob(B) + Prob(A) Prob(B)). 3
Homework Problem Problem Show that if A and B are independent events then A c and B c are also independent events. Solutions Goal: Prob(A c B c ) = Prob(A c ) Prob(B c ). Prob(A c B c ) = 1 Prob(A B). 1 Prob(A B) = 1 (Prob(A) + Prob(B) Prob(A B)) = 1 (Prob(A) + Prob(B) Prob(A) Prob(B)) = 1 Prob(A) Prob(B) + Prob(A) Prob(B)). On the other hand, Prob(A c ) Prob(B c ) = (1 Prob(A))(1 Prob(B)) = 1 Prob(A) Prob(B) + Prob(A) Prob(B)) 3
Homework Problem Problem Show that if A and B are independent events then A c and B c are also independent events. Solutions Goal: Prob(A c B c ) = Prob(A c ) Prob(B c ). Prob(A c B c ) = 1 Prob(A B). 1 Prob(A B) = 1 (Prob(A) + Prob(B) Prob(A B)) = 1 (Prob(A) + Prob(B) Prob(A) Prob(B)) = 1 Prob(A) Prob(B) + Prob(A) Prob(B)). On the other hand, Prob(A c ) Prob(B c ) = (1 Prob(A))(1 Prob(B)) = 1 Prob(A) Prob(B) + Prob(A) Prob(B)) Therefore, Prob(A c B c ) = Prob(A c ) Prob(B c ). 3
Recap Random variables (X ; before the experiment) and data (x; after experiment) Parameters: θ, µ... Discrete random variables and probability distribution Binomial distribution: Prob(X = x) = ( ) n θ x (1 θ) n x, x = 0, 1, 2,..., n. x Binomial Chart (What if θ > 0.5?) 4
This class Mean and variance of a discrete random variable Special case: Mean and variance of a binomial random variable Die rolling example Many random variables: sum and average 5
The mean of a discrete random variable Recall that the probability distribution of a discrete R.V. X can be written as 6
The mean of a discrete random variable Recall that the probability distribution of a discrete R.V. X can be written as The mean of X is defined as µ = v 1Prob(X = v 1) +... + v k Prob(X = v k ) = k v i Prob(X = v i ). i=1 6
The mean of a discrete random variable Recall that the probability distribution of a discrete R.V. X can be written as The mean of X is defined as µ = v 1Prob(X = v 1) +... + v k Prob(X = v k ) = k v i Prob(X = v i ). i=1 Intuition: center of gravity of a probability distribution 6
The mean of a discrete random variable Recall that the probability distribution of a discrete R.V. X can be written as The mean of X is defined as µ = v 1Prob(X = v 1) +... + v k Prob(X = v k ) = k v i Prob(X = v i ). i=1 Intuition: center of gravity of a probability distribution Notation µ is often used for mean. 6
The mean of a discrete random variable Recall that the probability distribution of a discrete R.V. X can be written as The mean of X is defined as µ = v 1Prob(X = v 1) +... + v k Prob(X = v k ) = k v i Prob(X = v i ). i=1 Intuition: center of gravity of a probability distribution Notation µ is often used for mean. A mean is not an average. 6
The variance of a discrete random variable The variance of X is defined as σ 2 = (v 1 µ) 2 Prob(X = v 1) +... + (v k µ) 2 Prob(X = v k ) k = (v i µ) 2 Prob(X = v i ). i=1 The variance is a measure of the dispersion (spread-out-ness) of the probability distribution of the random variable around its mean. The larger the variance, the more spread out the probability distribution is. Notation σ 2 is often used for variance (a variance is a parameter), with σ being its standard deviation. 7
The variance of a discrete random variable The variance of X is defined as σ 2 = (v 1 µ) 2 Prob(X = v 1) +... + (v k µ) 2 Prob(X = v k ) k = (v i µ) 2 Prob(X = v i ). i=1 The variance is a measure of the dispersion (spread-out-ness) of the probability distribution of the random variable around its mean. The larger the variance, the more spread out the probability distribution is. Notation σ 2 is often used for variance (a variance is a parameter), with σ being its standard deviation. An alternative formula σ 2 = k i=1 v 2 i Prob(X = v i ) µ 2 7
The variance of a discrete random variable Proof: 8
Mean and variance Which is which? {(µ = 0, σ 2 = 1), (µ = 0, σ 2 = 3), (µ = 2, σ 2 = 1), (µ = 2, σ 2 = 3)}. 9
Practice Problems Practice Problem Let X be a random variable with the following probability distribution: Possible values of X 0 1 2 3 Probabilities 1 6 1 4 1 3 1 4 Find the mean and standard deviation of X. 10
Practice Problems Practice Problem Let X be a random variable with the following probability distribution: Possible values of X 0 1 2 3 Probabilities 1 6 1 4 1 3 1 4 Find the mean and standard deviation of X. Solution µ = 0 1 6 + 1 1 4 + 2 1 3 + 3 1 4 = 3 12 + 8 12 + 9 12 = 20 12 = 5 3. σ 2 = 1 1 4 + 22 1 3 + 32 1 4 ( 5 3 )2 = 1 4 + 4 3 + 9 4 25 9 19 σ = 18. = 9+48+81 100 36 = 19 18. 10
Binomial Distribution A random variable X is said to have a Binomial(n, θ) distribution if it has the probability distribution ( ) Prob(X = x) = n x θ x (1 θ) n x, x = 0, 1, 2,..., n. (We call n the index of the distribution, θ the parameter of the distribution.) 11
Binomial Distribution A random variable X is said to have a Binomial(n, θ) distribution if it has the probability distribution ( ) Prob(X = x) = n x θ x (1 θ) n x, x = 0, 1, 2,..., n. (We call n the index of the distribution, θ the parameter of the distribution.) Mean µ = nθ; Variance σ 2 = nθ(1 θ). This is the short formula for binomial distribution ONLY! 11
Practice Problems Practice Problem Calculate the mean and variance of a r.v. X with binomial distribution Binomial(2, 0.7) by the binomial charts; by the probability distribution formula P(X = x) = ( n x) θ x (1 θ) n x ; by the short formula. 12
Die rolling example Let X i be the number that will turn up in the i-th rolling (i = 1, 2,..., 1000). 13
Die rolling example Let X i be the number that will turn up in the i-th rolling (i = 1, 2,..., 1000). i.i.d: Random variables which are independent of each other, and which all have the same probability distribution, are said to be i.i.d (independently and identically distributed). 13
Die rolling example Let X i be the number that will turn up in the i-th rolling (i = 1, 2,..., 1000). i.i.d: Random variables which are independent of each other, and which all have the same probability distribution, are said to be i.i.d (independently and identically distributed). The mean is not an average: mean µ, observed data average x, random variable average X. (parameter, data, random variable). 13
Die rolling example Let X i be the number that will turn up in the i-th rolling (i = 1, 2,..., 1000). i.i.d: Random variables which are independent of each other, and which all have the same probability distribution, are said to be i.i.d (independently and identically distributed). The mean is not an average: mean µ, observed data average x, random variable average X. (parameter, data, random variable). Probabilities that are used in statistics, if we roll a die 1000 times, assuming the die is fair, then with probability 0.95, the average lies in the interval [3.392, 3.608], that is, Prob(3.392 X 3.608) 0.95. 13
Die rolling example Let X i be the number that will turn up in the i-th rolling (i = 1, 2,..., 1000). i.i.d: Random variables which are independent of each other, and which all have the same probability distribution, are said to be i.i.d (independently and identically distributed). The mean is not an average: mean µ, observed data average x, random variable average X. (parameter, data, random variable). Probabilities that are used in statistics, if we roll a die 1000 times, assuming the die is fair, then with probability 0.95, the average lies in the interval [3.392, 3.608], that is, Prob(3.392 X 3.608) 0.95. In general, Prob(µ( X ) 2σ( X ) X µ( X ) + 2σ( X )) 0.95, where µ( X ), σ( X ) denote the mean and standard deviation of X, and this probability statement is called two-standard-deviation rule. 13
Many random variables Given n random variables X 1, X 2,..., X n, we can define two other random variables: The sum, denoted by T n : T n = X 1 + X 2 +... + X n ; The average, denoted by X, X = X1+X2+...+Xn n = Tn n. Both the sum and the average, being random variables, each have a probability distribution, and thus each has a mean and variance. An average is a totally different concept from a mean a mean is a parameter. 14
Mean and Variance of X Given n i.i.d. random variables X 1, X 2,..., X n with mean µ and variance σ 2, we define two other random variables: The sum, denoted by T n : T n = X 1 + X 2 +... + X n ; The average, denoted by X, X = X1+X2+...+Xn n = Tn n. Must-know formula for T n and X Mean of T n = nµ; Variance of T n = nσ 2 ; Mean of X = µ; Variance of X = σ 2 /n. 15
Practice problem Let X i be the number that will turn up in the i -th rolling (i = 1, 2,..., 1000). Assuming the die is fair. Calculate the mean and variance of X. 16
Practice problem Let X i be the number that will turn up in the i -th rolling (i = 1, 2,..., 1000). Assuming the die is fair. Calculate the mean and variance of X. Solution µ = 1 6 (1 + 2 + 3 + 4 + 5 + 6) = 3.5 16
Practice problem Let X i be the number that will turn up in the i -th rolling (i = 1, 2,..., 1000). Assuming the die is fair. Calculate the mean and variance of X. Solution µ = 1 6 (1 + 2 + 3 + 4 + 5 + 6) = 3.5 σ 2 = 1 6 (12 + 2 2 + 3 2 + 4 2 + 5 2 + 6 2 ) 3.5 2 = 35 12 16
Practice problem Let X i be the number that will turn up in the i -th rolling (i = 1, 2,..., 1000). Assuming the die is fair. Calculate the mean and variance of X. Solution µ = 1 6 (1 + 2 + 3 + 4 + 5 + 6) = 3.5 σ 2 = 1 6 (12 + 2 2 + 3 2 + 4 2 + 5 2 + 6 2 ) 3.5 2 = 35 12 µ( X ) = µ = 3.5; σ 2 ( X ) = σ2 n = 35 12000 = 7 2400. 16