Discrete Random Variables A random variable is a numerical value - - PowerPoint PPT Presentation

discrete random variables
SMART_READER_LITE
LIVE PREVIEW

Discrete Random Variables A random variable is a numerical value - - PowerPoint PPT Presentation

ST 370 Probability and Statistics for Engineers Discrete Random Variables A random variable is a numerical value associated with the outcome of an experiment. Discrete random variable When we can enumerate the possible values of the variable


slide-1
SLIDE 1

ST 370 Probability and Statistics for Engineers

Discrete Random Variables

A random variable is a numerical value associated with the outcome

  • f an experiment.

Discrete random variable When we can enumerate the possible values of the variable (such as 0, 1, 2, . . . ), the random variable is discrete. Example: acceptance sampling Suppose that a sample of size 10 is drawn from a shipment of 200 items, of which some number are non-compliant; X is the number of non-compliant items in the sample. The possible values of X are 0, 1, 2, . . . , 10, so X is a discrete random variable.

1 / 15 Discrete Random Variables

slide-2
SLIDE 2

ST 370 Probability and Statistics for Engineers

Continuous random variable When the variable takes values in an entire interval, the random variable is continuous. Example: flash unit recharge time Suppose that a cell phone camera flash is chosen randomly from a production line; the time X that it takes to recharge is a positive real number; X is a continuous random variable. Presumably, there is some lower bound a > 0 that is the shortest possible recharge time, and similarly some upper bound b < ∞ that is the longest possible recharge time; however, we usually do not know these values, and we would just say that the possible values of X are {x : 0 < x < ∞}.

2 / 15 Discrete Random Variables

slide-3
SLIDE 3

ST 370 Probability and Statistics for Engineers

Probability distribution

The probability distribution of a random variable X is a description of the probabilities associated with the possible values of X. The representation of a probability distribution is different for discrete and continuous random variables. Probability mass function For a discrete random variable, the simplest representation is the probability mass function (pmf) fX(x) = P(X = x) where x is any possible value of X.

3 / 15 Discrete Random Variables Probability distribution

slide-4
SLIDE 4

ST 370 Probability and Statistics for Engineers

Example: acceptance sampling Suppose one item is chosen at random from a shipment of 200 items,

  • f which 5 are non-compliant. Let

X =

  • 1

if the item is non-compliant, if the item is compliant. We could say that X is the number of non-compliant items seen. The probability mass function of X is fX(x) =

  • 0.975

x = 0 0.025 x = 1 A random variable like X that takes only the values 0 and 1 is called a Bernoulli random variable.

4 / 15 Discrete Random Variables Probability distribution

slide-5
SLIDE 5

ST 370 Probability and Statistics for Engineers

Example: Dice Suppose you roll a fair die, and the number of spots showing is X. Then X is a discrete random variable with probability mass function fX(x) = 1 6, x = 1, 2, 3, 4, 5, 6. Because the probability is the same for all the possible values of X, it is called the discrete uniform distribution. Properties of the probability mass function They are probabilities: fX(x) ≥ 0. They cover all possibilities:

x fX(x) = 1.

5 / 15 Discrete Random Variables Probability distribution

slide-6
SLIDE 6

ST 370 Probability and Statistics for Engineers

Cumulative distribution function

As an alternative to the probability mass function, the probability distribution of a random variable X can be defined by its cumulative distribution function (cdf) FX(x) = P(X ≤ x), −∞ < x < ∞. In terms of the probability mass function: FX(x) =

  • xi≤x

fx(xi), −∞ < x < ∞. FX(·) has a jump at each possible value xi of X, and the jump equals the corresponding probability fX(xi), so the probability mass function can be obtained from the cumulative distribution function.

6 / 15 Discrete Random Variables Cumulative distribution function

slide-7
SLIDE 7

ST 370 Probability and Statistics for Engineers

Example: acceptance sampling FX(x) =      x < 0 0.975 0 ≤ x < 1 1 x ≥ 1

curve(pbinom(x, 1, .025), from = -1, to = 2)

7 / 15 Discrete Random Variables Cumulative distribution function

slide-8
SLIDE 8

ST 370 Probability and Statistics for Engineers

Example: dice FX(x) =                x < 1 1/6 1 ≤ x < 2 2/6 2 ≤ x < 3 . . . 1 x ≥ 6

curve(pmax(0, pmin(1, floor(x)/6)), from = 0, to = 7)

8 / 15 Discrete Random Variables Cumulative distribution function

slide-9
SLIDE 9

ST 370 Probability and Statistics for Engineers

Mean and Variance

Mean value The mean value, or expected value, of a discrete random variable with probability mass function fX(·) is µX = E(X) =

  • x

xfX(x). E(X) is a weighted average of the possible values of X, each weighted by the corresponding probability. The expected value E(X) is a typical value of the random variable X, in the same way that a sample mean ¯ x is a typical value of the sample x1, x2, . . . , xn.

9 / 15 Discrete Random Variables Mean and Variance

slide-10
SLIDE 10

ST 370 Probability and Statistics for Engineers

Example: acceptance sampling One item is chosen at random from a shipment of 200 items, of which 5 are non-compliant, and X is the number of non-compliant items seen: E(X) = 0 × fX(0) + 1 × fX(1) = 0.025. For any Bernoulli random variable X, E(X) = P(X = 1).

10 / 15 Discrete Random Variables Mean and Variance

slide-11
SLIDE 11

ST 370 Probability and Statistics for Engineers

Example: Dice Suppose you roll a fair die, and the number of spots showing is X: E(X) = 1 × fX(1) + 2 × fX(2) + · · · + 6 × fX(6) = (1 + 2 + 3 + 4 + 5 + 6)/6 = 3.5. Note In these examples and in many others, the “expected” value is not

  • ne of the possible values of the random variable; this is not the

paradox that it is sometimes made out to be!

11 / 15 Discrete Random Variables Mean and Variance

slide-12
SLIDE 12

ST 370 Probability and Statistics for Engineers

Variance Suppose that X is a random variable with expected value µX. Then Y = (X − µX)2 is another random variable, and its expected value is E(Y ) =

  • y

yfY (y) =

  • x

(x − µX)2fX(x).

12 / 15 Discrete Random Variables Mean and Variance

slide-13
SLIDE 13

ST 370 Probability and Statistics for Engineers

The variance of X is E(Y ) = E[(X − µX)2]: σ2

X = V (X) = E

  • (X − µX)2

. The standard deviation of X is σX =

  • σ2

X.

13 / 15 Discrete Random Variables Mean and Variance

slide-14
SLIDE 14

ST 370 Probability and Statistics for Engineers

Example: acceptance sampling For any Bernoulli random variable X, µX = P(X = 1) = p, say, so σ2

X = (0 − p)2 × P(X = 0) + (1 − p)2 × P(X = 1)

= p2(1 − p) + (1 − p)2p = p(1 − p) and σX =

  • p(1 − p).

14 / 15 Discrete Random Variables Mean and Variance

slide-15
SLIDE 15

ST 370 Probability and Statistics for Engineers

Example: Dice x x − 3.5 (x − 3.5)2 fX(x) (x − 3.5)2fX(x) 1

  • 2.5

6.25

1 6

1.0417 2

  • 1.5

2.25

1 6

0.3750 3

  • 0.5

0.25

1 6

0.0417 4 0.5 0.25

1 6

0.0417 5 1.5 2.25

1 6

0.3750 6 2.5 6.25

1 6

1.0417 Total: 2.9168 So σ2

X = 2.917 and σX = 1.708.

15 / 15 Discrete Random Variables Mean and Variance