Chapter 3 Discrete Random Variables and Probability Distributions
Chapter 3 Discrete Random Variables and Probability Distributions § 3. 1 - Random Variables § 3. 2 - Probability Distributions for Discrete Random Variables § 3. 3 - Expected Values § 3. 4 - The Binomial Probability Distribution § 3. 5 - Hypergeometric and Negative Binomial Distributions § 3. 6 - The Poisson Probability Distribution
Certain events are best described by random variables (from which their corresponding probabilities can then be calculated). Recall that there are two types of numerical (versus categorical) random variable: Discrete and Continuous 2
Certain events are best described by random variables (from which their corresponding probabilities can then be calculated). Recall that there are two types of numerical (versus categorical) random variable: Discrete and Continuous 3
Example: Roll a fair die once. Sample space {1, 2, 3, 4, 5, 6} Random Variable X = “Value shown” Discrete
Example: Roll a fair die once. Sample space {1, 2, 3, 4, 5, 6} Discrete Random Variable X = “Value shown” “probability mass function” pmf X is uniformly distributed over 1, 2, 3, 4, 5, 6. Probability Histogram P(X = x) x p(x) 1 1/6 2 1/6 3 1/6 4 1/6 5 1/6 6 1/6 1 Total Area = 1 X “What is the probability of rolling a 4? ” 5
Example: Roll a fair die once. Sample space {1, 2, 3, 4, 5, 6} Discrete Random Variable X = “Value shown” “probability mass function” pmf X is uniformly distributed over 1, 2, 3, 4, 5, 6. Probability Histogram P(X = x) x p(x) 1 1/6 2 1/6 3 1/6 4 1/6 5 1/6 6 1/6 1 Total Area = 1 X “What is the probability of rolling a 4? ” 6
Example: Roll a fair die once. Sample space {1, 2, 3, 4, 5, 6} Discrete Random Variable X = “Value shown” “probability mass “Cumulative dist function” pmf cdf P(X = x) P(X x) x p(x) F(x) 1 1/6 2/6 3 1/6 3/6 4 1/6 4/6 5 1/6 5/6 6 1/6 1 1 7
Example: Roll a fair die once. Sample space {1, 2, 3, 4, 5, 6} Discrete Random Variable X = “Value shown” “probability mass “Cumulative dist function” pmf cdf P(X = x) P(X x) x p(x) F(x) 1 1/6 2/6 3 1/6 3/6 4 1/6 4/6 5 1/6 5/6 6 1/6 1 1 “step function” “jump discontinuities” “piecewise constant” “staircase graph” from 0 to 1 8
Example: Roll a biased die once. Sample space {1, 2, 3, 4, 5, 6} Discrete Random Variable X = “Value shown” pmf P(X = x) x p (x) 1 0. 20 2 0. 30 3 0. 20 4 0. 15 5 0. 10 6 0. 05 1 0. 30 0. 20 0. 15 0. 10 0. 05 9
Example: Roll two dice, independently. Sample space Discrete Random Variable Y = “Sum” pmf P(X 1 = x) P(X 2 = x) x p 1 (x) p 2 (x) 1 0. 20 0. 14 2 0. 30 0. 16 3 0. 20 4 0. 15 0. 20 5 0. 10 0. 16 6 0. 05 0. 14 1 1 0. 20 0. 16 0. 14 10
Example: Roll two dice, independently. Sample space Discrete Random Variable Y = “Sum” P(Y = y) pmf P(X 1 = x) P(X 2 = x) x y p (y) 2 3 4 p 1 (x) p 2 (x) 1 0. 20 0. 14 2 0. 30 0. 16 7 3 0. 20 8 4 0. 15 0. 20 9 5 0. 10 0. 16 6 0. 05 0. 14 1 1 5 6 10 11 12 1 11
Example: Roll two dice, independently. Sample space Discrete Random Variable Y = “Sum” P(Y = y) pmf P(X 1 = x) P(X 2 = x) x y Outcomes p (y) 2 3 4 p 1 (x) p 2 (x) 1 0. 20 0. 14 2 0. 30 0. 16 7 3 0. 20 8 4 0. 15 0. 20 9 5 0. 10 0. 16 6 0. 05 0. 14 1 1 5 6 10 11 12
Example: Roll two dice, independently. Sample space Discrete Random Variable Y = “Sum” P(Y = y) pmf P(X 1 = x) P(X 2 = x) x y Outcomes 2 (1, 1) 3 (1, 2), (2, 1) 4 (1, 3), (2, 2), (3, 1) p 1 (x) p 2 (x) 1 0. 20 0. 14 2 0. 30 0. 16 7 3 0. 20 8 4 0. 15 0. 20 9 5 0. 10 0. 16 6 0. 05 0. 14 1 1 5 6 10 p (y) . . . 11 (5, 6), (6, 5) 12 (6, 6) 1 13
Example: Roll two dice, independently. Sample space Discrete Random Variable Y = “Sum” Not equally likely! pmf P(X 1 = x) P(X 2 = x) x P(Y = y) y Outcomes p (y) 2 (1, 1) 1/36 ? 3 (1, 2), (2, 1) 2/36 ? 4 (1, 3), (2, 2), (3, 1) 3/36 ? p 1 (x) p 2 (x) 1 0. 20 0. 14 2 0. 30 0. 16 7 3 0. 20 8 4 0. 15 0. 20 9 5 0. 10 0. 16 6 0. 05 0. 14 1 1 5 6 10 . . . 4/36 ? 5/36 ? 6/36 ? 5/36 ? 4/36 ? 3/36 ? 11 (5, 6), (6, 5) 2/36 ? 12 (6, 6) 1/36 ? 1 14
Example: Roll two dice, independently. Sample space Discrete Random Variable Y = “Sum” Equally likely… pmf P(X 1 = x) P(X 2 = x) x P(Y = y) y Outcomes p (y) 2 (1, 1) 1/36 3 (1, 2), (2, 1) 2/36 4 (1, 3), (2, 2), (3, 1) 3/36 p 1 (x) p 2 (x) 1 1/6 2 1/6 7 3 1/6 8 4 1/6 9 5 1/6 6 1/6 1 1 5 6 10 . . . 4/36 5/36 6/36 5/36 4/36 3/36 11 (5, 6), (6, 5) 2/36 12 (6, 6) 1/36 1 15
Example: Roll two dice, independently. Sample space Discrete Random Variable Y = “Sum” P(Y = y) pmf P(X 1 = x) P(X 2 = x) x y Outcomes 2 (1, 1) 3 (1, 2), (2, 1) 4 (1, 3), (2, 2), (3, 1) p 1 (x) p 2 (x) 1 0. 20 0. 14 2 0. 30 0. 16 7 3 0. 20 8 4 0. 15 0. 20 9 5 0. 10 0. 16 6 0. 05 0. 14 1 1 5 6 10 p (y) . . . 11 (5, 6), (6, 5) 12 (6, 6) 1 16
Example: Roll two dice, independently. Sample space Discrete Random Variable Y = “Sum” P(Y = y) pmf P(X 1 = x) P(X 2 = x) x y Outcomes 2 (1, 1) 3 (1, 2), (2, 1) 4 (1, 3), (2, 2), (3, 1) p 1 (x) p 2 (x) 1 0. 20 0. 14 2 0. 30 0. 16 7 3 0. 20 8 4 0. 15 0. 20 9 5 0. 10 0. 16 6 0. 05 0. 14 1 1 5 6 10 p (y) . . . 11 (5, 6), (6, 5) 12 (6, 6) 1 17
Example: Roll two dice, independently. Sample space Discrete Random Variable Y = “Sum” P(Y = y) pmf P(X 1 = x) P(X 2 = x) x y Outcomes p (y) 2 (1, 1) via independence (0. 20)(0. 14) = 0. 028 3 (1, 2), (2, 1) 4 (1, 3), (2, 2), (3, 1) p 1 (x) p 2 (x) 1 0. 20 0. 14 2 0. 30 0. 16 7 3 0. 20 8 4 0. 15 0. 20 9 5 0. 10 0. 16 6 0. 05 0. 14 1 1 5 6 10 . . . 11 (5, 6), (6, 5) 12 (6, 6) 1 18
Example: Roll two dice, independently. Sample space Discrete Random Variable Y = “Sum” P(Y = y) pmf P(X 1 = x) P(X 2 = x) x y Outcomes p (y) 2 (1, 1) via independence (0. 20)(0. 14) = 0. 028 3 (1, 2), (2, 1) 4 (1, 3), (2, 2), (3, 1) p 1 (x) p 2 (x) 1 0. 20 0. 14 2 0. 30 0. 16 7 3 0. 20 8 4 0. 15 0. 20 9 5 0. 10 0. 16 6 0. 05 0. 14 1 1 5 6 10 . . . 11 (5, 6), (6, 5) 12 (6, 6) 1 19
Example: Roll two dice, independently. Sample space Discrete Random Variable Y = “Sum” P(Y = y) pmf P(X 1 = x) P(X 2 = x) x y Outcomes p (y) 2 (1, 1) via independence (0. 20)(0. 14) = 0. 028 3 (1, 2), (2, 1) 4 (1, 3), (2, 2), (3, 1) p 1 (x) p 2 (x) 1 0. 20 0. 14 2 0. 30 0. 16 7 3 0. 20 8 4 0. 15 0. 20 9 5 0. 10 0. 16 6 0. 05 0. 14 1 1 5 6 10 . . . 11 (5, 6), (6, 5) 12 (6, 6) 1 20
Example: Roll two dice, independently. Sample space Discrete Random Variable Y = “Sum” P(Y = y) pmf P(X 1 = x) P(X 2 = x) y Outcomes p (y) 2 (1, 1) via independence (0. 20)(0. 14) = 0. 028 3 (1, 2), (2, 1) (1, 3), (2, 2), (3, 1) x p 1 (x) p 2 (x) 4 1 0. 20 0. 14 5 2 0. 30 0. 16 3 0. 20 8 4 0. 15 0. 20 9 5 0. 10 0. 16 10 6 0. 05 0. 14 1 1 6 7 (0. 20)(0. 16) . . . 11 (5, 6), (6, 5) 12 (6, 6) 1 21
Example: Roll two dice, independently. Sample space Discrete Random Variable Y = “Sum” P(Y = y) pmf P(X 1 = x) P(X 2 = x) y Outcomes p (y) 2 (1, 1) via independence (0. 20)(0. 14) = 0. 028 3 (1, 2), (2, 1) (1, 3), (2, 2), (3, 1) x p 1 (x) p 2 (x) 4 1 0. 20 0. 14 5 2 0. 30 0. 16 3 0. 20 8 4 0. 15 0. 20 9 5 0. 10 0. 16 10 6 0. 05 0. 14 1 1 6 7 (0. 20)(0. 16) (0. 30)(0. 14) . . . 11 (5, 6), (6, 5) 12 (6, 6) 1 22
Example: Roll two dice, independently. Sample space Discrete Random Variable Y = “Sum” P(Y = y) pmf P(X 1 = x) P(X 2 = x) y Outcomes p (y) 2 (1, 1) via independence (0. 20)(0. 14) = 0. 028 3 (1, 2), (2, 1) via disjoint (1, 3), (2, 2), (3, 1) x p 1 (x) p 2 (x) 4 1 0. 20 0. 14 5 6 2 0. 30 0. 16 3 0. 20 4 0. 15 0. 20 9 5 0. 10 0. 16 10 6 0. 05 0. 14 1 1 7 8 (0. 20)(0. 16) + (0. 30)(0. 14) = 0. 074 . . . 11 (5, 6), (6, 5) 12 (6, 6) 1 23
Example: Roll two dice, independently. Sample space Discrete Random Variable Y = “Sum” P(Y = y) pmf P(X 1 = x) P(X 2 = x) y Outcomes p (y) 2 (1, 1) via independence (0. 20)(0. 14) = 0. 028 3 (1, 2), (2, 1) via disjoint (1, 3), (2, 2), (3, 1) x p 1 (x) p 2 (x) 4 1 0. 20 0. 14 5 6 2 0. 30 0. 16 3 0. 20 4 0. 15 0. 20 9 5 0. 10 0. 16 10 6 0. 05 0. 14 1 1 7 8 . . . (0. 20)(0. 16) + (0. 30)(0. 14) = 0. 074 0. 116 0. 153 0. 170 0. 169 0. 132 0. 082 0. 047 11 (5, 6), (6, 5) 0. 022 12 (6, 6) 0. 007 1 24
POPULATION Discrete random variable X x 1 x 2 x 3 x 6 …etc…. x 5 x 4 xn SAMPLE of size n Pop values Probabilities xi p(xi ) x 1 p(x 1) x 2 p(x 2) x 3 p(x 3) ⋮ ⋮ Total 1 Data values Relative Frequencies xi p(xi ) = fi /n x 1 p(x 1) x 2 p(x 2) x 3 p(x 3) ⋮ ⋮ xk p(xk) Total 1 25
POPULATION Discrete “Density” Pop vals pmf x p (x ) x 1 p(x 1) x 2 p(x 2) x 3 p(x 3) ⋮ ⋮ Total 1 random variable X Probability Histogram p(x) = Probability that the random variable X is equal to a specific value x, i. e. , p(x) = P(X = x) “probability mass function” (pmf) | x X
POPULATION Discrete random variable X Pop vals pmf x p (x ) x 1 p(x 1) F(x 1) = p(x 1) x 2 p(x 2) F(x 2) = p(x 1) + p(x 2) x 3 p(x 3) F(x 3) = p(x 1) + p(x 2) + p(x 3) ⋮ ⋮ ⋮ Total 1 1 increases from 0 to 1 in a “staircase graph” cdf F (x ) = P (X x ) F(x) = Probability that the random variable X is less than or equal to a specific value x, i. e. , F(x) = P(X x) “cumulative distribution function” (cdf) | x X
POPULATION Discrete Pop vals pmf x p (x ) x 1 p(x 1) F(x 1) = p(x 1) x 2 p(x 2) F(x 2) = p(x 1) + p(x 2) x 3 p(x 3) F(x 3) = p(x 1) + p(x 2) + p(x 3) ⋮ ⋮ ⋮ Total 1 increases from 0 to 1 in a “staircase graph” random variable X Calculating “interval probs”… cdf F(b) = P(X b) F(a–) = P(X a–) F(b) – F(a–) = P(X b) – P(X a–) = P(a X b) p(x) | | a–a | b X F (x ) = P (X x )
POPULATION Discrete Pop vals pmf x p (x ) x 1 p(x 1) F(x 1) = p(x 1) x 2 p(x 2) F(x 2) = p(x 1) + p(x 2) x 3 p(x 3) F(x 3) = p(x 1) + p(x 2) + p(x 3) ⋮ ⋮ ⋮ Total 1 increases from 0 to 1 in a “staircase graph” random variable X Calculating “interval probs”… cdf F (x ) = P (X x ) F(b) = P(X b) F(a–) = P(X a–) F(b) – F(a–) = P(X b) – P(X a–) = P(a X b) p(x) | | a–a | b X FUNDAMENTAL THEOREM OF CALCULUS (discrete form)
Example: Roll a biased die once. {1, 2, 3, 4, 5, 6} Sample space Discrete Random Variable X = “Value shown” Method 1 pmf P(X = x) x p (x) 1 0. 20 2 0. 30 3 0. 20 4 0. 15 5 0. 10 6 0. 05 1 0. 30 0. 20 0. 15 0. 10 0. 05 30
Example: Roll a biased die once. {1, 2, 3, 4, 5, 6} Sample space Discrete Random Variable X = “Value shown” Method 2 pmf cdf P(X = x) P(X x) x p (x) F(x) 1 0. 20 2 0. 30 0. 50 3 0. 20 0. 70 4 0. 15 0. 85 5 0. 10 0. 95 6 0. 05 1 1 0. 30 0. 20 0. 15 0. 10 0. 05 31
POPULATION Discrete random variable X Two issues… Pop vals pmf x p (x ) x 1 p(x 1) x 2 p(x 2) x 3 p(x 3) ⋮ ⋮ Total 1 “balance point” • “Measure of Spread” • “Measure of Center” How to define a “typical” population value How to define a “typical” distance of a random population value from this mean Mean (of X): Variance (of X): = “expected value” or “expectation” of X t ou b a re 3. 3. o M in s i th Moreover, we will prove that… Standard deviation (of X):
Example: Roll two dice, independently. Sample space Discrete Random Variable Y = “Sum” pmf x p 1 (x) p 2 (x) 1 0. 20 0. 14 2 0. 30 0. 16 3 0. 20 4 0. 15 0. 20 5 0. 10 0. 16 6 0. 05 0. 14 1 1 0. 20 0. 16 0. 14 {(1, 1), …, (6, 6)}
Example: Roll two dice, independently. Sample space Discrete Random Variable Y = “Sum” pmf x p 1 (x) p 2 (x) 1 0. 20 0. 14 2 0. 30 0. 16 3 0. 20 4 0. 15 0. 20 5 0. 10 0. 16 6 0. 05 0. 14 1 1 0. 30 0. 20 0. 15 0. 10 0. 05 {(1, 1), …, (6, 6)}
Example: Roll two dice, independently. Sample space Discrete Random Variable Y = “Sum” pmf x p 1 (x) p 2 (x) 1 0. 20 0. 14 2 0. 30 0. 16 3 0. 20 4 0. 15 0. 20 5 0. 10 0. 16 6 0. 05 0. 14 1 1 0. 30 0. 20 0. 15 0. 10 0. 05 {(1, 1), …, (6, 6)}
Example: Roll two dice, independently. Sample space Discrete Random Variable Y = “Sum” pmf x p 1 (x) p 2 (x) 1 0. 20 0. 14 2 0. 30 0. 16 3 0. 20 4 0. 15 0. 20 5 0. 10 0. 16 6 0. 05 0. 14 1 1 0. 30 0. 20 0. 15 0. 10 0. 05 {(1, 1), …, (6, 6)}
To summarize… 37
POPULATION Discrete random variable X Probability Table Pop Probabilities xi pmf p(xi ) x 1 p(x 1) x 2 p(x 2) x 3 p(x 3) ⋮ ⋮ Probability Histogram Total Area = 1 X 1 Frequency Table Data xi x 1 x 2 x 3 x 6 …etc…. x 5 xn x 4 SAMPLE of size n Relative Frequencies p(xi ) = fi /n x 1 p(x 1) x 2 p(x 2) x 3 p(x 3) ⋮ ⋮ xk p(xk) 1 Density Histogram Total Area = 1 X 38
POPULATION Continuous Discrete random variable X Probability Table Pop Probabilities xi pmf p(xi ) x 1 p(x 1) x 2 p(x 2) x 3 p(x 3) ⋮ ⋮ 1 Probability Histogram ? Total Area = 1 X Frequency Table Data xi x 1 x 2 x 3 x 6 …etc…. x 5 xn x 4 SAMPLE of size n Relative Frequencies p(xi ) = fi /n x 1 p(x 1) x 2 p(x 2) x 3 p(x 3) ⋮ ⋮ xk p(xk) 1 Density Histogram Total Area = 1 X 39
40
Example: Roll two dice, independently. pmf x p 1 (x) p 2 (x) 1 0. 20 0. 14 2 0. 30 0. 16 y p (y) 2 0. 028 3 0. 074 0. 30 4 0. 116 0. 20 5 0. 153 6 0. 170 3 0. 20 7 0. 169 4 0. 15 0. 20 8 0. 132 5 0. 10 0. 16 9 0. 082 10 0. 047 11 0. 022 12 0. 007 6 0. 05 0. 14 1 1 1 Discrete Random Variable Y = “Sum” 0. 20 0. 16 0. 14 0. 15 0. 10 0. 05 0. 16 0. 14
Example: Roll two dice, independently. y p (y) 2 0. 028 x p 1 (x) p 2 (x) 3 0. 074 1 4 0. 116 5 0. 153 6 0. 170 pmf 0. 20 0. 14 2 0. 30 0. 16 3 0. 20 7 0. 169 4 0. 15 0. 20 8 0. 132 5 0. 10 0. 16 9 0. 082 10 0. 047 11 0. 022 12 0. 007 6 0. 05 0. 14 1 1 1 Discrete Random Variable Y = “Sum” y = 2: 12 p = c(. 028, . 074, . 116, . 153, . 170, . 169, . 132, . 082, . 047, . 022, . 007) mu = sum(y*p) sig. sqd = sum((y-mu)^2 * p) print(c(mu, sig. sqd)) [1] 6. 30 4. 63
Discrete We will formally prove the following… Theorem pmf Special case: X 2 = constant c x p 1 (x) p 2 (x) Theorem
- Slides: 43