25
Random Variables Probability distribution functions Expected values

Random Variables Probability distribution functions Expected values

Embed Size (px)

DESCRIPTION

Examples Flip a coin thrice. –Could define the following random variable: –X = #H in the three flips –X can assume the values 0, 1, 2, 3 Roll two dice –X = sum of the two faces showing up –X = 2, 3, 4, …, 12 –Y = 1 if sum > 7, Y = 0 if sum ≤ 7. Note: a r.v. properly defined assigns a numerical value to each outcome of S

Citation preview

Page 1: Random Variables Probability distribution functions Expected values

Random Variables

•Probability distribution functions•Expected values

Page 2: Random Variables Probability distribution functions Expected values

Random variables (r.v.)• Random variables assign numbers to

outcomes of a random experiment– Outcomes of the random experiments can

already be numbers or non-numeric.• Why defining random variables?

– It simplifies our way to get to a mathematical model for real life.

• They are usually indicated with the last letters of the alphabet: X, Y, ..

Page 3: Random Variables Probability distribution functions Expected values

Examples

• Flip a coin thrice.– Could define the following random variable:– X = #H in the three flips– X can assume the values 0, 1, 2, 3

• Roll two dice– X = sum of the two faces showing up– X = 2, 3, 4, … , 12– Y = 1 if sum > 7, Y = 0 if sum ≤ 7.

Note: a r.v. properly defined assigns a numerical value to each outcome of S

Page 4: Random Variables Probability distribution functions Expected values

Discrete Random variables

• A random variable is discrete if all its possible outcomes can be counted.– # H in flipping the coin thrice– Number of children in a family– Number of stars in a galaxy(?)

• Will concentrate on these first

Page 5: Random Variables Probability distribution functions Expected values

How do I assign probabilities to r.v.?

• The outcome of a r.v. depends on the outcome of the experiment on which the random variable is defined.

• For each value (outcome) of the r.v. add the probabilities of the corresponding outcomes in the random experiment on which the r.v. is defined.

Page 6: Random Variables Probability distribution functions Expected values

Flip a Coin Three Times

• Outcomes:HHH HHT HTH HTT THH THT TTH TTT

X = number of HeadsP(X = 3) = 1/8P(X = 2) = 3/8P(X = 1) = 3/8P(X = 0) = 1/8

Page 7: Random Variables Probability distribution functions Expected values

Random Variable• Each outcome is a number

• Name it X• P( X = 1 ) = .2,• P( X = 2 ) = .6,…

1 2 3P .2 .6 .2

X= 1 2 3P .2 .6 .2

Page 8: Random Variables Probability distribution functions Expected values

Probability distribution function• pdf• Table

k 0 1 2 3

P(X=k) 1/8 3/8 3/8 1/8

1.Prob.’s add up to 1.

2.0 ≤ P(X=k) ≤ 1 for every k.

3.Other #’s have prob. = 0

Page 9: Random Variables Probability distribution functions Expected values

Roll Two Dice• Outcomes:

(1,1) (1,2) (1,3) (1,4) (1,5) (1,6)(2,1) (2,2) (2,3) (2,4) (2,5) (2,6)

(3,1) (3,2) (3,3) (3,4) (3,5) (3,6)

(4,1) (4,2) (4,3) (4,4) (4,5) (4,6)

(5,1) (5,2) (5,3) (5,4) (5,5) (5,6)

(6,1) (6,2) (6,3) (6,4) (6,5) (6,6)pdf

X = sum of the two rolls

Page 10: Random Variables Probability distribution functions Expected values
Page 11: Random Variables Probability distribution functions Expected values

Examplek 2 3 4 5 6 7

P(X=k) 0.1 0.1 0.3 0.3 0.1 0.1

P(X < 3) = P(X=2) = 0.1

P(X ≤ 3) = P(X=2) + P(X=3) = 0.1+ 0.1= 0.2

Cumulative distribution function (CDF)

P(X ≤ k) = sum of all probabilities up to k

Page 12: Random Variables Probability distribution functions Expected values

P(X > 4) = P(X=5) + P(X=6) + P(X=7) = 0.5

= 1 – P(X ≤ 4)

P(3 < X ≤ 6) = P(X=4) + P(X=5) + P(X=6) = 0.7

= P(X ≤ 6) – P(X ≤ 3)

P(X=3 OR X=6) = P(X=3) + P(X=6) = 0.2

X=j and X=k are MUTUALLY EXCLUSIVE

Example - continues

Page 13: Random Variables Probability distribution functions Expected values

Score on the Quiz

• Probability of scoring better than 50% is• P(X >50) = P(X= 60) + P(X=80) + P(X=100)

= .15 + .3 + .4= .85

Score 20 40 60 80 100

P .1 .05 .15 .3 .4

Page 14: Random Variables Probability distribution functions Expected values

Background: Sigma Notation

• A short hand for writing long sums

Page 15: Random Variables Probability distribution functions Expected values

Expected Value

• Mean of X over the long run

• Equivalent notationBoth refer to the possible values (outcomes) of the r.v.

Page 16: Random Variables Probability distribution functions Expected values

Examples

k 2 5P(X=k) 1/3 2/3

E(X) = 2 P(X=2) + 5 P(X=5)

= 2(1/3) + 5(2/3)

= 2/3 + 10/3

=12/3 = 4

Page 17: Random Variables Probability distribution functions Expected values

k 2 5P(X=k) 1/3 2/3

Page 18: Random Variables Probability distribution functions Expected values

Deal or No Deal

Banker’s Offer = $138,000

Page 19: Random Variables Probability distribution functions Expected values

Who wants to be a Millionaire?

• Quit = $100,000.• Guess right X= $250,000.• Guess wrong X= $32,000.

• P(Right = ¼)E(X) = 250(¼) + 32(¾) = $86,500

• P(Right = ½)E(X) = 250(½) + 32(½) = $141,000

Page 20: Random Variables Probability distribution functions Expected values

Expected Quiz Score

• E(X) = 20(.1) + 40(.05) + 60(.15) + 80(.3) + 100(.4)

= 2 + 2 + 9 + 24 + 40= 77

Score 20 40 60 80 100

P .1 .05 .15 .3 .4

Page 21: Random Variables Probability distribution functions Expected values

Properties of E(X)For any two random variables, X, Y

E(X+Y) = E(X) + E(Y)

For any constants a, b such that Y = a+bX

E(Y) = a + b E(X)

Page 22: Random Variables Probability distribution functions Expected values

E(X+Y) = E(X) + E(Y) (Linearity)

• An exam is composed by five questions. Each question has four (given) possible answers, only one of which is correct.

• A correct anwer is worth 20 points while an incorrect answer gets -4 points.

• No penalties are given for no answer.• If a student answers at random at all

questions what’s he/she’s expected score?

Page 23: Random Variables Probability distribution functions Expected values

SolutionEach question can be modeled with a random variable X with values:

–X = 20 if answer is correct–X = -4 if answer is not correct

If a student answers at random:P(X = 20) = ¼ and P(X = - 4) = ¾E(X) = 20∙ ¼ + (-4) ¾ = 2

Page 24: Random Variables Probability distribution functions Expected values

• If we assign a r.v. to any of the 5 questions of the exam, say X1, … , X5

• Expected scoreE(X1+X2+X3+X4+X5) = = E(X1)+E(X2)+E(X3)+E(X4)+E(X5) = 2 + 2 + 2 + 2 + 2 =10

Page 25: Random Variables Probability distribution functions Expected values

Linear combinations• What’s Y = a + b X?• Mathematically a linear combination• From a practical point of view it could be a

change of the unit of measurement• X degrees in Celsius, Y degrees in Fahrenheit

Y = 32 + 1.8 ∙ X (a=32, b=1.8)• X = feet, Y = inches

Y = 12 ∙ X (a=0, b=12)