Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Random variables and probability distributions.

Similar presentations


Presentation on theme: "1 Random variables and probability distributions."— Presentation transcript:

1 1 Random variables and probability distributions

2 2 Random variables are a key concept for statistical inference We know that in order to use results from a sample to infer about a larger population, we must avoid bias and chose a sample at random. If our sample is random, then the sample mean, the sample proportion, and other statistics that we calculate from the sample are called: random variables. The behavior of such variables is an essential step on the way to performing statistical inference.

3 3 Random variables A random variable X associates a numerical value with each elementary outcome of an experiment Example Let X be the number of boys born in a family of 2 children. List the possible values of X X =1 means that there is one boy in the family 2 children in the family X – number of boys BB2 BG1 GB1 GG0

4 4 Probability distribution of discrete variables In order to understand the pattern of behavior of a random variable, we need to know its possible values and how likely they are to occur. The probability distribution of a discrete random variable X is a list of the distinct numerical values of X, along with their associated probabilities. X x 1 x 2 x 3 …… x k Probability p 1 p 2 p 3 …… p k 0≤p i ≤1 i=1,…,k p 1 +p 2 +…+p k =1

5 5 Example If X represents the number of boys in a family of 2 children, find the probability distribution of X. The probability of BB is: p(first is a boy and second is a boy) = p(first is a boy)× p(second is a boy)=0.5×0.5=0.25 P(BG)= P(GB)= P(GG)= Family with 2 childrenX – number of boysProbability BB2 BG1 GB1 GG0 Since the 2 events are independent 0.25 Family with 2 childrenX – number of boysProbability BB20.25 BG10.25 GB10.25 GG00.25

6 6 Example - continued Now we can specify the probability of each value of X Family with 2 childrenX – number of boysProbability BB20.25 BG10.25 GB10.25 GG00.25 Value of XProbability 00.25 10.25+0.25=0.5 20.25

7 7 Notations for random variables We denote the random variable by uppercase letters (e.g., X,V,Z ) We denote the values that the random variable gets by lowercase letters (e.g., x i, v i, z i ). The probability that a random variable X get a certain value x is denoted by: p(X=x i ), or, in short, p(x i ). For example Value of X P(x i ) 00.25 10.5 20.25 P(X=0)=0.25  P(X=1)=0.5 P(X=2)=0.25 Remember that the sum of the probabilities must equal 1!!!

8 8 Example A probability distribution is given in the accompanying table with the additional information that the even values of X are equally likely. Determine the missing entries of the table. Value of XP(x) 10.2 2 3 4 50.3 6 Answer: The sum of the probabilities in the table: 0.2+0.2+0.3=0.7 The remaining 0.3 probability is equally divided between the values 2,4,and 6 0.1

9 9 Example Here is the probability distribution p(x) for grade X of a randomly chosen student from a certain class. X =0 represents an F, X =4 represents an A. Xp(x) (F)00.08 (D)10.06 (C)20.24 (B)30.36 (A)40.26 1. What is the probability of getting at least a B? 2. What is the probability of getting higher than a D? 3. What is the probability of getting less than a C? 4. What is the probability of getting no better than a B? 1. 2. 3. 4.

10 10 Probability histogram A probability histogram serves as a display of a probability distribution Example Number of boys is a family of 2 children XP(x) 00.25 10.5 20.25

11 11 Example - rolling two dice: X=sum of two dice X=2,3,4,5,6,7,8,9,10,11,12 Outcome of 2 diceXProbability (1,1)2 3 4 5 6 7 8 9 10 11 12 Outcome of 2 diceXProbability (1,1)2 (1,2) (2,1)3 4 5 6 7 8 9 10 11 12 Outcome of 2 diceXProbability (1,1)2 (1,2) (2,1)3 (1,3) (2,2) (3,1)4 5 6 7 8 9 10 11 12 Outcome of 2 diceXProbability (1,1)2 (1,2) (2,1)3 (1,3) (2,2) (3,1)4 (1,4) (2,3) (3,2) (4,1)5 6 7 8 9 10 11 12 Outcome of 2 diceXProbability (1,1)2 (1,2) (2,1)3 (1,3) (2,2) (3,1)4 (1,4) (2,3) (3,2) (4,1)5 (1,5) (2,4) (3,3) (4,2) (5,1)6 7 8 9 10 11 12 Outcome of 2 diceXProbability (1,1)2 (1,2) (2,1)3 (1,3) (2,2) (3,1)4 (1,4) (2,3) (3,2) (4,1)5 (1,5) (2,4) (3,3) (4,2) (5,1)6 (1,6) (2,5) (3,4) (4,3) (5,2) (6,1)7 8 9 10 11 12 Outcome of 2 diceXProbability (1,1)2 (1,2) (2,1)3 (1,3) (2,2) (3,1)4 (1,4) (2,3) (3,2) (4,1)5 (1,5) (2,4) (3,3) (4,2) (5,1)6 (1,6) (2,5) (3,4) (4,3) (5,2) (6,1)7 (2,6) (3,5) (4,4) (5,3) (6,2)8 9 10 11 12 Outcome of 2 diceXProbability (1,1)2 (1,2) (2,1)3 (1,3) (2,2) (3,1)4 (1,4) (2,3) (3,2) (4,1)5 (1,5) (2,4) (3,3) (4,2) (5,1)6 (1,6) (2,5) (3,4) (4,3) (5,2) (6,1)7 (2,6) (3,5) (4,4) (5,3) (6,2)8 (3,6) (4,5) (5,4) (6,3)9 10 11 12 Outcome of 2 diceXProbability (1,1)2 (1,2) (2,1)3 (1,3) (2,2) (3,1)4 (1,4) (2,3) (3,2) (4,1)5 (1,5) (2,4) (3,3) (4,2) (5,1)6 (1,6) (2,5) (3,4) (4,3) (5,2) (6,1)7 (2,6) (3,5) (4,4) (5,3) (6,2)8 (3,6) (4,5) (5,4) (6,3)9 (4,6) (5,5) (6,4)10 11 12 Outcome of 2 diceXProbability (1,1)2 (1,2) (2,1)3 (1,3) (2,2) (3,1)4 (1,4) (2,3) (3,2) (4,1)5 (1,5) (2,4) (3,3) (4,2) (5,1)6 (1,6) (2,5) (3,4) (4,3) (5,2) (6,1)7 (2,6) (3,5) (4,4) (5,3) (6,2)8 (3,6) (4,5) (5,4) (6,3)9 (4,6) (5,5) (6,4)10 (5,6) (6,5)11 12 Outcome of 2 diceXProbability (1,1)2 (1,2) (2,1)3 (1,3) (2,2) (3,1)4 (1,4) (2,3) (3,2) (4,1)5 (1,5) (2,4) (3,3) (4,2) (5,1)6 (1,6) (2,5) (3,4) (4,3) (5,2) (6,1)7 (2,6) (3,5) (4,4) (5,3) (6,2)8 (3,6) (4,5) (5,4) (6,3)9 (4,6) (5,5) (6,4)10 (5,6) (6,5)11 (6,6)12 1/36 2/36 3/36 4/36 5/36 6/36 5/36 4/36 3/36 2/36 1/36

12 12 Probability histogram

13 13 Roll a die and let X denote the outcome 1.p(X≤2)= 2.p(X<3)= 3.p(2≤X≤4)= 4.p(X>1)= 5.p(X≤6)= Example Consider an unbalanced die with the following probabilities: Value of XProbability 11/6 2 3 41/12 5 62/6 Roll a die and let X denote the outcome 1.p(X≤2)=p(X=1)+p(X=2)=1/6+1/6=1/3 2.p(X<3)= p(X=1)+p(X=2)=1/6+1/6=1/3 3.p(2≤X≤4)=p(X=2)+p(X=3)+p(X=4)=1/6+1/6+1/12=5/12 4.p(X>1)=1-p(X=1)=1-1/6=5/6 5.p(X≤6)=sum of all probabilities =1

14 14 Mean and standard deviation of a random variable

15 15 Mean of a random variable The mean of a list of numbers is their average The mean of a rv X is a weighted average of the possible values of X. Example – household size in the U.S X 1 2 3 4 5 6 7 Probability.251.321.171.154.067.022.014 Mean of X= =(1)(.251)+(2)(.321)+(3)(.171) +(4)(.154) +(5)(.067) +(6)(.022) +(7)(.014)= =2.587 X

16 16 X x 1 x 2 x 3 …… x k Probability p 1 p 2 p 3 …… p k μ X = E(X) = x 1 p 1 +x 2 p 2 +……+x k p k = Mean = expected value Mean of a random variable

17 17 Example Roll a die once and let X denote the outcome: Value of XProbability 11/6 2 3 4 5 6 Calculate the mean outcome of the die: E(X)=μ X = =(1)(1/6)+(2)(1/6)+(3)(1/6)+(4)(1/6)+(5)(1/6)+(6)(1/6)=3.5

18 18 Standard deviation of a random variable We saw that we can describe a probability distribution by a probability histogram. For the dice example we had: In addition of the mean we need a measure of the spread. - variance of a random variable X - standard deviation of a random variable X

19 19 Standard deviation of a random variable Weighted average of the squared deviations of the rv X from its mean μ X. X x 1 x 2 x 3 …… x k Probability p 1 p 2 p 3 …… p k = (x 1 - μ X ) 2 P 1 +(x 2 - μ X ) 2 P 2 +……+(x k - μ X ) 2 P k = = Σ (x i - μ X ) 2 P i i=1 k

20 20 In the 2 dice example: μ X =2(1/36)+3(2/36)+4(3/36)+5(4/36)+6(5/36)+7(6/36)+ +8(5/36)+9(4/36)+ 10(3/36)+11(2/36)+12(1/36)=7 = Var(X)=(2-7) 2 (1/36)+(3-7) 2 (2/36)+ (4-7) 2 (3/36) +(5- 7) 2 (4/36) +(6-7) 2 (5/36) +(7-7) 2 (6/36)+(8-7) 2 (5/36) +(9- 7) 2 (4/36)+ (10-7) 2 (3/36)+(11-7) 2 (2/36)+(12- 7) 2 (1/36)=5.8333 = SD(X)=2.415 Outcome of 2 diceXProbability (1,1)21/36 (1,2) (2,1)32/36 (1,3) (2,2) (3,1)43/36 (1,4) (2,3) (3,2) (4,1)54/36 (1,5) (2,4) (3,3) (4,2) (5,1)65/36 (1,6) (2,5) (3,4) (4,3) (5,2) (6,1)76/36 (2,6) (3,5) (4,4) (5,3) (6,2)85/36 (3,6) (4,5) (5,4) (6,3)94/36 (4,6) (5,5) (6,4)103/36 (5,6) (6,5)112/36 (6,6)121/36

21 21 Question At a news stand, the daily number X of requests for a certain out- of-town newspaper has the following probability distribution: Number 0 1 2 3 Probability.1.1.5.3 (i) What kind of random variable is X? discrete/continuous (ii) What is the probability of fewer than 2 requests? p(X<2)=p(X=1)+p(X=0)=0.1+0.1=0.2 (iii) What is the expected number of requests? E(X)= μ X =0(.1)+1(.1)+2(.5)+3(.3)=2 (iv) What is the standard deviation of number of requests? SD(x)=(0-2) 2 (.1) + (1-2) 2 (.1) + (2-2) 2 (.5) + (3-2) 2 (.3)=√.8=.894 (v) What is the shape of the distribution of requests? left skewed / symmetric / right skewed 0 1 2 3.5.4.3.2.1


Download ppt "1 Random variables and probability distributions."

Similar presentations


Ads by Google