Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Lecture 4. 2 Random Variables (Discrete) Real-valued functions defined on a sample space are random vars. determined by outcome of experiment, we can.

Similar presentations


Presentation on theme: "1 Lecture 4. 2 Random Variables (Discrete) Real-valued functions defined on a sample space are random vars. determined by outcome of experiment, we can."— Presentation transcript:

1 1 Lecture 4

2 2 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 Since y is between 0 and 3,

3 3 Distribution functions The c.d.f. or distribution function F of random variable x is defined for all real numbers b, F(b) = P{x b} denotes prob. that x takes on a value b Properties 1.F is a non-decreasing function, if a b F(a) < F(b) 2. 3....= 0 4.F is right continuous. For any b and any decreasing sequence bn, n 1 that converges to b,

4 4 Exs: Distribution function of a random variable x is given 0 x 0 x/20 x 1 F(x) = 2/31 x 2 11/122 x 3 13 x Calculate P{x 3}

5 5 Calculate P{x = 1} Calculate P{x ½} Calculate P(2 x 4) (draw graph)

6 6 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 x 1, x 2, x 3,... then P(xi) 0, i = 1, 2,... P(x) = 0, else and If we have P(0) = ¼P(1) = ½P(2) = ¼ (draw graph) The plot for a random var. of sum of 2 dice are: (draw graph)

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

8 8 Then, the c.d.f is 0 a 1 ¼ 1 a 2 F(x) = ¾ 2 a 3 7/83 a 4 14 a Step size at any of values 1, 2, 3, 4 is equal to the probability that x assumes a particular value. (draw graph)

9 9 Expected Value: if x is a discrete random variable with probability mass function p(x) then expectation or expected value 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)

10 10 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 x 1, x 2, x 3,... with p(x 1 ), p(x 2 ),... then, average expectation 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

11 11 Exs If I is a stock indicator for trading volume V then I = 1 if V trueFind E[I] 0 if V C 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.

12 12 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) =.2P(0) =.5P(1) =.3 Calculate E[x 2 ] :

13 13 Let y = x 2, 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[x 2 ] = E[y] = 1(.5) + 0(.5) =.5 note that.5 = E[x 2 ] (E[x]) 2.01

14 14 Method 2: if x is discrete random variable that takes on values x i, i ≥ 1 with P(x i ) then for any real-valued function g, Going back to previous example: E[x 2 ] = (-1) 2 (.2) + 0 2 (.5) + 1 2 (.3) = 1(.2 +.3) + 0 (.5) =.5

15 15 Corollary if a and b are constants then E[aX + b] = a E[X] + b Because E[aX + b] = = The expected value of a random variable x, E[x] is also referred to as the mean or 1 st moment of x. The quantity E[x n ], n 1 is the n th moment of x and, E[x n ] =

16 16 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 That is also Var (x) = E[x 2 ] – (E[x]) 2

17 17 Exs Calculate Var(x) if x is outcome of a fair die rolled  from previous example, E[x] = 7/2 and E[x 2 ] = 1 2 (1/6) + 2 2 (1/6) + 3 2 (1/6) +... 6 2 (1/6) = 91/6 Hence, Var(x) = 91/6 – (7/2) 2 = 35/12 Identity: for any constants a and b Var(ax + b) = a 2 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) = Discrete random variables are classified according to their prob. mass function.

18 18 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 = { i th card is ace } P(x = i) = P(AB) = P(B/A) P(A) = P(x) =

19 19 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 B = rest of cards Thus, Var(x) = 2.43 - (1.25) 2 = 0.864 and σ x =

20 20 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 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

21 21 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 having the property that any set B of real numbers: 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 (all probability stmts about x can be answered in terms of f)

22 22 If B = [a, b] then if we let a = b then (means that probability of a continuous random variable will assume any fixed value is zero).

23 23 Exs: Suppose x is continuous random variable whose p.d.f. is else What is value of C?  Since f is a p.d.f., we have and thus, Find P(x 1)?

24 24 Exs Lifetime in days of a MEMS wireless transceiver is a random variable having p.d.f. given by f(s) 0x 100 100/x 2 x > 100 What’s probability that 2 of 5 such devices needs replacing within 150 days of continuous operation?

25 25 Exs Assume that events Ei, i = 1, 2, 3, 4, 5 i th transceiver will need replacement within the 150 days are independent thus, from independence of events Ei, the probability is P(E) P(E C )

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

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

28 28 Relationship between c.d.f. F and p.d.f. f is Differentiating both sides, Density is the derivative of cumulative distr. function. Also, we can say that, from

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


Download ppt "1 Lecture 4. 2 Random Variables (Discrete) Real-valued functions defined on a sample space are random vars. determined by outcome of experiment, we can."

Similar presentations


Ads by Google