3.1 the notion of a random variablebazuinb/ece5820/notes3.pdf · the expected value or mean of a...

37
Notes and figures are based on or taken from materials in the textbook: Alberto Leon-Garcia, “Probability, Statistics, and Random Processes For Electrical Engineering, 3rd ed.”, Pearson Prentice Hall, 2008, ISBN: 013-147122-8. 1 of 37 3. Discrete Random Variables A random variable is defined as a function that assigns a numerical value to the outcome of the experiment. In this chapter we introduce the concept of a random variable and methods for calculating probabilities of events involving a random variable. The following basic concepts will be presented. probability mass function define the expected value of a random variable and relate it to our intuitive notion of an average introduce the conditional probability mass function for the case where we are given partial information about the random variable Throughout the book it is shown that complex random experiments can be analyzed by decomposing them into simple subexperiments. 3.1 The Notion of a Random Variable The outcome of a random experiment need not be a number. However, we are usually interested not in the outcome itself, but rather in some measurement or numerical attribute of the outcome. A measurement assigns a numerical value to the outcome of the random experiment. Since the outcomes are random, the results of the measurements will also be random. Hence it makes sense to talk about the probabilities of the resulting numerical values A random variable X is a function that assigns a real number, X(ζ),to each outcome in the sample space of a random experiment. Recall that a function is simply a rule for assigning a numerical value to each element of a set, as shown pictorially in Fig. 3.1. The specification of a measurement on the outcome of a random experiment defines a function on the sample space, and hence a random variable. The sample space S is the domain of the random variable, and the set S X of all values taken on by X is the range of the random variable. Thus S X is a subset of the set of all real numbers.

Upload: others

Post on 23-Jul-2020

12 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 3.1 The Notion of a Random Variablebazuinb/ECE5820/Notes3.pdf · The expected value or mean of a discrete random variable X is defined by all k k X k x S mX E X x pX x x p x X The

Notes and figures are based on or taken from materials in the textbook: Alberto Leon-Garcia, “Probability, Statistics, and Random Processes For Electrical Engineering, 3rd ed.”, Pearson Prentice Hall, 2008, ISBN: 013-147122-8.

1 of 37

3. Discrete Random Variables

A random variable is defined as a function that assigns a numerical value to the outcome of the experiment. In this chapter we introduce the concept of a random variable and methods for calculating probabilities of events involving a random variable.

The following basic concepts will be presented.

probability mass function define the expected value of a random variable and relate it to our intuitive notion

of an average introduce the conditional probability mass function for the case where we are

given partial information about the random variable

Throughout the book it is shown that complex random experiments can be analyzed by decomposing them into simple subexperiments.

3.1 The Notion of a Random Variable

The outcome of a random experiment need not be a number. However, we are usually interested not in the outcome itself, but rather in some measurement or numerical attribute of the outcome.

A measurement assigns a numerical value to the outcome of the random experiment. Since the outcomes are random, the results of the measurements will also be random. Hence it makes sense to talk about the probabilities of the resulting numerical values

A random variable X is a function that assigns a real number, X(ζ),to each outcome in the sample space of a random experiment.

Recall that a function is simply a rule for assigning a numerical value to each element of a set, as shown pictorially in Fig. 3.1. The specification of a measurement on the outcome of a random experiment defines a function on the sample space, and hence a random variable. The sample space S is the domain of the random variable, and the set SX of all values taken on by X is the range of the random variable. Thus SX is a subset of the set of all real numbers.

Page 2: 3.1 The Notion of a Random Variablebazuinb/ECE5820/Notes3.pdf · The expected value or mean of a discrete random variable X is defined by all k k X k x S mX E X x pX x x p x X The

Notes and figures are based on or taken from materials in the textbook: Alberto Leon-Garcia, “Probability, Statistics, and Random Processes For Electrical Engineering, 3rd ed.”, Pearson Prentice Hall, 2008, ISBN: 013-147122-8.

2 of 37

We will use the following notation: capital letters denote random variables, e.g., X or Y, and lower case letters denote possible values of the random variables, e.g., x or y.

The above example shows that a function of a random variable produces another random variable.

Aside: Is this a good game for the player to play if the coin is fair? Result Probability Payout Prob*Payout HHH 0.125 8 1.0

HHT, HTH, THH 3*0.125 1 0.375 HTT,THT,TTH 3*0.125 0 0

TTT 0.125 0 0 Total 1.375

On average, you lose 0.125 cents every time you play. If the HHH payout were $9, the payout would equal the bet … on average.

Page 3: 3.1 The Notion of a Random Variablebazuinb/ECE5820/Notes3.pdf · The expected value or mean of a discrete random variable X is defined by all k k X k x S mX E X x pX x x p x X The

Notes and figures are based on or taken from materials in the textbook: Alberto Leon-Garcia, “Probability, Statistics, and Random Processes For Electrical Engineering, 3rd ed.”, Pearson Prentice Hall, 2008, ISBN: 013-147122-8.

3 of 37

For random variables, the function or rule that assigns values to each outcome is fixed and deterministic, as, for example, in the rule “count the total number of dots facing up in the toss of two dice.” The randomness in the experiment is complete as soon as the toss is done. The process of counting the dots facing up is deterministic. Therefore the distribution of the values of a random variable X is determined by the probabilities of the outcomes ζ in the random experiment. In other words, the randomness in the observed values of X is induced by the underlying random experiment, and we should therefore be able to compute the probabilities of the observed values of X in terms of the probabilities of the underlying outcomes.

Example 3.3 illustrates a general technique for finding the probabilities of events involving the random variable X. Let the underlying random experiment have sample space S and event class F. To find the probability of a subset B of R, e.g., kxB we

need to find the outcomes in S that are mapped to B, that is,

BXA :

as shown in Fig. 3.2. If event A occurs then BX so event B occurs. Conversely, if

event B occurs, then the value X implies that ζ is in A, so event A occurs. Thus the probability that X is in B is given by:

BXPAPBXP :

Page 4: 3.1 The Notion of a Random Variablebazuinb/ECE5820/Notes3.pdf · The expected value or mean of a discrete random variable X is defined by all k k X k x S mX E X x pX x x p x X The

Notes and figures are based on or taken from materials in the textbook: Alberto Leon-Garcia, “Probability, Statistics, and Random Processes For Electrical Engineering, 3rd ed.”, Pearson Prentice Hall, 2008, ISBN: 013-147122-8.

4 of 37

An alternate definition of Random Variable

Random variable: A real function whose domain is that of the outcomes of an experiment (sample space, S) and whose actual value is unknown in advance of the experiment.

From: http://en.wikipedia.org/wiki/Random_variable

A random variable can be thought of as the numeric result of operating a non-deterministic mechanism or performing a non-deterministic experiment to generate a random result.

Unlike the common practice with other mathematical variables, a random variable cannot be assigned a value; a random variable does not describe the actual outcome of a particular experiment, but rather describes the possible, as-yet-undetermined outcomes in terms of real numbers.

3.1.1 *Fine Point: Formal Definition of a Random Variable

In going from Eq. (3.1) to Eq. (3.2) we actually need to check that the event A is in F, because only events in F have probabilities assigned to them. The formal definition of a random variable in Chapter 4 will explicitly state this requirement.

If the event class F consists of all subsets of S, then the set A will always be in F, and any function from S to R will be a random variable. However, if the event class F does not consist of all subsets of S, then some functions from S to R may not be random variables.

Page 5: 3.1 The Notion of a Random Variablebazuinb/ECE5820/Notes3.pdf · The expected value or mean of a discrete random variable X is defined by all k k X k x S mX E X x pX x x p x X The

Notes and figures are based on or taken from materials in the textbook: Alberto Leon-Garcia, “Probability, Statistics, and Random Processes For Electrical Engineering, 3rd ed.”, Pearson Prentice Hall, 2008, ISBN: 013-147122-8.

5 of 37

3.2 Discrete Random Variables And Probability Mass Function

A discrete random variable X is defined as a random variable that assumes values from a countable set, that is, ,,, 321 xxxSX . A discrete random variable is said to be finite

if its range is finite, that is, nX xxxxS ,,,, 321 . We are interested in finding the

probabilities of events involving a discrete random variable X. Since the sample space

XS is discrete, we only need to obtain the probabilities for the events kxXA :

in the underlying random experiment. The probabilities of all events involving X can be found from the probabilities of the kA ’s.

The probability mass function (pmf) of a discrete random variable X is defined as:

xXPxXPxpX :

Note that xpX is a function of x over the real line, and that xpX can be nonzero only

at the values x1 , x2 , x3 , … For xk in SX, we have kkX APxp .

Note:

• for discrete random variables: probability mass functions (pmf) • for continuous random variables: probability density functions (pdf)

Cumulative Distribution Function (CDF)

xXPxFX , for x

The sum or integral of the pmf or pdf.

Page 6: 3.1 The Notion of a Random Variablebazuinb/ECE5820/Notes3.pdf · The expected value or mean of a discrete random variable X is defined by all k k X k x S mX E X x pX x x p x X The

Notes and figures are based on or taken from materials in the textbook: Alberto Leon-Garcia, “Probability, Statistics, and Random Processes For Electrical Engineering, 3rd ed.”, Pearson Prentice Hall, 2008, ISBN: 013-147122-8.

6 of 37

Properties of the probability mass functions (pmf)

(1) 0xpX for all x

(2) 1 kall

kkall

kXSx

X APxpxpX

(3)

Bx

X xpBinXP where XSB

The pmf of X gives us the probabilities for all the elementary events from SX . The probability of any subset of SX is obtained from the sum of the corresponding elementary events.

Once the pmf of the elementary events have been defined, the probability for all other sets containing the elementary events can be readily defined.

Page 7: 3.1 The Notion of a Random Variablebazuinb/ECE5820/Notes3.pdf · The expected value or mean of a discrete random variable X is defined by all k k X k x S mX E X x pX x x p x X The

Notes and figures are based on or taken from materials in the textbook: Alberto Leon-Garcia, “Probability, Statistics, and Random Processes For Electrical Engineering, 3rd ed.”, Pearson Prentice Hall, 2008, ISBN: 013-147122-8.

7 of 37

Page 8: 3.1 The Notion of a Random Variablebazuinb/ECE5820/Notes3.pdf · The expected value or mean of a discrete random variable X is defined by all k k X k x S mX E X x pX x x p x X The

Notes and figures are based on or taken from materials in the textbook: Alberto Leon-Garcia, “Probability, Statistics, and Random Processes For Electrical Engineering, 3rd ed.”, Pearson Prentice Hall, 2008, ISBN: 013-147122-8.

8 of 37

Example 3.9 Message Transmissions

Let X be the number of times a message needs to be transmitted until it arrives correctly at its destination. Find the pmf of X. Find the probability that X is an even number.

X is a discrete random variable taking on values from ,3,2,1XS . The event kX occurs if the underlying experiment finds k - 1 consecutive erroneous transmissions (“failures”) followed by an error-free one transmission (“success”):

pqppPxXPxp kkX 11101000

We call X the geometric random variable, and we say that X is geometrically distributed. In Eq. (2.42b), we saw that the sum of the geometric probabilities is 1.

q

q

q

qpqqpqpkpevenXisP

k

k

k

k

kX

112

20

2

1

12

1

Note: textbook solution is wrong … as a simple example, what happens if p=1 and q=0?

Finally, let’s consider the relationship between relative frequencies and the pmf.

For a large number of trials, the relative frequencies should approach the pmf!

Page 9: 3.1 The Notion of a Random Variablebazuinb/ECE5820/Notes3.pdf · The expected value or mean of a discrete random variable X is defined by all k k X k x S mX E X x pX x x p x X The

Notes and figures are based on or taken from materials in the textbook: Alberto Leon-Garcia, “Probability, Statistics, and Random Processes For Electrical Engineering, 3rd ed.”, Pearson Prentice Hall, 2008, ISBN: 013-147122-8.

9 of 37

3.3 Expected Value and Moments of Discrete Random Variable

In this section we introduce parameters that quantify the properties of random variables.

The expected value or mean of a discrete random variable X is defined by

kall

kXkSx

XX xpxxpxXEmX

The expected value E[X] is defined if the above sum converges absolutely, that is,

kall

kXk xpxXE

There are random variables for which the summation does not converge. In such cases, we say that the expected value does not exist.

If we view xpX as the distribution of mass on the points in the real line, then E[X] represents the center of mass of this distribution.

The use of the term “expected value” does not mean that we expect to observe E[X] when we perform the experiment that generates X.

E[X] corresponds to the “average of X” in a large number of observations of X.

Page 10: 3.1 The Notion of a Random Variablebazuinb/ECE5820/Notes3.pdf · The expected value or mean of a discrete random variable X is defined by all k k X k x S mX E X x pX x x p x X The

Notes and figures are based on or taken from materials in the textbook: Alberto Leon-Garcia, “Probability, Statistics, and Random Processes For Electrical Engineering, 3rd ed.”, Pearson Prentice Hall, 2008, ISBN: 013-147122-8.

10 of 37

Page 11: 3.1 The Notion of a Random Variablebazuinb/ECE5820/Notes3.pdf · The expected value or mean of a discrete random variable X is defined by all k k X k x S mX E X x pX x x p x X The

Notes and figures are based on or taken from materials in the textbook: Alberto Leon-Garcia, “Probability, Statistics, and Random Processes For Electrical Engineering, 3rd ed.”, Pearson Prentice Hall, 2008, ISBN: 013-147122-8.

11 of 37

General types of problems and the 3expected value

Note:

2

1

1

nnk

n

k

and

6

121

1

2

nnnk

n

k

Page 12: 3.1 The Notion of a Random Variablebazuinb/ECE5820/Notes3.pdf · The expected value or mean of a discrete random variable X is defined by all k k X k x S mX E X x pX x x p x X The

Notes and figures are based on or taken from materials in the textbook: Alberto Leon-Garcia, “Probability, Statistics, and Random Processes For Electrical Engineering, 3rd ed.”, Pearson Prentice Hall, 2008, ISBN: 013-147122-8.

12 of 37

3.3.1 Expected Value of Functions of a Random Variable

Let X be a discrete random variable, and let XgZ . Since X is discrete, will

XgZ assume a countable set of values of the form kxg where Xk Sx . Denote

the set of values assumed by g(X) by ,, 21 zz . One way to find the expected value of Z is to use Eq. (3.8), which requires that we first find the pmf of Z.

k

kXkX xpxXEm

XmgZE

Another way is to use the following result:

k

kXk xpxgXgEZE

To show this equation, group the terms kx that are mapped to each value jz

ZEzpzxpzxpxgj

jZjj zxgx

kXjk

kXk

jkk

:

The sum inside the braces is the probability of all terms kx for which jk zxg . which

is the probability that jzZ , that is, jZ zp .

Example 3.17 Square-Law Device

Let X be a noise voltage that is uniformly distributed in 3,1,1,3 XS with

41kpX for k in XS . Find E[Z] where 2XZ .

Using the first approach we find the pmf of Z 21333,39 XXZ ppXPp

21111,12 XXZ ppXPp

Therefore

52

10

2

19

2

11

jjZj zpzZE

The second approach produces

54

20

4

13

4

11

4

11

4

13 2222

kkXk xpxgZE

Page 13: 3.1 The Notion of a Random Variablebazuinb/ECE5820/Notes3.pdf · The expected value or mean of a discrete random variable X is defined by all k k X k x S mX E X x pX x x p x X The

Notes and figures are based on or taken from materials in the textbook: Alberto Leon-Garcia, “Probability, Statistics, and Random Processes For Electrical Engineering, 3rd ed.”, Pearson Prentice Hall, 2008, ISBN: 013-147122-8.

13 of 37

Useful Properties of the expected value operator: XhEXgEXhXgE

XgEaXgaE

ccE

Example 3.18 Square-Law Device

The noise voltage X in the previous example is amplified and shifted to obtain 102 XY

and then squared to produce 2YZ

. Find E[Z].

22 102 XEYEZE

100404 2 XXEZE

100404 2 XEXEZE

but

54

20

4

13

4

11

4

11

4

13 22222 XE

04

0

4

13

4

11

4

11

4

13 XE

12010004054 ZE

Example 3.19 Voice Packet Multiplexer

Let X be the number of voice packets containing active speech produced by n=48 independent speakers in a 10-millisecond period as discussed in Section 1.4. X is a binomial random variable with parameter n and probability p = 1/3. Suppose a packet multiplexer transmits up to M=2- active packets every 10 ms, and any excess active packets are discarded. Let Z be the number of packets discarded. Find E[Z].

The number of packets discarded every 10 ms is the following function of X:

MXifMX

MXifMXZ

0

Page 14: 3.1 The Notion of a Random Variablebazuinb/ECE5820/Notes3.pdf · The expected value or mean of a discrete random variable X is defined by all k k X k x S mX E X x pX x x p x X The

Notes and figures are based on or taken from materials in the textbook: Alberto Leon-Garcia, “Probability, Statistics, and Random Processes For Electrical Engineering, 3rd ed.”, Pearson Prentice Hall, 2008, ISBN: 013-147122-8.

14 of 37

Then

kk

X kkp

48

3

2

3

148, for 48,,1,0 k

182.03

2

3

14820

48

21

48

k

kk

kkZE

Every 10 ms 16 pnXE active packets are produced on average, so the fraction of

active packets discarded is %14.116/182.0/ XEZE which users will tolerate. This example shows that engineered systems also play “betting” games where favorable statistics are exploited to use resources efficiently. In this example, the multiplexer transmits 20 packets per period instead of 48 for a reduction of 28/48=58% of the capacity required for 100% packets for all 48 possible users.

See MATLAB example for pX(x) and computations.

Page 15: 3.1 The Notion of a Random Variablebazuinb/ECE5820/Notes3.pdf · The expected value or mean of a discrete random variable X is defined by all k k X k x S mX E X x pX x x p x X The

Notes and figures are based on or taken from materials in the textbook: Alberto Leon-Garcia, “Probability, Statistics, and Random Processes For Electrical Engineering, 3rd ed.”, Pearson Prentice Hall, 2008, ISBN: 013-147122-8.

15 of 37

3.3.2 Variance of a Random Variable

The expected value E[X], by itself, provides us with limited information about X.For example, if we know that 0XE then it could be that X is zero all the time. However, it is also possible that X can take on extremely large positive and negative values. We are therefore interested not only in the mean of a random variable, but also in the extent of the random variable’s variation about its mean.

Let the deviation of the random variable X about its mean be XEX which can take on positive and negative values. Since we are interested in the magnitude of the variations only, it is convenient to work with the square of the deviation, which is always

positive, 2XEXXD . The variance of the random variable X is defined as the

expected value of D:

222XX mXEXEXEXVAR

kall

kXXkSx

XXX xpmxxpmxX

222

The standard deviation of the random variable X is defined by:

21XVARXSTDX

By taking the square root of the variance we obtain a quantity with the same units as X.

Aside: In making measurements, one often uses the variances as the “+/- error” as in

XXmvalue

An alternate equality for the variance can be derived as

222 2 XXX mXmXEmXEXVAR

22 2 XX mXEmXEXVAR

22 2 XXX mmmXEXVAR

2222 XEXEmXEXVAR X

The value 2XE is also referred to as the second moment of X. The Nth moment is defined as:

kall

kXN

kSx

XNN xpxxpxXE

X

Page 16: 3.1 The Notion of a Random Variablebazuinb/ECE5820/Notes3.pdf · The expected value or mean of a discrete random variable X is defined by all k k X k x S mX E X x pX x x p x X The

Notes and figures are based on or taken from materials in the textbook: Alberto Leon-Garcia, “Probability, Statistics, and Random Processes For Electrical Engineering, 3rd ed.”, Pearson Prentice Hall, 2008, ISBN: 013-147122-8.

16 of 37

Some nice propertied of the variance: (1) adding a constant offset to the random variable does not change the variance and (2) multiplying the random variable by a constant results in the constant squared times the variance.

22 cXEcXEcXEcXEcXVAR

XVARXEXEcXVAR 2

and

22 XEcXcEXcEXcEXcVAR

XVARcXEXcEXcVAR 222

Now let cX a random variable that is equal to a constant with probability 1, then

cmXE X

0022 EccEmcEXVAR X

A constant random variable has zero variance.

Page 17: 3.1 The Notion of a Random Variablebazuinb/ECE5820/Notes3.pdf · The expected value or mean of a discrete random variable X is defined by all k k X k x S mX E X x pX x x p x X The

Notes and figures are based on or taken from materials in the textbook: Alberto Leon-Garcia, “Probability, Statistics, and Random Processes For Electrical Engineering, 3rd ed.”, Pearson Prentice Hall, 2008, ISBN: 013-147122-8.

17 of 37

Page 18: 3.1 The Notion of a Random Variablebazuinb/ECE5820/Notes3.pdf · The expected value or mean of a discrete random variable X is defined by all k k X k x S mX E X x pX x x p x X The

Notes and figures are based on or taken from materials in the textbook: Alberto Leon-Garcia, “Probability, Statistics, and Random Processes For Electrical Engineering, 3rd ed.”, Pearson Prentice Hall, 2008, ISBN: 013-147122-8.

18 of 37

3.4 Conditional Probability Mass Function

In many situations we have partial information about a random variable X or about the outcome of its underlying random experiment. We are interested in how this information changes the probability of events involving the random variable. The conditional probability mass function addresses this question for discrete random variables.

3.4.1 Conditional Probability Mass Function

Let X be a discrete random variable with pmf xpX and let C be an event that has

nonzero probability, CP . The conditional probability mass function of X is defined by the conditional probability:

CP

CxXPCxpX

| , for 0Pr C

Page 19: 3.1 The Notion of a Random Variablebazuinb/ECE5820/Notes3.pdf · The expected value or mean of a discrete random variable X is defined by all k k X k x S mX E X x pX x x p x X The

Notes and figures are based on or taken from materials in the textbook: Alberto Leon-Garcia, “Probability, Statistics, and Random Processes For Electrical Engineering, 3rd ed.”, Pearson Prentice Hall, 2008, ISBN: 013-147122-8.

19 of 37

Most of the time the event C is defined in terms of X, for example 10 XC or

bXaC . For kx in XS we have the following general result:

Cxif

CxifCP

xP

Cxp

k

kk

kX

,0

,|

The above expression is determined entirely by the pmf of X.

Many random experiments have natural ways of partitioning the sample space S into the union of disjoint events B1, B2, … , Bn. Let iX Bxp | be the conditional pmf of X given

event Bi. The theorem on total probability allows us to find the pmf of X in terms of the conditional pmf’s:

n

iiiXX BPBxpxp

1

|

Page 20: 3.1 The Notion of a Random Variablebazuinb/ECE5820/Notes3.pdf · The expected value or mean of a discrete random variable X is defined by all k k X k x S mX E X x pX x x p x X The

Notes and figures are based on or taken from materials in the textbook: Alberto Leon-Garcia, “Probability, Statistics, and Random Processes For Electrical Engineering, 3rd ed.”, Pearson Prentice Hall, 2008, ISBN: 013-147122-8.

20 of 37

3.4.2 Conditional Expected Value

Let X be a discrete random variable, and suppose that we know that event B has occurred. The conditional expected value of X given B is defined as:

k

kXkSx

XBX BxpxBxpxBXExmX

||||

where we apply the absolute convergence requirement on the summation.

The conditional variance of X given B is defined as:

k

kXBXkBX BxpmxBmXEBXVAR ||| 2|

2|

2|

2 || BXmBXEBXVAR

Note that the variation is measured with respect to BXm | and not Xm .

Page 21: 3.1 The Notion of a Random Variablebazuinb/ECE5820/Notes3.pdf · The expected value or mean of a discrete random variable X is defined by all k k X k x S mX E X x pX x x p x X The

Notes and figures are based on or taken from materials in the textbook: Alberto Leon-Garcia, “Probability, Statistics, and Random Processes For Electrical Engineering, 3rd ed.”, Pearson Prentice Hall, 2008, ISBN: 013-147122-8.

21 of 37

Let B1, B2, … , Bn be the partition of S, and let iX Bxp | be the conditional pmf of X

given event Bi. Then, E[X] can be calculated from the conditional expected values iBXE |

i

n

ii BPBXEXE

1

|

Based on total probability

k

n

iiikX

kkX BPBxpkxpkXE

1

|

n

i

n

iiii

n

kikX BPBXEBPBxpkXE

1 1

||

It can also be shown that

i

n

ii BPBXgEXgE

1

|

Page 22: 3.1 The Notion of a Random Variablebazuinb/ECE5820/Notes3.pdf · The expected value or mean of a discrete random variable X is defined by all k k X k x S mX E X x pX x x p x X The

Notes and figures are based on or taken from materials in the textbook: Alberto Leon-Garcia, “Probability, Statistics, and Random Processes For Electrical Engineering, 3rd ed.”, Pearson Prentice Hall, 2008, ISBN: 013-147122-8.

22 of 37

3.5 Important Discrete Random Variables

Certain random variables arise in many diverse, unrelated applications. The pervasiveness of these random variables is due to the fact that they model fundamental mechanisms that underlie random behavior.

3.5.1 The Bernoulli Random Variable 1,0XS

qpp 10 and pp 1 , for 10 p

pXEmX

qpppXVARX 12

Remarks: The Bernoulli random variable is the value of the indicator function IA for some event A; X=1 if A occurs and X=0 otherwise.

Every Bernoulli trial, regardless of the event A, is equivalent to the tossing of a biased coin with probability of heads p. In this sense, coin tossing can be viewed as representative of a fundamental mechanism for generating randomness, and the Bernoulli random variable is the model associated with it.

Page 23: 3.1 The Notion of a Random Variablebazuinb/ECE5820/Notes3.pdf · The expected value or mean of a discrete random variable X is defined by all k k X k x S mX E X x pX x x p x X The

Notes and figures are based on or taken from materials in the textbook: Alberto Leon-Garcia, “Probability, Statistics, and Random Processes For Electrical Engineering, 3rd ed.”, Pearson Prentice Hall, 2008, ISBN: 013-147122-8.

23 of 37

3.5.2 The Binomial Random Variable nS X ,,2,1,0

knkk pp

k

np

1 , for nk ,,2,1,0

pnXEmX

ppnXVARX 12

Remarks: X is the number of successes in n Bernoulli trials and hence the sum of n independent, identically distributed Bernoulli random variables

The binomial random variable arises in applications where there are two types of objects (i.e., heads/tails, correct/erroneous bits, good/defective items, active/silent speakers), and we are interested in the number of type 1 objects in a randomly selected batch of size n, where the type of each object is independent of the types of the other objects in the batch.

Note that:

p

p

k

kn

p

p

k

k

111

Page 24: 3.1 The Notion of a Random Variablebazuinb/ECE5820/Notes3.pdf · The expected value or mean of a discrete random variable X is defined by all k k X k x S mX E X x pX x x p x X The

Notes and figures are based on or taken from materials in the textbook: Alberto Leon-Garcia, “Probability, Statistics, and Random Processes For Electrical Engineering, 3rd ed.”, Pearson Prentice Hall, 2008, ISBN: 013-147122-8.

24 of 37

3.5.3 The Geometric Random Variable

First Version

,2,1,0XS

kk ppp 1 , for ,2,1,0k

p

pXEmX

1

2

2 1

p

pXVARX

Remarks: X is the number of failures before the first success in a sequence of independent Bernoulli trials.

Note that:

qpp

p

k

k 11

The geometric random variable is the only discrete random variable that satisfies the memoryless property:

kMPjMjkMP | , for all j,k>1

The above expression states that if a success has not occurred in the first j trials, then the probability of having to perform at least k more trials is the same as the probability of initially having to perform at least k trials. Thus, each time a failure occurs, the system “forgets” and begins anew as if it were performing the first trial.

Second Version

,2,1XS

11 kk ppp , for ,2,1k

p

XEmX

1'

2

2 1'

p

pXVARX

Page 25: 3.1 The Notion of a Random Variablebazuinb/ECE5820/Notes3.pdf · The expected value or mean of a discrete random variable X is defined by all k k X k x S mX E X x pX x x p x X The

Notes and figures are based on or taken from materials in the textbook: Alberto Leon-Garcia, “Probability, Statistics, and Random Processes For Electrical Engineering, 3rd ed.”, Pearson Prentice Hall, 2008, ISBN: 013-147122-8.

25 of 37

Remarks: X’=X+1 is the number of trials until the first success in a sequence of independent Bernoulli trials.

kkk

i

ik

i

i qq

qpqpqpkMP

11

11

01

1

The geometric random variable arises in applications where one is interested in the time (i.e., number of trials) that elapses between the occurrence of events in a sequence of independent experiments. Examples where the modified geometric random variable arises are: number of customers awaiting service in a queueing system; number of white dots between successive black dots in a scan of a black-and-white document.

Page 26: 3.1 The Notion of a Random Variablebazuinb/ECE5820/Notes3.pdf · The expected value or mean of a discrete random variable X is defined by all k k X k x S mX E X x pX x x p x X The

Notes and figures are based on or taken from materials in the textbook: Alberto Leon-Garcia, “Probability, Statistics, and Random Processes For Electrical Engineering, 3rd ed.”, Pearson Prentice Hall, 2008, ISBN: 013-147122-8.

26 of 37

3.5.4 The Poisson Random Variable

In many applications, we are interested in counting the number of occurrences of an event in a certain time period or in a certain region in space. The Poisson random variable arises in situations where the events occur “completely at random” in time or space. For example, the Poisson random variable arises in counts of emissions from radioactive substances, in counts of demands for telephone connections, and in counts of defects in a semiconductor chip.

,2,1,0XS

ek

pk

k !, for ,2,1,0k

XEmX

XVARX2

where is the average number of event occurrences in a specified time interval or region in space.

Thus the Poisson pmf can be used to approximate the binomial pmf for large n and small p, using = np.

Page 27: 3.1 The Notion of a Random Variablebazuinb/ECE5820/Notes3.pdf · The expected value or mean of a discrete random variable X is defined by all k k X k x S mX E X x pX x x p x X The

Notes and figures are based on or taken from materials in the textbook: Alberto Leon-Garcia, “Probability, Statistics, and Random Processes For Electrical Engineering, 3rd ed.”, Pearson Prentice Hall, 2008, ISBN: 013-147122-8.

27 of 37

Page 28: 3.1 The Notion of a Random Variablebazuinb/ECE5820/Notes3.pdf · The expected value or mean of a discrete random variable X is defined by all k k X k x S mX E X x pX x x p x X The

Notes and figures are based on or taken from materials in the textbook: Alberto Leon-Garcia, “Probability, Statistics, and Random Processes For Electrical Engineering, 3rd ed.”, Pearson Prentice Hall, 2008, ISBN: 013-147122-8.

28 of 37

3.5.5 The Uniform Random Variable

LjjjS X ,2,1

Lpk

1 , for Ljjjk ,2,1

2

1

LjXEmX

12

122

L

XVARX

Page 29: 3.1 The Notion of a Random Variablebazuinb/ECE5820/Notes3.pdf · The expected value or mean of a discrete random variable X is defined by all k k X k x S mX E X x pX x x p x X The

Notes and figures are based on or taken from materials in the textbook: Alberto Leon-Garcia, “Probability, Statistics, and Random Processes For Electrical Engineering, 3rd ed.”, Pearson Prentice Hall, 2008, ISBN: 013-147122-8.

29 of 37

3.5.6 The Zipf Random Variable

The Zipf random variable is named for George Zipf who observed that the frequency of words in a large body of text is proportional to their rank. Suppose that words are ranked from most frequent, to next most frequent, and so on. Let X be the rank of a word, then

LS X ,,2,1 where L is the number of distinct words. The pmf of X is:

LS X ,,2,1

kcp

Lk

11 , for Lk ,,2,1

where cL is a normalization constant. The second word has 1/2 the frequency of occurrence as the first, the third word has 1/3 the frequency of the first, and so on. The normalization constant, cL, is given by the sum:

L

jL j

c1

1

L

L

k L

L

kkX c

L

kckpkXEm

11

11

2

222

2LL

Xc

L

c

LLXVAR

The Zipf and related random variables have gained prominence with the growth of the Internet where they have been found in a variety of measurement studies involving Web page sizes, Web access behavior, and Web page interconnectivity.

These random variables had previously been found extensively in studies on the distribution of wealth and, not surprisingly, are now found in Internet video rentals and book sales.

Page 30: 3.1 The Notion of a Random Variablebazuinb/ECE5820/Notes3.pdf · The expected value or mean of a discrete random variable X is defined by all k k X k x S mX E X x pX x x p x X The

Notes and figures are based on or taken from materials in the textbook: Alberto Leon-Garcia, “Probability, Statistics, and Random Processes For Electrical Engineering, 3rd ed.”, Pearson Prentice Hall, 2008, ISBN: 013-147122-8.

30 of 37

3.6 Generation of Discrete Random Variables

If you can generate the pmf, you can generate an approximation to the random variable.

1) generate a uniform random number between 0 and 1.

2) Using the pmf, assign values from 0 to pmf(1) to the 1st discrete value, pmf(1) to pmf(2) to the second and so on.

Page 31: 3.1 The Notion of a Random Variablebazuinb/ECE5820/Notes3.pdf · The expected value or mean of a discrete random variable X is defined by all k k X k x S mX E X x pX x x p x X The

Notes and figures are based on or taken from materials in the textbook: Alberto Leon-Garcia, “Probability, Statistics, and Random Processes For Electrical Engineering, 3rd ed.”, Pearson Prentice Hall, 2008, ISBN: 013-147122-8.

31 of 37

SUMMARY

• A random variable is a function that assigns a real number to each outcome of a random experiment. A random variable is defined if the outcome of a random experiment is a number, or if a numerical attribute of an outcome is of interest.

• The notion of an equivalent event enables us to derive the probabilities of events involving a random variable in terms of the probabilities of events involving the underlying outcomes.

• A random variable is discrete if it assumes values from some countable set. The probability mass function is sufficient to calculate the probability of all events involving a discrete random variable.

• The probability of events involving discrete random variable X can be expressed as the sum of the probability mass function xpX .

• If X is a random variable, then Y=g(X) is also a random variable.

• The mean, variance, and moments of a discrete random variable summarize some of the information about the random variable X. These parameters are useful in practice because they are easier to measure and estimate than the pmf.

• The conditional pmf allows us to calculate the probability of events given partial information about the random variable X.

• There are a number of methods for generating discrete random variables with prescribed pmf’s in terms of a random variable that is uniformly distributed in the unit interval.

CHECKLIST OF IMPORTANT TERMS Discrete random variable Equivalent event Expected value of X Function of a random variable nth moment of X Probability mass function Random variable Standard deviation of X Variance of X

Page 32: 3.1 The Notion of a Random Variablebazuinb/ECE5820/Notes3.pdf · The expected value or mean of a discrete random variable X is defined by all k k X k x S mX E X x pX x x p x X The

Notes and figures are based on or taken from materials in the textbook: Alberto Leon-Garcia, “Probability, Statistics, and Random Processes For Electrical Engineering, 3rd ed.”, Pearson Prentice Hall, 2008, ISBN: 013-147122-8.

32 of 37

Mean Values and Moments

Mean Value: the expected mean value of measurements of a process involving a random variable.

This is commonly called the expectation operator or expected value of … and is mathematically described as:

dxxfxXEX X

x

xXxXEX Pr

For laboratory experiments, the expected value of a voltage measurement can be thought of as the DC voltage.

In general, the expected value of a function is:

dxxfXgXgE X

x

xXXgXgE Pr

Page 33: 3.1 The Notion of a Random Variablebazuinb/ECE5820/Notes3.pdf · The expected value or mean of a discrete random variable X is defined by all k k X k x S mX E X x pX x x p x X The

Notes and figures are based on or taken from materials in the textbook: Alberto Leon-Garcia, “Probability, Statistics, and Random Processes For Electrical Engineering, 3rd ed.”, Pearson Prentice Hall, 2008, ISBN: 013-147122-8.

33 of 37

Moments

The moments of a random variable are defined as the expected value of the powers of the measured output or …

dxxfxXEX Xnnn

x

nnn xXxXEX Pr

Therefore, the mean or average is sometimes called the first moment.

Expected Mean Squared Value or Second Moment

The mean square value or second moment is

dxxfxXEX X222

x

xXxXEX Pr222

Page 34: 3.1 The Notion of a Random Variablebazuinb/ECE5820/Notes3.pdf · The expected value or mean of a discrete random variable X is defined by all k k X k x S mX E X x pX x x p x X The

Notes and figures are based on or taken from materials in the textbook: Alberto Leon-Garcia, “Probability, Statistics, and Random Processes For Electrical Engineering, 3rd ed.”, Pearson Prentice Hall, 2008, ISBN: 013-147122-8.

34 of 37

Central Moments

The central moments are the moments of the difference between a random variable and its mean.

Notice that the first central moment is 0 …

The second central moment is referred to as the variance of the random variable …

dxxfXxXXEXX X

2222

x

xXXxXXEXX Pr2222

Note that:

XXXXEXXE 22

222 2 XXXXE

222 2 XXEXXE

222 2 XXXXE

22222 XEXEXXE

222 XX

The variance is equal to the 2nd moment minus the square of the first moment … The variance is also referred to as the standard deviation.

dxxfXxXXEXX X

nnn

x

nnnxXXxXXEXX Pr

Page 35: 3.1 The Notion of a Random Variablebazuinb/ECE5820/Notes3.pdf · The expected value or mean of a discrete random variable X is defined by all k k X k x S mX E X x pX x x p x X The

Notes and figures are based on or taken from materials in the textbook: Alberto Leon-Garcia, “Probability, Statistics, and Random Processes For Electrical Engineering, 3rd ed.”, Pearson Prentice Hall, 2008, ISBN: 013-147122-8.

35 of 37

Hypergeometric Distribution

From: http://en.wikipedia.org/wiki/Hypergeometric_distribution

In probability theory and statistics, the hypergeometric distribution is a discrete probability distribution (probability mass function) that describes the number of successes in a sequence of n draws from a finite population without replacement.

A typical example is the following: There is a shipment of N objects in which D are defective. The hypergeometric distribution describes the probability that in a sample of n distinctive objects drawn from the shipment exactly x objects are defective.

n

N

xn

DN

x

D

nDNXx ,,,Pr

for DnxNnD ,min,0max

The equation is derived based on a non-replacement Bernoulli Trials …

Where the denominator term defines the number of trial possibilities, the 1st numerator term defines the number of ways to achieve the desired x, and the 2nd numerator term defines the filling of the remainder of the set.

Example Use: State Lottery

There are N objects in which D are of interest. The hypergeometric distribution describes the probability that in a sample of n distinctive objects drawn from the total set exactly x objects are of interest.

Lotteries …

N= number of balls to be selected at random D = the balls that you want selected n = the number of balls drawn x = the number of desired balls in the set that is drawn

Page 36: 3.1 The Notion of a Random Variablebazuinb/ECE5820/Notes3.pdf · The expected value or mean of a discrete random variable X is defined by all k k X k x S mX E X x pX x x p x X The

Notes and figures are based on or taken from materials in the textbook: Alberto Leon-Garcia, “Probability, Statistics, and Random Processes For Electrical Engineering, 3rd ed.”, Pearson Prentice Hall, 2008, ISBN: 013-147122-8.

36 of 37

Example: Michigan’s Classic Lotto 47

Prize Structure For Classic Lotto 47 (web site data)

Match Prize Odds of Winning

6 of 6 Jackpot 1 in 10,737,573

5 of 6 $2,500 (guaranteed) 1 in 43,649

4 of 6 $100 (guaranteed) 1 in 873

3 of 6 $5 (guaranteed) 1 in 50 Overall Odds: 1 in 47

http://www.michiganlottery.com/lotto_47_info?#

Matlab Odds

Match Odds of Winning 1 in Percent Probability

6 of 6 10737573 0.0000%

5 of 6 43649 0.0023%

4 of 6 873 0.1146%

3 of 6 50 1.9856%

2 of 6 7.1 14.1471%

1 of 6 2.4 41.8753%

0 of 6 2.4 41.8753% Chance of winning money is 2.1025%

Chance of 0 or 1 number 83.75%

One winner, even money Jackpot $7,826,573.

Matlab Note: binomial coefficient = nchoosek(n,k)

Matlab Example:

Page 37: 3.1 The Notion of a Random Variablebazuinb/ECE5820/Notes3.pdf · The expected value or mean of a discrete random variable X is defined by all k k X k x S mX E X x pX x x p x X The

Notes and figures are based on or taken from materials in the textbook: Alberto Leon-Garcia, “Probability, Statistics, and Random Processes For Electrical Engineering, 3rd ed.”, Pearson Prentice Hall, 2008, ISBN: 013-147122-8.

37 of 37

Black-Jack Card Point Count

The “value” in black-jack of cards is the value of the card for two through 9, 10 for 10’s and face cards, and 11 for aces. What is the mean value of the cards in a deck?

And the probability mass function, xXxf X Pr , is then

else

xfor

xfor

xfor

xf X

,0

11,524

10,5216

9,8,7,6,5,4,3,2,524

Mean Value

x

xXxXEX Pr

31.7

52

380

52

114101644411

52

410

52

16

52

4 9

2

k

kXEX

Second Moment (mean squares)

x

xXxXEX Pr222

92.61

52

3220

52

121410016284411

52

410

52

16

52

4 229

2

222

k

kXEX

Variance 222 XX

49.831.792.61 22

91.2

So, if you want another card : 91.231.7 XE

What if we originally assumed that an Ace was worth 1 instead of 11 ?

So, if you want another card : 15.353.6 XE