15
properties of variance 27

properties of variance - University of Washingtonzoo.pdf · properties of variance 30. a zoo of (discrete) random variables 31. bernoulli random variables An experiment results in

Embed Size (px)

Citation preview

Page 1: properties of variance - University of Washingtonzoo.pdf · properties of variance 30. a zoo of (discrete) random variables 31. bernoulli random variables An experiment results in

properties of variance

27

Page 2: properties of variance - University of Washingtonzoo.pdf · properties of variance 30. a zoo of (discrete) random variables 31. bernoulli random variables An experiment results in

another example

28

Example: What is Var[X] when X is outcome of one fair die?

E[X] = 7/2, so

Page 3: properties of variance - University of Washingtonzoo.pdf · properties of variance 30. a zoo of (discrete) random variables 31. bernoulli random variables An experiment results in

Var[aX+b] = a2 Var[X]

Ex:

properties of variance

29

E[X] = 0Var[X] = 1

Y = 1000 X E[Y] = E[1000 X] = 1000 E[x] = 0Var[Y] = Var[1000 X] =106Var[X] = 106

Page 4: properties of variance - University of Washingtonzoo.pdf · properties of variance 30. a zoo of (discrete) random variables 31. bernoulli random variables An experiment results in

In general: Var[X+Y] ≠ Var[X] + Var[Y]

Ex 1:

Let X = ±1 based on 1 coin flip

As shown above, E[X] = 0, Var[X] = 1

Let Y = -X; then Var[Y] = (-1)2Var[X] = 1

But X+Y = 0, always, so Var[X+Y] = 0

Ex 2:

As another example, is Var[X+X] = 2Var[X]?

properties of variance

30

Page 5: properties of variance - University of Washingtonzoo.pdf · properties of variance 30. a zoo of (discrete) random variables 31. bernoulli random variables An experiment results in

a zoo of (discrete) random variables

31

Page 6: properties of variance - University of Washingtonzoo.pdf · properties of variance 30. a zoo of (discrete) random variables 31. bernoulli random variables An experiment results in

bernoulli random variables

An experiment results in “Success” or “Failure”X is a random indicator variable (1=success, 0=failure) P(X=1) = p and P(X=0) = 1-pX is called a Bernoulli random variable: X ~ Ber(p)E[X] = E[X2] = pVar(X) = E[X2] – (E[X])2 = p – p2 = p(1-p)

Examples:coin fliprandom binary digitwhether a disk drive crashed

32

Jacob (aka James, Jacques) Bernoulli, 1654 – 1705

Page 7: properties of variance - University of Washingtonzoo.pdf · properties of variance 30. a zoo of (discrete) random variables 31. bernoulli random variables An experiment results in

binomial random variables

Consider n independent random variables Yi ~ Ber(p) X = Σi Yi is the number of successes in n trialsX is a Binomial random variable: X ~ Bin(n,p)

By Binomial theorem, Examples

# of heads in n coin flips# of 1’s in a randomly generated length n bit string# of disk drive crashes in a 1000 computer cluster

E[X] = pnVar(X) = p(1-p)n

33

←(proof below, twice)

Page 8: properties of variance - University of Washingtonzoo.pdf · properties of variance 30. a zoo of (discrete) random variables 31. bernoulli random variables An experiment results in

binomial pmfs

34

0 2 4 6 8 10

0.00

0.05

0.10

0.15

0.20

0.25

0.30

PMF for X ~ Bin(10,0.5)

k

P(X=k)

µ ± !

0 2 4 6 8 10

0.00

0.05

0.10

0.15

0.20

0.25

0.30

PMF for X ~ Bin(10,0.25)

k

P(X=k)

µ ± !

Page 9: properties of variance - University of Washingtonzoo.pdf · properties of variance 30. a zoo of (discrete) random variables 31. bernoulli random variables An experiment results in

binomial pmfs

35

0 5 10 15 20 25 30

0.00

0.05

0.10

0.15

0.20

0.25

PMF for X ~ Bin(30,0.5)

k

P(X=k)

µ ± !

0 5 10 15 20 25 30

0.00

0.05

0.10

0.15

0.20

0.25

PMF for X ~ Bin(30,0.1)

k

P(X=k)

µ ± !

Page 10: properties of variance - University of Washingtonzoo.pdf · properties of variance 30. a zoo of (discrete) random variables 31. bernoulli random variables An experiment results in

using

k=1 gives:

hence:

letting j = i-1

mean and variance of the binomial

36

; k=2 gives E[X2]=np[(n-1)p+1]

Page 11: properties of variance - University of Washingtonzoo.pdf · properties of variance 30. a zoo of (discrete) random variables 31. bernoulli random variables An experiment results in

products of independent r.v.s

37

Theorem: If X & Y are independent, then E[X•Y] = E[X]•E[Y]Proof:

Note: NOT true in general; see earlier example E[X2]≠E[X]2

independence

Page 12: properties of variance - University of Washingtonzoo.pdf · properties of variance 30. a zoo of (discrete) random variables 31. bernoulli random variables An experiment results in

Theorem: If X & Y are independent, then Var[X+Y] = Var[X]+Var[Y]

Proof: Let

variance of independent r.v.s is additive

38

Var(aX+b) = a2Var(X)

(Bienaymé, 1853)

Page 13: properties of variance - University of Washingtonzoo.pdf · properties of variance 30. a zoo of (discrete) random variables 31. bernoulli random variables An experiment results in

mean, variance of binomial r.v.s

39

Page 14: properties of variance - University of Washingtonzoo.pdf · properties of variance 30. a zoo of (discrete) random variables 31. bernoulli random variables An experiment results in

disk failures

A RAID-like disk array consists of n drives, each of which will fail independently with probability p. Suppose it can operate effectively if at least one-half of its components function, e.g., by “majority vote.”For what values of p is a 5-component system more likely to operate effectively than a 3-component system?

X5 = # failed in 5-component system ~ Bin(5, p)X3 = # failed in 3-component system ~ Bin(3, p)

40

Page 15: properties of variance - University of Washingtonzoo.pdf · properties of variance 30. a zoo of (discrete) random variables 31. bernoulli random variables An experiment results in

X5 = # failed in 5-component system ~ Bin(5, p)X3 = # failed in 3-component system ~ Bin(3, p)P(5 component system effective) = P(X5 < 5/2)

P(3 component system effective) = P(X3 < 3/2)

Calculation: 5-component systemis better iff p < 1/2

41

disk failures

0.0 0.2 0.4 0.6 0.8 1.0

0.0

0.2

0.4

0.6

0.8

1.0

P(one disk fails)

P(m

ajor

ity fu

nctio

nal)

n=1

n=5n=3

0.00 0.04 0.08

0.975

0.995

P(one disk fails)

P(m

ajor

ity fu

nctio

nal)

n=1

n=3

n=5