850 likes | 861 Views
This lecture explores the concept of discrete random variables, their relationship to events, probability distribution, and properties such as expectation and variance.
E N D
45-733: lecture 3 (chapter 4) Discrete Random Variables William B. Vogt, Carnegie Mellon, 45-733
Random variable • Is a variable which takes on different values, depending on the outcome of an experiment • X= 1 if heads, 0 if tails • Y=1 if male, 0 if female (phone survey) • Z=# of spots on face of thrown die • W=% GDP grows this year • V=hours until light bulb fails William B. Vogt, Carnegie Mellon, 45-733
Random variable • Discrete random variable • Takes on one of a finite (or at least countable) number of different values. • X= 1 if heads, 0 if tails • Y=1 if male, 0 if female (phone survey) • Z=# of spots on face of thrown die William B. Vogt, Carnegie Mellon, 45-733
Random variable • Continuous random variable • Takes on one in an infinite range of different values • W=% GDP grows this year • V=hours until light bulb fails • Particular values of continuous r.v. have 0 probability • Ranges of values have a probability William B. Vogt, Carnegie Mellon, 45-733
Random variable • Relationship to events • You can think of random variables as assigning a numerical value to events • For example, say there is an event A and another event B: William B. Vogt, Carnegie Mellon, 45-733
Random variable • Relationship to events X=1 X=2 William B. Vogt, Carnegie Mellon, 45-733
Random variable • Relationship to events • We randomly select a car in the US. A is the event “red car” • X=1 if red and X=2 if not red • P(“red car”) = P(X=1) William B. Vogt, Carnegie Mellon, 45-733
Random variable • Relationship to events William B. Vogt, Carnegie Mellon, 45-733
Random variable • Relationship to events X=1 X=2 X=3 X=4 A B William B. Vogt, Carnegie Mellon, 45-733
Random variable • Relationship to events • A = “red car” • B = “two-seater” William B. Vogt, Carnegie Mellon, 45-733
Random variable • Relationship to events • A = “red car” • B = “two-seater” William B. Vogt, Carnegie Mellon, 45-733
Probability Distribution • The probability distribution is a complete probabilistic description of a random variable • All other statistical concepts (expectation, variance, etc) are derived from it • Once we know the probability distribution of a random variable, we know everything we can learn about it from statistics William B. Vogt, Carnegie Mellon, 45-733
Probability Distribution • Probability function • One form the probability distribution of a discrete random variable may be expressed in • Expresses the probability that X takes the value x as a function of x: William B. Vogt, Carnegie Mellon, 45-733
Probability Distribution • The probability function • May be tabular: William B. Vogt, Carnegie Mellon, 45-733
Probability Distribution • The probability function • May be graphical: .50 .33 .17 1 2 3 William B. Vogt, Carnegie Mellon, 45-733
Probability Distribution • The probability function • May be formulaic: William B. Vogt, Carnegie Mellon, 45-733
Probability Distribution • The probability function • Another example, rolling a fair die William B. Vogt, Carnegie Mellon, 45-733
Probability Distribution • The probability function • Another example, rolling a fair die .50 .33 .17 1 2 3 4 5 6 William B. Vogt, Carnegie Mellon, 45-733
Probability Distribution • The probability function, properties William B. Vogt, Carnegie Mellon, 45-733
Probability Distribution • Cumulative probability distribution • The cdf is a function which describes the probability that a random variable does not exceed a value William B. Vogt, Carnegie Mellon, 45-733
Probability Distribution • Cumulative probability distribution • The relationship between the cdf and the probability function: William B. Vogt, Carnegie Mellon, 45-733
Probability Distribution • The cumulative distribution function • May be tabular (die-throwing): William B. Vogt, Carnegie Mellon, 45-733
Probability Distribution • The cumulative distribution function • May be graphical (die-throwing): 1 1 2 3 4 5 6 William B. Vogt, Carnegie Mellon, 45-733
Probability Distribution • The cumulative distribution function • May be formulaic (die-throwing): William B. Vogt, Carnegie Mellon, 45-733
Probability Distribution • The cdf, properties William B. Vogt, Carnegie Mellon, 45-733
Expectation • The expectation of a random variable is just its “average” or “expected” level • This is a measure of central tendency, but for random variables instead of datasets • It is calculated in the natural way: Each value a random variable may take is weighted by the probability of it taking that value William B. Vogt, Carnegie Mellon, 45-733
Expectation • Each value a random variable may take is weighted by the probability of it taking that value William B. Vogt, Carnegie Mellon, 45-733
Expectation • Example, die throw William B. Vogt, Carnegie Mellon, 45-733
Expectation • Another example William B. Vogt, Carnegie Mellon, 45-733
Variance • The variance of a random variable is its expected squared deviation from its mean. • A measure of dispersion for random variables • Similar to the measure of dispersion of the same name for datasets • Is calculated in the natural way: Each value a random variable could take is subtracted from its expectation, squared, and weighted by its probability of occurrence William B. Vogt, Carnegie Mellon, 45-733
Variance • Each value a random variable could take is subtracted from its expectation, squared, and weighted by its probability of occurrence William B. Vogt, Carnegie Mellon, 45-733
x x-E(X) (x-E(X))2 P(X=x) Product 1 -2.5 6.25 1/6 1.042 2 -1.5 2.25 1/6 0.375 3 -0.5 0.25 1/6 0.042 4 0.5 0.25 1/6 0.042 5 1.5 2.25 1/6 0.375 6 2.5 6.25 1/6 1.042 Tot 2.918 Variance • Example, die throw William B. Vogt, Carnegie Mellon, 45-733
Variance • Alternative Formula William B. Vogt, Carnegie Mellon, 45-733
x x2 P(X=x) Product 1 1 1/6 1/6 2 4 1/6 2/3 3 9 1/6 1 ½ 4 16 1/6 2 2/3 5 25 1/6 4 1/3 6 36 1/6 6 Tot 15 1/6 Variance • Example, die throw William B. Vogt, Carnegie Mellon, 45-733
Variance • Example, die throw William B. Vogt, Carnegie Mellon, 45-733
Variance • Standard deviation: as in the case of describing data, it is easier to work in standard deviations William B. Vogt, Carnegie Mellon, 45-733
Functions of a random variable • It is possible to calculate expectations and variances of functions of random variables William B. Vogt, Carnegie Mellon, 45-733
Functions of a random variable • Example • You are paid a number of dollars equal to the square root of the number of spots on a die • What is a fair bet to get into this game? William B. Vogt, Carnegie Mellon, 45-733
x P(X=x) Product 1 1 1/6 0.167 2 1.414 1/6 0.236 3 1.732 1/6 0.289 4 2 1/6 0.333 5 2.231 1/6 0.372 6 2.449 1/6 0.408 Tot 1.804 Functions of a random variable • Example William B. Vogt, Carnegie Mellon, 45-733
Functions of a random variable • Linear functions • If a and b are constants and X is a random variable William B. Vogt, Carnegie Mellon, 45-733
Functions of a random variable • Linear functions • Example • Salesman paid salary of $25K plus a commission of 10% • Mean and standard deviation of sales are $200K and $50K, respectively • What is the mean and standard deviation of salary? William B. Vogt, Carnegie Mellon, 45-733
Functions of a random variable • Linear functions • Example William B. Vogt, Carnegie Mellon, 45-733
Functions of a random variable • Linear functions • Using Tchebychev’s Rule, the salesman can be 75% sure that his pay will be between $35K and $55K • Or, he can be 89% sure that his pay will be between $30K and $60K William B. Vogt, Carnegie Mellon, 45-733
Joint Distributions • A joint distribution is a way of (completely) describing two random variables. • The first r.v.’s distribution is described • The second r.v.’s distribution is described • The relationship between the two r.v.’s is described William B. Vogt, Carnegie Mellon, 45-733
Joint Distributions • Consider two discrete random variables, X, Y. • The joint probability function • Gives the probability of each possible pair of values of X and Y • Expresses the probability that both X=x and Y=y simultaneously William B. Vogt, Carnegie Mellon, 45-733
Joint Distributions • The joint probability function William B. Vogt, Carnegie Mellon, 45-733
Joint Distributions • The joint probability function • Properties William B. Vogt, Carnegie Mellon, 45-733
X 0 1 Y 0 0.87 0.10 1 0.02 0.01 Joint Distributions • The joint probability function • Example • X=1 for “red car”, 0 otherwise • Y=1 for “two-seater”, 0 otherwise William B. Vogt, Carnegie Mellon, 45-733
Joint distributions • Relationship to events • A = “red car” • B = “two-seater” William B. Vogt, Carnegie Mellon, 45-733
Joint distributions • Relationship to events 0.10 0.01 0.87 0.02 A X=1 B Y=1 William B. Vogt, Carnegie Mellon, 45-733