STAT 111 Recitation 2 Linjun Zhang October 10, 2017
Misc. Please collect homework 1 (graded). 1
Misc. Please collect homework 1 (graded). Office hours: 4:30-5:30pm every Monday, JMHH F86. 1
Misc. Please collect homework 1 (graded). Office hours: 4:30-5:30pm every Monday, JMHH F86. Professor Ewens: By Tuesdays class you have to have done the JMP exercise that I gave you, and you should bring the results to class that day. 1
Misc. Please collect homework 1 (graded). Office hours: 4:30-5:30pm every Monday, JMHH F86. Professor Ewens: By Tuesdays class you have to have done the JMP exercise that I gave you, and you should bring the results to class that day. The slides can be found on http://stat.wharton.upenn.edu/~linjunz 1
Recap The relationship of probability and statistics; Events (A,B...); Probabilities of events (Prob(A), Prob(B)); Intersections and unions of events (Prob(A B), Prob(A B)) (addition rules); Independence of events and conditional probabilities (multiplication rules). 2
Important formulas Addition rules 0 Prob(A) 1, where A is any event. Prob(A B) = Prob(A) + Prob(B) Prob(A B) If A and B are mutually exclusive, Prob(A B) = Prob(A) + Prob(B) Let B = A c, then Prob(A c ) = 1 Prob(A). 3
Important formulas Multiplication rules Conditional probability: Prob(A B) = Prob(A B) Prob(B) A and B independent if and only if Prob(A B) = Prob(A)Prob(B) or Prob(A B) = Prob(A) 4
Exercises Suppose that Prob(A) = 0.4, Prob(B) = 0.3, Prob(A B) = 0.2. Prob(B A) =? 5
Exercises Suppose that Prob(A) = 0.4, Prob(B) = 0.3, Prob(A B) = 0.2. Prob(B A) =? Prob(B A) = Prob(A B) Prob(A) = 0.2 0.4 = 0.5. 5
Exercises Suppose that Prob(A) = 0.4, Prob(B) = 0.3, Prob(A B) = 0.2. Prob(B A) =? Prob(B A) = Prob(A B) Prob(A) = 0.2 0.4 = 0.5. If events C and D are independent with Prob(C) = 0.1 and Prob(D) = 0.5, Prob(C D) =? 5
Exercises Suppose that Prob(A) = 0.4, Prob(B) = 0.3, Prob(A B) = 0.2. Prob(B A) =? Prob(B A) = Prob(A B) Prob(A) = 0.2 0.4 = 0.5. If events C and D are independent with Prob(C) = 0.1 and Prob(D) = 0.5, Prob(C D) =? Prob(C D) = Prob(C) = 0.1 5
Exercises Suppose that Prob(A) = 0.4, Prob(B) = 0.3, Prob(A B) = 0.2. Prob(B A) =? Prob(B A) = Prob(A B) Prob(A) = 0.2 0.4 = 0.5. If events C and D are independent with Prob(C) = 0.1 and Prob(D) = 0.5, Prob(C D) =? Prob(C D) = Prob(C) = 0.1 If events C and D are independent with Prob(C) = 0.1 and Prob(D) = 0.5, Prob(C D) =? 5
Exercises Suppose that Prob(A) = 0.4, Prob(B) = 0.3, Prob(A B) = 0.2. Prob(B A) =? Prob(B A) = Prob(A B) Prob(A) = 0.2 0.4 = 0.5. If events C and D are independent with Prob(C) = 0.1 and Prob(D) = 0.5, Prob(C D) =? Prob(C D) = Prob(C) = 0.1 If events C and D are independent with Prob(C) = 0.1 and Prob(D) = 0.5, Prob(C D) =? Hint: Prob(C D) = Prob(C) + Prob(D) Prob(C D) 5
Exercises Suppose that Prob(A) = 0.4, Prob(B) = 0.3, Prob(A B) = 0.2. Prob(B A) =? Prob(B A) = Prob(A B) Prob(A) = 0.2 0.4 = 0.5. If events C and D are independent with Prob(C) = 0.1 and Prob(D) = 0.5, Prob(C D) =? Prob(C D) = Prob(C) = 0.1 If events C and D are independent with Prob(C) = 0.1 and Prob(D) = 0.5, Prob(C D) =? Hint: Prob(C D) = Prob(C) + Prob(D) Prob(C D) Prob(C D) = 0.1 + 0.5 0.1 0.5 = 0.55 5
Random variables and data Random variable (R.V.): X Denoted by upper-case letters. A before the experiment concept. Data (or observed value): x Denoted by lower-case letters. An after the experiment concept. Example The number of heads I will get tomorrow in 10 flips of a coin is a R.V.. I flipped a coin 10 times, and got 7 heads, then this 7 is data. 6
Discrete Random Variables A discrete random variable is a numerical quantity that in some future experiment that involves randomness will take one value from some discrete set of possible values. The probability distribution of a discrete R.V. X can be written as These probabilities can be either known or unknown. 7
Examples We flip a fair coin twice, let X be the number of heads that appeared. What is the probability distribution of X? 8
Examples We flip a fair coin twice, let X be the number of heads that appeared. What is the probability distribution of X? The possible values of X are 0, 1, 2. 8
Examples We flip a fair coin twice, let X be the number of heads that appeared. What is the probability distribution of X? The possible values of X are 0, 1, 2. Prob(X = 0) = Prob(0 head) = Prob(TT ) = Prob(T ) Prob(T ) = 1 4 8
Examples We flip a fair coin twice, let X be the number of heads that appeared. What is the probability distribution of X? The possible values of X are 0, 1, 2. Prob(X = 0) = Prob(0 head) = Prob(TT ) = Prob(T ) Prob(T ) = 1 4 Prob(X = 1) = Prob(1 head) = Prob(HT ) + Prob(TH) = 1/4 + 1/4 = 1/2 8
Examples We flip a fair coin twice, let X be the number of heads that appeared. What is the probability distribution of X? The possible values of X are 0, 1, 2. Prob(X = 0) = Prob(0 head) = Prob(TT ) = Prob(T ) Prob(T ) = 1 4 Prob(X = 1) = Prob(1 head) = Prob(HT ) + Prob(TH) = 1/4 + 1/4 = 1/2 Prob(X = 2) = Prob(2 heads) = Prob(HH) = 1/4 8
Examples We flip a fair coin twice, let X be the number of heads that appeared. What is the probability distribution of X? The possible values of X are 0, 1, 2. Prob(X = 0) = Prob(0 head) = Prob(TT ) = Prob(T ) Prob(T ) = 1 4 Prob(X = 1) = Prob(1 head) = Prob(HT ) + Prob(TH) = 1/4 + 1/4 = 1/2 Prob(X = 2) = Prob(2 heads) = Prob(HH) = 1/4 Generally, let X be the number of heads that we will get on two flips of the biased coin with Prob(H) = θ. (θ is called parameter.) 8
Parameters A parameter is some constant whose numerical value is either known or (more often in practice) unknown to us. 9
Parameters A parameter is some constant whose numerical value is either known or (more often in practice) unknown to us. Notation, we denote the numerical values of a parameter by a greek letter, e.g. θ, µ, σ, α, β. (Recall: Three notations we now had: θ parameter; X r.v.; x data) 9
Parameters A parameter is some constant whose numerical value is either known or (more often in practice) unknown to us. Notation, we denote the numerical values of a parameter by a greek letter, e.g. θ, µ, σ, α, β. (Recall: Three notations we now had: θ parameter; X r.v.; x data) Example: We are testing a proposed new medicine, there are some unknown probability, θ, that it cures a patient of some disease. 9
Binomial Distribution A random variable X is said to have a Binomial(n, θ) distribution if it counts the number of successes in a sequence of n independent yes/no experiments, each of which yields success with probability θ. In this case the probability distribution of X is ( ) n Prob(X = x) = θ x (1 θ) n x, x = 0, 1, 2,..., n. x (We call n the index of the distribution, θ the parameter of the distribution.) 10
Binomial Distribution A random variable X is said to have a Binomial(n, θ) distribution if it counts the number of successes in a sequence of n independent yes/no experiments, each of which yields success with probability θ. In this case the probability distribution of X is ( ) n Prob(X = x) = θ x (1 θ) n x, x = 0, 1, 2,..., n. x (We call n the index of the distribution, θ the parameter of the distribution.) E.g. The number of Heads from 10 coin flips. 10
Binomial Distribution A random variable X is said to have a Binomial(n, θ) distribution if it counts the number of successes in a sequence of n independent yes/no experiments, each of which yields success with probability θ. In this case the probability distribution of X is ( ) n Prob(X = x) = θ x (1 θ) n x, x = 0, 1, 2,..., n. x (We call n the index of the distribution, θ the parameter of the distribution.) E.g. The number of Heads from 10 coin flips. The binomial distribution arises if and only if (i) n is fixed; (ii) Exactly two possible outcomes on each trial; (iii) The values of the trials are independent and (iv) identically distributed. 10
Binomial Distribution Suppose there is a biased coin with Prob(H) = 0.3. The number of tails from 20 flips. 11
Binomial Distribution Suppose there is a biased coin with Prob(H) = 0.3. The number of tails from 20 flips. You roll a die 10 times. The number of 6 turning up. 11
Binomial Distribution Suppose there is a biased coin with Prob(H) = 0.3. The number of tails from 20 flips. You roll a die 10 times. The number of 6 turning up. You have 8 balls in a bag. 4 blue and 4 yellow. Pick up 3 balls one at a time from the bag (don t put it back), the number of blue balls. 11
Binomial Distribution Lebron James are standing on the free throw line. Assume that for every free throw of LBJ, the results are independent and Prob(LBJ make a shot) = 0.75. If LBJ is going to try 10 times, the number of shots he will make. 12
Binomial Distribution Lebron James are standing on the free throw line. Assume that for every free throw of LBJ, the results are independent and Prob(LBJ make a shot) = 0.75. If LBJ is going to try 10 times, the number of shots he will make. If LBJ aims to make 10 shots, the number of free throws he will try. 12
Binomial Distribution Recall that Prob(X = x) = The binomial coefficient ( ) n θ x (1 θ) n x, x = 0, 1, 2,..., n. x ( ) n = x n! (n x)!x! is read as n chooses x, and represents the number of different ordering in which x successes can arise in n trials. 13
Practice problems 1. X has a binomial distribution Binomial(n, θ) with n = 12 and θ = 0.4 1 What is the probability that X = 6? 14
Practice problems 1. X has a binomial distribution Binomial(n, θ) with n = 12 and θ = 0.4 1 What is the probability that X = 6? 2 0.1766 14
Practice problems 1. X has a binomial distribution Binomial(n, θ) with n = 12 and θ = 0.4 1 What is the probability that X = 6? 2 What is the probability that X is 2 or less? 15
Practice problems 1. X has a binomial distribution Binomial(n, θ) with n = 12 and θ = 0.4 1 What is the probability that X is 2 or less? 16
Practice problems 1. X has a binomial distribution Binomial(n, θ) with n = 12 and θ = 0.4 1 What is the probability that X is 2 or less? 2 Prob(X 2) = Prob(X = 0) + Prob(X = 1) + Prob(X = 2) = 0.0022 + 0.0174 + 0.0639 = 0.0835. 16
A conceptual question Suppose we have two discrete R.V.s X 1, X 2. If X 1 has a binomial distribution Binomial(n, θ), and X 2 satisfies Binomial(n, 1 θ), can you show that for any k = 0, 1,..., n, P(X 1 = k) = P(X 2 = n k)? 17
A conceptual question Suppose we have two discrete R.V.s X 1, X 2. If X 1 has a binomial distribution Binomial(n, θ), and X 2 satisfies Binomial(n, 1 θ), can you show that for any k = 0, 1,..., n, P(X 1 = k) = P(X 2 = n k)? Method 1: Use the formula: Prob(X 1 = k) = ( n k) θ k (1 θ) n k, Prob(X 2 = n k) = ( ) n n k (1 θ) n k θ k 17
A conceptual question Suppose we have two discrete R.V.s X 1, X 2. If X 1 has a binomial distribution Binomial(n, θ), and X 2 satisfies Binomial(n, 1 θ), can you show that for any k = 0, 1,..., n, P(X 1 = k) = P(X 2 = n k)? Method 1: Use the formula: Prob(X 1 = k) = ( n k) θ k (1 θ) n k, Prob(X 2 = n k) = ( ) n n k (1 θ) n k θ k Method 2: Use the interpretation: If X 1 is Binomial(n, θ), then Prob(X 1 = k) = Prob(k successes from n experiments) = Prob(n k failures from n experiments) = Prob(X 2 = n k). 17
Practice problems 2. X has a binomial distribution Binomial(n, θ) with n = 12 and θ = 0.7 What is the probability that X = 7? 18
Practice problems 2. X has a binomial distribution Binomial(n, θ) with n = 12 and θ = 0.7 What is the probability that X = 7? Let Y satisfy Binomial(n, 0.3), then Prob(X = 7) = Prob(Y = 5) = 0.1585 18