PDF ST 371 (IV): Discrete Random Variables

[Pages:16]ST 371 (IV): Discrete Random Variables

1 Random Variables

A random variable (rv) is a function that is defined on the sample space of the experiment and that assigns a numerical variable to each possible outcome of the experiment. We denote random variables by uppercase letters, often X, Y or Z.

Examples for random variables (rv). ? Toss a coin. The sample space S = {H, T }. Define an rv X such that

X({H}) = 1 and X({T }) = 0. X is called a Bernoulli random variable. ? Toss a coin until a head is observed. The sample space

S = {H, T H, T T H, ? ? ? }. Define X = number of tosses needed until a head is observed. Then

X({T H}) = 2, X({T T T T H}) = 5.

? Roll a pair of dice. Define ? X= sum of the numbers on the dice ? Y =the difference between the two numbers on the dice ? Z=the maximum of the two numbers on the dice

Consider outcome = (2, 3). Then X() = 5, Y () = -1, Z() = 3.

? Define Y = the height above sea level at the selected location in US. The largest possible value of Y is 14,494 and the smallest value of Y is -282. The sample space is S = {y : -282 y 14, 494}.

1

Discrete and continuous random variables. A random variable that can take on a finite or at most countably infinite number of values is said to be discrete (countably infinite means that the members in a set can be listed in an infinite sequence in which there is a first element, second element and so on). Examples include:

? the gender of a randomly selected student in class ? the total number of coin tosses required for observing two heads ? the number of students who are absent on the first day of class or the

number of people arriving for treatment at an emergency room. A random variable that can take on values in an interval of real numbers is said to be continuous. Examples include: ? the depth at randomly chosen locations of a lake ? the amount of gas needed to drive to work on a given day ? the survival time of a cancer patient We will focus on discrete random variables in Chapter 3 and consider continuous random variables in Chapter 4.

2 Probability Mass Function

Associated with each discrete random variable X is a probability mass function (pmf) that gives the probability that X equals x:

p(x) = P ({X = x}) = P ({all s S : X(s) = x}).

2

Example 1 Consider whether the next customer buying a laptop at a university bookstore buys a Mac or a PC model. Let

X=

1 if a customer purchases a Mac 0 if a customer purchases a PC

If 20% of all customers during that week select a Mac, what is the pmf of the rv X?

Example 2 Suppose two fair dice are tossed.

Let X be the random variable that is the sum of the two upturned faces. X is a discrete random variable since it has finitely many possible values (the 11 integers 2, 3, ..., 12).

The probability mass function of X is

x 2 3 4 5 6 7 8 9 10 11 12

p(x)

1 36

2 36

3 36

4 36

5 36

6 36

5 36

4 36

3 36

2 36

1 36

It is often instructive to present the probability mass function in a graphical format plotting p(xi) on the y-axis against xi on the x-axis.

3

Probability Mass Function 0.04 0.08 0.12 0.16

2

4

6

8

10

12

X

Remarks: So far, we have been defining probability functions in terms of the elementary outcomes making up an experiment's sample space. Thus, if two fair dice were tossed, a probability was assigned to each of the 36 possible pairs of upturned faces.

We have seen that in certain situations some attribute of an outcome may hold more interest for the experimenter than the outcome itself. A craps player, for example, may be concerned only that he throws a 7, not whether the 7 was the result of a 5 and a 2, a 4 and a 3 or a 6 and a 1. That, being the case, it makes sense to replace the 36-member sample space

S = {(i, j) : i = 1, ? ? ? , 6; j = 1, ? ? ? , 6}

with the more relevant (and simpler) 11-member sample space of all possible two-dice sums,

S = {x = i + j : i + j = 2, 3, ? ? ? , 12}.

This redefinition of the sample space not only changes the number of outcomes in the space (from 36 to 11) but also changes the probability structure. In the original sample space, all 36 outcomes are equally likely. In the revised sample space, the 11 outcomes are not equally likely.

4

Example 3 Three balls are to be randomly selected without replacement from an urn containing balls numbered 1 through 20. Let X denote the largest number selected. X is a random variable taking on values 3, 4, ..., 20. Since we select the balls randomly, each of the C3,20 combinations of the balls is equally likely to be chosen.

The probability mass function of X is

P ({X

=

i})

=

C2,i-1 C3,20

,

i

=

3,

??

?

, 20.

This equation follows because the number of selections that result in the event {X = i} is just the number of selections that result in the ball numbered i and two of the balls numbered 1 through i - 1 being chosen.

0.15

0.10

Probability Mass Function

0.05

0.00

5

10

15

20

X

Suppose the random variable X can take on values {x1, x2, ? ? ? ? ? ? }. Since the probability mass function is a probability function on the redefined

sample space that considers values of X, we have that P (X = xi) = 1.

i=1

5

This follows from

1 = P (S)

= P ( {X = xi})

i=1

= P (X = xi).

i=1

Example 4 Independent trials, consisting of the flipping of a coin having probability p of coming up heads, are continually performed until a head occurs. Let X be the random variable that denotes the number of times the coin is flipped. The probability mass function for X is

P {X = 1} = P {H} = p P {X = 2} = P {(T, H)} = (1 - p)p P {X = 3} = P {(T, T, H)} = (1 - p)2p ?????? P {X = n - 1} = P {(T, T, . . . , T , H)} = (1 - p)n-2p

n-2

P {X = n} = P {(T, T, . . . , T , T )} = (1 - p)n-1p

n-1

??????

3 Cumulative Distribution Function

The cumulative distribution function (CDF) of a random variable X is the function

F (x) = P (X x) = p(y).

y:yx

6

Example 5 The pmf of a random variable X is given by x 1 2 3 45

p(x) 0.3 0.3 0.2 0.1 c ? What is c? ? What is the cdf of X? ? Calculate P (2 X 4).

7

All probability questions about X can be answered in terms of the cdf F . Specifically for discrete random variables,

P (a < X b) = F (b) - F (a) P (a X b) = F (b) - F (a - 1) for all a < b. This can be seen by writing the event {X b} as the union of the mutually exclusive events {X a} and {a < X b}. That is, {X b} = {X a} {a < X b}. Therefore, we have P {X b} = P {X a} + P {a < X b} and the result follows.

Example 6 Consider selecting at random a student who is among the 15,000 registered for the current semester at NCSU. Let X=the number of courses for which the selected student is registered, and suppose that X has the following pmf:

x 1234567 p(x) .01 .03 .13 .25 .39 .17 .02 What is the probability of a student chooses three or more courses?

8

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download