Вы находитесь на странице: 1из 29

Lecture 4

Random Variables (Discrete) Real-valued functions defined on a sample space are random vars. determined by outcome of experiment, we can assign probability to possible values of it (them). Exs: Toss 3 fair coins, let Y be number of H appearing, then Y is a random var. with possible values (0,1,2,3) with probability P{y = 0} = P(T, T, T) = 1/8 P(y = 1) = P(T, T, H), (T, H,T), (H, T, T) = 3/8 P(y = 2) = P(T, H, H), (H, T, H), (H, H, T) = 3/8 P(y = 3) = P(H, H, H) = 1/8 3 3 Since y is between 0 and 3, 1 ! P ( { y } i}) ! P( y ! i)

7
i !0

i !0

Distribution functions The c.d.f. or distribution function F of random variable x is defined for all real numbers b, g Rb Rg F(b) = P{x e b} denotes prob. that x takes on a value e b

Properties 1. F is a non-decreasing function, if a Rb F(a) < F(b) lim 2. bpg F (b) ! 1 3. lim . . .= 0 b p g 4. F is right continuous. For any b and any decreasing sequence bn, n u 1 that converges to b,
n pg

lim F (bn ) ! F (b)


3

Exs: Distribution function of a random variable x is given 0 x R0 x/2 0 e x R1 F(x) = 2/3 1e x R 2 11/12 2 e x R 3 1 3e x Calculate P{x R 3}

lim P{x e 3  1 } ! lim F (3  1 ) ! 11 n n 12 n n

Calculate P{x = 1}
1 P ( x e 1)  P( x  1) ! F (1)  lim F (1  ) ! 2  1 ! 1 3 2 6 n

Calculate P{x H}
P{x H1 } ! 1  P{x e 1 } ! 1  F ( 1 ) ! 3 4 2 2 2

Calculate P(2 Rx

4)

P(2 Rx e 4) ! F (4)  F (2) ! 1 12


(draw graph)

Discrete Random Variables A random variable that can take on at most a countable number of possible values. Probability mass function P(a) = P{x = a} If x can be x1, x2, x3, . . . then P(xi) u 0, i = 1, 2, . . . P(x) = 0, else g P ( xi) ! 1 and

i !1

If we have P(0) =
(draw graph)

P(1) =

P(2) =

The plot for a random var. of sum of 2 dice are:


(draw graph)
6

Cumulative Distr. Function F can be expressed in terms of mass function as F(a) = 7 p(x) all x e a If x is discrete random variable where x1 R x2 Rx3 R . . then . distrib. function F is a step function. The value of F is constant in intervals [xi-1, xi) and with a step (jump) of size p(xi) at xi Exs: x has probability mass function P(1) = p(2) = p(3) = 1/8

P(4) = 1/8

Then, the c.d.f is 0 a R1 1 e a R2 F(x) = 2 e a R3 7/8 3 e a R4 1 4ea Step size at any of values 1, 2, 3, 4 is equal to the probability that x assumes a particular value.
(draw graph)

Expected Value: if x is a discrete random variable with probability mass function p(x) then expectation or expected value E[ x] ! xp( x)
x: p ( x ) H 0

This is a weighted average of possible values x can take on each value, weighted by probability that x assumes it. If p(0) = = p(1) E[x] = 0*1/2 + 1 = ordinary avg. of 2 possible values 0 and 1 x can assume Or if p(0) = p(1) = 2/3 E[x] = 0*(1/2) + 1*(2/3) = 2/3 where value of 1 is given twice as much weight as value 0 so, p(1) = 2p(0) } 2/3 = 2*(1/3)
9

Frequency Interpretation if an infinite sequence of independent replications of an experiment is done, then for any event E, the proportion of time that E occurs is p(E). So, if x can be x1, x2, x3, . . . with p(x1), p(x2), . . . then, n average expectation

E[ x] ! xip ( xi )
i !1

Exs: Find E[x] where x is outcome of a roll of fair die Since p(1) = p(2) = . . . p(6) = 1/6 Then, E[x] = 1(1/6) + 2(1/6) + 3(1/6) + . . . 6(1/6) = 7/2

10

Exs If I is a stock indicator for trading volume V then I = 1 if V true Find E[I] 0 if VC true Since p(1) = p(v), p(0) = 1 p(A) we haven then E[I] = p(A) Expected value of indicator is the probability that event occurs.

11

Expectation of a function of a Random Variable: Having a discrete random variable and its probability mass function, we need expected value of some function x, g(x). One method: *calculate the prob. mass function of g(x) since it is a discrete random variable *calculate E[g(x)] by using expected value definition Exs X is a random variable with any value in 1, 0, 1 with x }-1 x }0 x }1 P(-1) = .2 P(0) = .5 P(1) = .3 Calculate E[x2] :

12

Let y = x2, it follows that prob. mass function of y is P(y = 1) = P(x = -1) + P{x = 1} = .5 P{y = 0} = P{x = 0} = .5 hence, E[x2] = E[y] = 1(.5) + 0(.5) = .5 note that .5 = E[x2] { (E[x])2 } .01

13

Method 2: if x is discrete random variable that takes on values xi, i 1 with P(xi) then for any real-valued function g,

E[ g ( x)] ! g ( xi ) p ( xi )
i

Going back to previous example: E[x2] = (-1)2 (.2) + 02 (.5) + 12 (.3) = 1(.2 + .3) + 0 (.5) = .5

14

Corollary if a and b are constants then E[aX + b] = a E[X] + b Because E[aX + b] = (ax  b) p ( x)

x: p ( x ) H 0

x: p ( x ) H 0

xp( x)  b

p( x) ! aE[ x]  b
x: p ( x ) H 0

The expected value of a random variable x, E[x] is also referred to as the mean or 1st moment of x. The quantity E[xn], n u 1 is the nth moment of x and, E[xn] =

x
x: p ( x ) H 0

p( x)
15

Variance Given x with distribution function F and E[x]. E[x] is weighted average of all possible values for x. We need the variation or spread of these values. If x has a mean , then variance of x, Var(x) = E[(x )2] Or ! ( x Q ) 2 p ( x)

x x

! ( x 2  2 Qx  Q 2 ) p ( x) ! x 2 p ( x)  2 Q xp( x)  Q 2 p ( x)
x x x

! E[ x 2 ]  2 Q 2  Q 2 ! E[ x 2 ]  Q 2
That is also Var (x) = E[x2] (E[x])2
16

Exs Calculate Var(x) if x is outcome of a fair die rolled from previous example, E[x] = 7/2 and E[x2] = 12(1/6) + 22 (1/6) + 32(1/6) + . . . 62 (1/6) = 91/6 Hence, Var(x) = 91/6 (7/2)2 = 35/12 Identity: for any constants a and b Var(ax + b) = a2 Var(x) *note that analogous to the mean being center of gravity of a distrib. of mass, Variance represents moment of inertia *The SQRT of Var(x) is the STD. deviation of x denoted by SD(x) = Var (x ) Discrete random variables are classified according to their prob. mass function. 17

Exs: 52-card deck is well-shuffled and then cards are turned face up one by one til Ace appears. Find expect number of cards that are face up Let x be number cards face up til ace appears A = { no ace among first i 1 cards turned up } B = { ith card is ace } 4 ( i481 ) P(x = i) = P(AB) = P(B/A) P(A) = . 

52  (i  1) ( 521 ) i

P(x) =

i (i481 )4  (52 )(52  i) } 10.6 } 11 i !1 i 1


49
18

Exs: What are Expected number, Var., and S.D. of the number of spades in a poker hand? (P.H. = set of 5 cards randomly picked from 52) A = pick any 12 spades 5 (13 )( 39 i ) E[ x] ! i i 525 ! 1.25 B = rest of cards

i !0

(5 )

(13 )( 39 i ) 2 i 2 5 ! 2.430 E[ x ] ! i 52 (5 ) i !0
5

Thus, Var(x) = 2.43 - (1.25)2 = 0.864 and

= .864 ! .93
19

Exs A professor made 30 exams, 8 tough, 12 medium, 10 easy; exams are mixed up and 4 are selected at random. How many will be difficult? x number of difficult ones We need E(x), so x can be 0, 1, 2, 3, 4 and its probability function is

(8 )( 22 i ) p (i ) ! p( x } i ) ! i 304  , i ! 0,1,2,3,4 (4 )
Values of all p(i.s) i 0 1 2 3 4 p(i) 0.27 .45 .24 .04 .003 @ E(x) = 0(.27) + 1(.45) + 2(.24) + 3(.04) + 4(.003) = 1.06
20

Continuous Random Variables Set of possible values is uncountable (lifetime of a transistor, mars rovers, etc) X is continuous random variable if there exists a nonnegative function f, defined for all real x (g, g) having the property that any set B of real numbers:

P{x B} ! f ( x)dx
B

Probability density function of x (states that probability that x will be in B may be obtained by integrating the p.d.f. over set B) it must also satisfy

1 ! P{x (g, g )} ! f ( x)dx


g

(all probability stmts about x can be answered in terms of f)

21

If B = [a, b] then

P{a e x e b} ! f ( x)dx
a

if we let a = b then

P{x ! a} ! f ( x)dx ! 0
a

(means that probability of a continuous random variable will assume any fixed value is zero).

@ P{x Ra} ! P{x e a} ! F ( a) ! f ( x)dx


g

22

Exs: Suppose x is continuous random variable whose p.d.f. is

f ( x) !

C ( 4 x  2 x 2 ) 0 Rx R2 0 else

What is value of C? Since f is a p.d.f., we have and thus, C 2 (4 x  2 x 2 )dx ! 1

f ( x)dx ! 1

g

2 x3 ] C[ 2 x  3
2

x!2 x !0

!1 C ! 3

Find P(x H1)?

1 P ( x H ) ! f ( x) dx !
1

(4 x  2 x )dx } 1
2

2
23

Exs Lifetime in days of a MEMS wireless transceiver is a random variable having p.d.f. given by f(s) 0 100/x2 x e 100 x > 100

Whats probability that 2 of 5 such devices needs replacing within 150 days of continuous operation?

24

Exs Assume that events Ei, i = 1, 2, 3, 4, 5 ith transceiver will need replacement within the 150 days are independent

P ( Ei ) !

150

f ( x)dx ! 100 x dx ! 1
2 100

150

thus, from independence of events Ei, the probability is P(E)


3 5 2

P(EC)

1 2 2 3 80 ( )( 3 ) ( 3 ) ! 243 0
25

Exs Loss in a stock option, in thousands of dollars, is a continuous random var. x with density function: f(x) = k(2x 3x2) -1 < x < 0 0 else Calculate k and find prob. the loss is at most $500 Since f is a p.d.f. g f ( x) dx ! 1 ,but

g

g

f ( x)dx ! (2 x  3 x )dx ! k (2 x  3 x 2 )dx


2 1 1

! k[ x 2  x 3

0 1

! 2k

26

so,

 2k ! 1 k !  1

and, loss at most $500 iff x -1/2, thus


0 1 )!  1 (2 x  3 x 2 )dx !  1 [ x 2  x 3 ]0 1 ! 3 P( x u   2  12 2 2 16 2

27

Relationship between c.d.f. F and p.d.f. f is

F (a ) ! P{x (g, a )} !

f ( x)dx

g

Differentiating both sides, d F (a) ! f ( a) da

Density is the derivative of cumulative distr. function. Also, we can say that, from

P{a e x e b} ! f ( x)dx
a a I I I P{a  e x e a  } ! I 2 f ( x)dx $ If (a ) a 2 2 2
28

Where I is small and when f is continuous at x = a. In other words, probability that x will be contained in an interval of length I around point a is roughly I f(a). f(a) is a measure of how likely it is the random variable will be near a

29

Вам также может понравиться