2.2 - Expectation 2.3 - Mean, Variance, Standard Deviation€¦ · 1 STAT 400 UIUC 2.1 - Random...

8
1 STAT 400 UIUC 2.1 - Random Variables (Discrete) 2.2 - Expectation 2.3 - Mean, Variance, Standard Deviation Stepanov Dalpiaz Nguyen A random variable associates a numerical value with each outcome of a random experiment. A random variable is said to be discrete if it has either a finite number of values or infinitely many values that can be arranged in a sequence. If a random variable represents some measurement on a continuous scale and therefore, capable of assuming all values in an interval, it is called a continuous random variable. The probability distribution of a discrete random variable is a list of all its distinct numerical values along with their associated probabilities: x f ( x ) x 1 x 2 x 3 × × × x n f ( x 1 ) f ( x 2 ) f ( x 3 ) × × × f ( x n ) ! ! 1) for each x, 0 £ f ( x ) £ 1. 2) = 1. 1.00 Often a formula can be used in place of a detailed list. Example 1: A balanced (fair) coin is tossed twice. x f ( x ) Let X denote the number of H's. Construct the probability distribution of X. å x f x all ) ( function coin 5- EH , T } X = # of hea 'd X ( H ) = I XCT ) = O X = { I , O } the prob . dist. of discrete RV is called the probability conditions that pmf mass function Note: have to satisfy : - ( pmf ) Random variable X A possible outcome X 3) ICXE A) = E f ( x ) that X can take X EA tf A ES . g small X g small X °7 ) o ' O S - - f HH , HT , TH , TT } HT . TH I I. It I - I = I X - - f 2 , I , O } HH s ' z - I = 4 Now , let's say ICH ) = 0.3 , ICT ) = 0.7 - x I ( 0.3 ) ( 0.7 ) t (0.7-710.3)=0.42 ( O . 3) ( 0.3 ) = O . Og } = I

Transcript of 2.2 - Expectation 2.3 - Mean, Variance, Standard Deviation€¦ · 1 STAT 400 UIUC 2.1 - Random...

Page 1: 2.2 - Expectation 2.3 - Mean, Variance, Standard Deviation€¦ · 1 STAT 400 UIUC 2.1 - Random Variables (Discrete) 2.2 - Expectation 2.3 - Mean, Variance, Standard Deviation Stepanov

1

STAT 400 UIUC

2.1 - Random Variables (Discrete) 2.2 - Expectation

2.3 - Mean, Variance, Standard Deviation

Stepanov Dalpiaz Nguyen

A random variable associates a numerical value with each outcome of a random experiment. A random variable is said to be discrete if it has either a finite number of values or infinitely many values that can be arranged in a sequence. If a random variable represents some measurement on a continuous scale and therefore, capable of assuming all values in an interval, it is called a continuous random variable. The probability distribution of a discrete random variable is a list of all its distinct numerical values along with their associated probabilities: x f ( x ) x 1

x 2 x 3 × × ×

x n

f ( x 1 ) f ( x 2 ) f ( x 3 )

× × ×

f ( x n )

!

!

1) for each x,

0 £ f ( x ) £ 1.

2) = 1.

1.00 Often a formula can be used in place of a detailed list. Example 1: A balanced (fair) coin is tossed twice.

x f ( x )

Let X denote the number of H's. Construct the probability distribution of X.

åxf x

all ) (

→ function coin

5- EH, T} X = # of hea'd X (H) = I XCT) = O

X = { I , O }

the prob. dist. of discrete RVis called the probability

conditions that pmf mass function .

Note: have to satisfy :-

( pmf)Randomvariable

X

A possibleoutcome

X

3) ICXE A) = E f (x)that X can takeX EA

tf A ES .

gsmall X

gsmall X

°7) o'

OS -- f HH, HT, TH, TT} HT.TH I I. It I - I = I

X -- f 2, I, O }

HH s 'z

- I = ①4Now,let's say ICH) = 0.3

, ICT) = 0.7 -x I

(0.3) (0.7) t (0.7-710.3)=0.42(O. 3) (0.3) = O. Og

} = I

Page 2: 2.2 - Expectation 2.3 - Mean, Variance, Standard Deviation€¦ · 1 STAT 400 UIUC 2.1 - Random Variables (Discrete) 2.2 - Expectation 2.3 - Mean, Variance, Standard Deviation Stepanov

2

Example 2: Suppose a random variable X has the following probability distribution: x f ( x ) 10 0.20 11 0.40 12 0.30 13 0.10 a) Find the expected value of X, E(X). x f ( x ) x × f ( x ) 10 0.2

11 0.4

12 0.3

13 0.1

E(X) = µ X =

b) Find the variance of X, Var(X). x f ( x ) ( x - µ X ) ( x - µ X )

2 × f ( x )

10 0.2

11 0.4

12 0.3

13 0.1

Var(X) = =

= E [( X - µ X ) 2]

å ×x

xfx

all

)(

2 Xσ ( )å ×-

x

xfx

all

2X )(μ

①× = { "" "" "" " }

← weighted average)mean

10 ( 0.2) = 2

11 (0.41=4.4

1210 . 3) = 3.6

13 (O. 1) = 1.3I

=

11.3

70,ECX)

-a measurement

to - 11.3=-1.3 L- I. 3) 210.27=0.338for how spread 11 - 11.3=-0.3 (-0-37210.4)=0.036out the data are

12-11.3=0.7 (0.7)-

( 0.37=0.147

13 - II.3=1.7 ( 1.75 (O. D= 0.289-

÷ =

0.81

Page 3: 2.2 - Expectation 2.3 - Mean, Variance, Standard Deviation€¦ · 1 STAT 400 UIUC 2.1 - Random Variables (Discrete) 2.2 - Expectation 2.3 - Mean, Variance, Standard Deviation Stepanov

3

x f ( x ) x 2 × f ( x )

10 0.2

11 0.4

12 0.3

13 0.1

Var(X) = =

= E ( X 2 ) – [ E(X) ] 2 c) Find the standard deviation of X, SD(X).

SD(X) = = d) Find the cumulative distribution function of X, F ( x ) = P ( X £ x ). x f ( x ) F ( x ) 10 0.2

11 0.4

12 0.3

13 0.1

2 Xσ [ ] 2

all

2 E(X))(

x

xfx -å ×

Xσ2Xσ

= E ( XD( IO ' ) ( O.2) = 20

( 112 ) ( O. 4) = 48.4

( 122) ( O. 3) = 43.2( 132) ( O. 1) = I G. 9

728.5

= 128.5 - ( 11.35=10.811in

expected value ofXII (expected value of X)Z

✓= VVARCXT = G = Vast =

another measurement

of how spread out the data areCdf f

capital F

ICX - x) IC X f x) cdf = left - hand side prob.

FCIO) = f Clo) = O. zE (Xf II)

F( ID= f ( Il) t f ( IO) = 0.6£ # (Xf 12)

Fll2) = f ( 12) t f( Il) t f Clo)= 079

F ( I3) = f ( 13) t HII) tf ( H) t fCIO)

Fix, =/ ! if Yo ! :c " Fae= l

l - Fif l l f X L 12 o. 8 - FO.G - •-G

i

E:¥:{ is " :

To f, k is

F-¥2) -- ICXEK)

Page 4: 2.2 - Expectation 2.3 - Mean, Variance, Standard Deviation€¦ · 1 STAT 400 UIUC 2.1 - Random Variables (Discrete) 2.2 - Expectation 2.3 - Mean, Variance, Standard Deviation Stepanov

4

E( g(X) ) = E ( a × X + b ) = a × E ( X ) + b.

Var ( a × X + b ) = a 2 × Var ( X ).

SD ( a × X + b ) = | a | × SD ( X ).

Example 3: Suppose E(X) = 7, SD(X) = 3. a) Y = 2 X + 3. Find E(Y) and SD(Y). b) W = 5 – 2 X. Find E(W) and SD(W). Example 4: Suppose a discrete random variable X has the following probability distribution:

P( X = 0 ) = , P( X = k ) = , k = 1, 2, 3, …

a) Find E ( X ). b) Find Var ( X ).

å ×x

xfxg

all

)()(

e 2 -!2

1

kk ×

OF- (Y) = E (2X t 3) = 2E (x) t 3 = 2 (7) t 3 = IIISD (Y) = SD (2X t 3) = 121 SD (x) = 2 (3) = ⑥

ECW) = E ( 5 - 2X) = 5 - 2E (x) = 5 - 2 ( 7) = -⑨SD (W ) = SD ( 5 - 2x) = SD ( 5t C-2)X) = I-21 SD(x) = 2 (3) =⑥

.÷o'÷= ex

f (O) =

fi K) =

F- (X) = & x.fCx) = 0¥05 t I. f Cl) t2ft2) t - - - = ,⇐,

x.÷II.EE#.a...T=E..*x.iIIEfI7Ii= 's ;÷ck(x- D !-IE

. ."e"

=

n-- x- i

var (X) = E (XD - [ECX)]-

t ECx) E(x- l)

E (X') = E ( X'- X t x) = E (X

'- X) t E(x) = E (XCX - D] t E (x)

;Y¥ =

. eight '" -E.""'EiE.÷: ¥: ÷¥÷:¥I÷¥÷"÷.# e".

Page 5: 2.2 - Expectation 2.3 - Mean, Variance, Standard Deviation€¦ · 1 STAT 400 UIUC 2.1 - Random Variables (Discrete) 2.2 - Expectation 2.3 - Mean, Variance, Standard Deviation Stepanov

5

Example 5: Let X be a discrete random variable with p.m.f. p ( x ) that is positive on the odd non-negative integers { 1, 3, 5, 7, 9, … } and is zero elsewhere. Suppose

p ( 1 ) = c ( unknown ), p ( k ) = , k = 3, 5, 7, 9, … .

a) Find the value of c that makes this is a valid probability distribution.

Must have = 1.

b) Find E ( X ). Example 6: A grocer has shelf space for two units of a highly perishable item that must be disposed of at the end of the day if it is not sold. Each unit costs $1.70 and sells for $3.50. From past experience, the grocer knows that the demand for this item could be either 0, or 1, or 2 units. The grocer has to decide whether to stock one unit of this item or two units. a) Construct the grocer's profit (payoff) in each of the following cases: demand = 0 demand = 1 demand = 2

stock 1 unit

stock 2 units

k 2

1

( )åxxp

all

EC = eight = Idk ⇒ Varlx) - Eye"- (EI)-

=¥e"

⇐ plx) = pll ) t p (3) t p (5) tp (7) t " ' Yz ,

÷:÷÷:÷÷÷÷i÷. "" "t¥E-(x) --↳ x. f- (x) = 1. its.# t 5. Ist F - ¥+9 . #t - a '

'

¥¥¥.⇐÷÷÷:(E -⇒ th -IHI. - Falta .

--Tt Ff t ÷ t ÷ t - - -

⇒ I,ECX)- It # t# t#t.

E. Th.- 1.7

3.5 - loti.g

=L t ,¥÷=¥z= 1.8

f- 1.7)2 -3.4+3.5 - 3.4 t 7 ⇒ E (X)=Yzx 4J= - 3.4 = 0. I = 3.6

= gy-

Page 6: 2.2 - Expectation 2.3 - Mean, Variance, Standard Deviation€¦ · 1 STAT 400 UIUC 2.1 - Random Variables (Discrete) 2.2 - Expectation 2.3 - Mean, Variance, Standard Deviation Stepanov

6

b) Suppose P(demand = 0) = 0.20, P(demand = 1) = 0.30, and P(demand = 2) = 0.50. Find the expected payoff (profit) of both actions and choose the "optimal" action. c) Suppose P(demand = 0) = 0.25, P(demand = 1) = 0.30, and P(demand = 2) = 0.45. Find the expected payoff (profit) of both actions and choose the "optimal" action. Example 7: To save time and money when testing blood samples for the presence of a disease, the following procedure is sometimes used: Blood samples from a number of people are pooled together and the pooled sample is tested. If the pooled sample is negative, then no further testing needs to be done. If the pooled sample is positive, however, then each one of the separate samples must be tested individually. To be specific, suppose that the blood samples of 10 people are pooled together in this procedure, and suppose that the proportion of those who have the disease in the population from which the samples are drawn is 0.02. (Also assume that the presence of the disease in one sample is independent of the presence of the disease in the other samples.) a) Find the probability that the pooled sample is negative.

b) Let X be the number of tests that must be run. Construct the probability distribution of X. x f ( x )

c) Compute the mean of X. Is this larger or smaller than 10?

⇒ optimal : stock2. units

stock l unit : expected = l- I.7)( O .2) t (1.8) ( O. 3) t ( I.8) (0.5)

stock 2 units : expected = f - 3.4) (O. 2) t (O. 1) (0.3) t ( 3.6) (0.57=1.150

stock I unit : expected = I - I.7) (0.25) t ( I.8) (O. 3) t ( I.8) 10.457=10.9251Stock 2 units : expected = C- 3.4) (0.25) t ( O. 1) ( o.3) t ( 3.6) (0.457=10.87

⇒ optimal : stock t unit

I ( pooled sample is negative) = I ( 1st - n 2nd - n 3rd - n . . . . n goth -)independent = I ( 1st-) .I (2nd - ) - - - I Cloth D= ( I - 0.02)

"

I

= 10.8177-

pooled sample - d 10.8172

pooled sample t l l l - 0.817=10.1832

E ( X) =Ex x- f(x) = l ( 0.817) t 11 ( O. 1837=12.837=On average, 2.83

tests are needed per 10 individuals .

Page 7: 2.2 - Expectation 2.3 - Mean, Variance, Standard Deviation€¦ · 1 STAT 400 UIUC 2.1 - Random Variables (Discrete) 2.2 - Expectation 2.3 - Mean, Variance, Standard Deviation Stepanov

7

Example 8: Homer Simpson is going to Moe’s Tavern for some Flaming Moe’s. Let X denote the number of Flaming Moe’s that Homer Simpson will drink. Suppose X has the following probability distribution:

x f ( x ) 0

1

2

3

4

0.1

0.2

0.3

0.3

a) Find the missing probability f ( 4 ) = P ( X = 4 ).

b) Find the probability P ( X ³ 1 ).

c) Find the probability P ( X ³ 1 | X < 3 ).

d) Compute the expected value of X, E ( X ).

l÷:g÷÷.

0.6 I . 2

0.9 2.7

O. I 1.62.I 5.F

f ( 4) = I (X = 4) = I - (0.1*0.2+0.3+0.3)=10.11

I ( X> 1) = O . It 0.3 t 0.3 t 0.1=10.91OR = I - f ( O) = I - O

. I = 10.97

I (Xxl l Xss)=I(×>1nX#=I¥g})=fCDtfC#f- CO)tfCDtfCIRC X

=oj.5.IE?fo.83337ECxl--ExafCx)=/2.lIall x

= O ( 0.1 ) t l (O.2) t - - .

Page 8: 2.2 - Expectation 2.3 - Mean, Variance, Standard Deviation€¦ · 1 STAT 400 UIUC 2.1 - Random Variables (Discrete) 2.2 - Expectation 2.3 - Mean, Variance, Standard Deviation Stepanov

8

e) Compute the standard deviation of X, SD ( X ).

Example 8: (cont.) Suppose each Flaming Moe costs $1.50, and there is a cover charge of $1.00 at the door. Let Y denote the amount of money Homer Simpson spends at the bar. Then Y = 1.50 × X + 1.00 . f) Find the probability that Homer would spend over $5.00.

g) Find the expected amount of money that Homer Simpson would spend.

h) Find the standard deviation for the amount of money that Homer Simpson would spend

E ( g CX) ) = E g Cx) - f Cx)allX

g CX) -- X'

: ECXZ) = Jax x'. f-(x)

Var ( x) = E (X') - [ E (x) )'

= 5.7 - ( 2.172 = 1.29

SD ( x) = VVarCxT = VIET ⇐ 11.13581

Y = 1.5 X t l

I ( Y > 5) = I ( 1.5Xt I > 5) = I (1.5×74)= I ( X > ¥) = I ( X > 2.6667..)= IC X Z 3) = f- (3) t f (4) =④

E (Y) = E ( 1.5 X t l) = 1.5 E (x) t I= 1.5 ( 2. l) t I= 415W

SD ( Y) = SD ( 1.5 X t l ) =/ 1.51 SD ( X)= 1.5 Visa I 11.70-377