Statistics for Business and Economics: Random Variables (1) STT 315: Section 201 Instructor: Abdhi Sarkar Acknowledgement: I d like to thank Dr. Ashoke Sinha for allowing me to use and edit the slides.
Random Variable A random variableis a numerical variable, values of which are associated to outcome(s) of some random experiment. This means that the values of random variable depends on chance. We usually denote them by capital letters like X, Y, Z etc. Example: Suppose you toss a fair coin twice. Let X = the number of heads out of these two tosses. Then X is a variable which takes the values 0, 1, 2 but the value depends on the outcome of two tosses, which is a random event. Therefore, X is a random variable. 2
Two Types of Random Variables Discrete Random Variable: These random variables can assume countable number of values. (e.g. number of heads out of two tosses of a fair coin this random variable can only take values 0, 1, 2.) Continuous Random Variables: These random variables can assume any value contained in one or more intervals. (e.g. total amount of rainfall (in inches) in East Lansing in 2011.) We first discuss some discrete random variables, and consider some continuous random variables later. 3
Probability distributions of discrete random variables 4
Example X = number of heads in two tosses of a fair coin. X takes values 0, 1, 2. Outcome of the tosses Value of X Probability TT 0 ¼ TH 1 ¼ HT 1 ¼ HH 2 ¼ So, P(X=0) = ¼, P(X=1) = ¼+¼ = ½, P(X=2) = ¼. We denote p(x) = P(X=x). x p(x) 0 ¼ 1 ½ 2 ¼ 5
Probability distribution function Consider a discrete random variable X and define the function: = =. is called the probability distribution function of X. satisfies the following two properties: 1. 0 () 1,for any real number. 2. =1. 6
Another Example X = number of tails in three tosses of a fair coin. X takes values 0, 1, 2, 3. Outcome of the tosses Value of X Probability HHH 0 ⅛ HHT 1 ⅛ HTH 1 ⅛ THH 1 ⅛ HTT 2 ⅛ THT 2 ⅛ TTH 2 ⅛ TTT 3 ⅛ 7
Another Example Hence P(X=0) = ⅛, P(X=1) = ⅛ +⅛+⅛= ⅜, P(X=2) = ⅛ + ⅛+ ⅛ = ⅜, and P(X=3) = ⅛. x p(x) 0 ⅛ 1 ⅜ 2 ⅜ 3 ⅛ 8
Insurance Example Suppose the death rate in a year is 1 out of every 1000 people, and another 2 out of 1000 suffer some kind of disability. Suppose that an insurance company has to pay $10000 for death and $5000 for disability. Define X = amount (in dollars) the insurance company has to pay for one policyholder in a year. X takes values 10000, 5000, 0. Policyholder Outcome Payout (x) Probability p(x) Death 10000 1/1000 = 0.001 Disability 5000 2/1000 = 0.002 Neither 0 1-(0.001+0.002) = 0.997 9
Expected Value For a discrete random variable X, the expected value of X(or expectation of X) is defined as the sum of the terms value times probability. = = sum over (value probability). Suppose Xtakes values x 1, x 2,, x n with probabilities p(x 1 ), p(x 2 ),, p(x n )respectively. Then = + + +. Often E(X) is also called mean of random variable X, and is denoted by Greek letter µ. Roughly speaking, E(X) denotes the value you can expect Xto take on the average. 10
Insurance Example (revisited) Suppose the death rate in a year is 1 out of every 1000 people, and another 2 out of 1000 suffer some kind of disability. Suppose that an insurance company has to pay $10000 for death and $5000 for disability. Define X = amount (in dollars) the insurance company has to pay for one policyholder in a year. Then E(X) is computed as follows: Policyholder Outcome Payout (x) Probability p(x) xp(x) Death 10000 0.001 10000 0.001 = 10 Disability 5000 0.002 5000 0.002 = 10 Neither 0 0.997 0 0.997 = 0 [Summing] E(X) = 20 11
Tossing Coin Thrice Example (revisited) X = number of tails in three tosses of a fair coin. Then E(X)is computed as follows: x p(x) xp(x) 0 ⅛ 0 ⅛ = 0 1 ⅜ 1 ⅜ = 0.375 2 ⅜ 2 ⅜ = 0.75 3 ⅛ 3 ⅛ = 0.375 E(X) = 1.5 On the average, you can expect 1.5 tails out of 3 tosses of a fair coin. 12
Variance and Standard Deviation Varianceof a random variable Xis defined by =()= () Standard deviationof Xis the square-root of the variance of X = = (). If many random variables are involved we may write ()or to identify. Variance has the square unit of the random variable, whereas the standard deviation has the same unit as the random variable.. 13
Tossing Coin Thrice Example (revisited) X = number of tails in three tosses of a fair coin. Then var(x) is computed as follows: x p(x) xp(x) [x µ] 2 p(x) 0 ⅛ 0 ⅛ = 0 (0-1.5) 2 ⅛ = 0.28125 1 ⅜ 1 ⅜ = 0.375 (1-1.5) 2 ⅜ = 0.09375 2 ⅜ 2 ⅜ = 0.75 (2-1.5) 2 ⅜ = 0.09375 3 ⅛ 3 ⅛ = 0.375 (3-1.5) 2 ⅛ = 0.28125 µ=e(x) = 1.5 σ 2 = 0.75 Standard deviation: σ = 0.75 = 0.866. 14
TI 83/84 Plus commands We can use TI 83/84 to compute mean and standard deviation of a discrete random variable. Press [STAT]. Under EDITselect 1: Editand press ENTER. Columns with names L1, L2 etc. will appear. Type the values of random variable X under the column L1and the values of p(x) under the column L2. Press [STAT] and choose CALCat the top. Then select 1: 1-Var Statsand press ENTER and 1- Var Statswill appear on the screen. Press [2nd]& 1 (to get L1), then press,(comma) and then press [2nd]& 2 (to get L2). Then press ENTER. We shall be needing mean ( ), standard deviation (σx). 15
Properties: Expectation and Variance Expectation is the center of the probability distribution of a random variable. Variance and standard deviations are measures of spread of the probability distribution of a random variable. Larger the variance/standard deviation, larger the spread (or dispersion). For any real numbers aand b a) +# = +#. b) +# =. The Chebyshevand empirical rules are also valid involving mean µ and standard deviation σ. 16
An example: A Gambling Game In a casino, you can play the following game: if you pay $10, the game-manager will toss a fair coin 3 times. You will earn $5 for every tail and nothing for the head(s). What is your expected profit/loss from this game? Is it wise to play this game over and over again? Let X = the number of tails out of 3 tosses of a fair coin, and Y = your profit (in dollars) from this game. Then you will pay $10 and make $5X, and therefore, Y = 5X - 10. From our previous calculation: =1.5, =0.866. Your expected profit: E(Y) = E(5X - 10) = 5E(X) - 10 = (5 1.5) - 10 = -2.5. It is not wise to play this game because on the average, you are expected to lose $2.5 per game. 17
An example: A Gambling Game In a casino, you can play the following game: if you pay $10, the game-manager will toss a fair coin 3 times. You will earn $5 for every tail and nothing for the head(s). What is the variance of your profit from this game? What is the standard deviation of your profit from this game? As we have seen your profit (in dollars) from this game is Your expected profit: Y = 5X - 10. E(Y) = E(5X - 10) = 5E(X) - 10 = (5 1.5) - 10 = -2.5. So standard deviation of your profit: σ(y) = σ(5x - 10) = 5σ(X) = 5 0.866 = 4.33, and variance is σ 2 (Y) = (4.33) 2 = 18.75. 18