Chapter 2 Discrete Random Variables

Preview:

DESCRIPTION

Chapter 2 Discrete Random Variables. Random Variables. Informally: A rule for assigning a real number to each outcome of a random experiment A fish is randomly selected from a lake. Let the random variable Z = the length of the fish in inches - PowerPoint PPT Presentation

Citation preview

Chapter 2 Discrete Random Variables

Random Variables

Informally: A rule for assigning a real number to each outcome of a random experiment– A fish is randomly selected from a lake. Let the

random variableZ = the length of the fish in inches

– A voter is randomly selected and asked if he or she supports a candidate running for office. Let the random variable

1 if the person supports the candidate0 otherwise

W

Random Variables

Definition 2.1.1 Let S be the sample space of a random experiment. A random variable is a function

The set of possible values of X is called the range of X (also called the support of X).

:X S

Random Variables1. A random variable is a function. 2. A random variable is not a probability.3. Random variables can be defined in practically any way.

Their values do not have to be positive or between 0 and 1 as with probabilities.

4. Random variables are typically named using capital letters such as X, Y , or Z. Values of random variables are denoted with their respective lower-case letters. Thus, the expression

X = x means that the random variable X has the value x.

Discrete Random Variables

Definition 2.1.2 A random variable is discrete if its range is either finite or countable.

Chapter 3 – Continuous random variables

2.2 – Probability Mass Functions

Definition 2.2.1 Let X be a discrete random variable and let R be the range of X. The probability mass function (abbreviated p.m.f.) of X is a function f : R → that satisfies the following three properties:

1.

2.

3. If

0 for all

( ) 1

( ), then ( )x R

x A

f x x R

f x

A R P X A f x

Distribution

• Definition 2.2.2 The distribution of a random variable is a description of the probabilities of the values of variable.

Example 2.2.1

A bag contains one red cube and one blue cube. Consider the random experiment of selecting two cubes with replacement. The two cubes we select are called the sample. The same space is

S = {RR, RB, BR, BB}, and we assume that each outcome is equally likely. Define the random variable

X = the number of red cubes in the sample

Example 2.2.1

Values of X:X(RR) = 2, X(RB) = 1, X(BR) = 1, X(BB) = 0

Values of the p.m.f.:1(0) ( 0) ( )4

2(1) ( 1) ({ } )4

1(2) ( 2)

{

(4

1

)

}2

f P X P BB

f P X P RB

f P X P RR

BR

Example 2.2.1

The Distribution Table Probability Histogram

Formula 2 1( ) , for 0,1,2

4x

f x x

Uniform Distribution

Definition 2.2.3 Let X be a discrete random variable with k elements in its range R. X has a uniform distribution (or be uniformally distributed) if its p.m.f. is

1( ) for each f x x Rk

Example 2.2.2

Consider the random experiment of rolling a fair six-sided die. The sample space is

S ={1, 2, 3, 4, 5, 6}Let the random variable X be the number of dots on the side that lands up. Then

(i.e. X has a uniform distribution)

1( ) ( ) for each {1, ,6}6

f x P X x x

Cumulative Distribution Function

Definition 2.2.4 The cumulative distribution function (abbreviated c.d.f.) of a discrete random variable X is

( ) ( ) ( ) for all real numbers x b

F b P X b f x b

Example 2.2.4

Consider the random experiment of rolling two fair six-sided dice and calculating the sum. Let the random variable X be this sum.

4)(2) (3) (4) by property 3 of

(

4) (the p.m.f.

16

f fP

fF X

Example 2.2.4

Mode and Median

• Definition 2.2.5 The mode of a discrete random variable X is a value of X at which the p.m.f. f is maximized. The median of X is the smallest number m such that

( ) 0.5 and ( ) 0.5P X m P X m

Example 2.2.1

• Mode = 1• Median = 1 since( 1) 1/ 4 1/ 2 3 / 4 and ( 1) 1/ 2 1/ 4 3 / 4P X P X

2.3 – Hypergeometric and Binomial Distributions

Definition 2.3.1 Consider a random experiment that meets the following requirements:

1. We select n objects from a population of N without replacement (n ≤ N).

2. The N objects are of two types, call them type I and type II, where N1 are of type I and N2 are of type II (N1 + N2 = N).

Define the random variableX = the number of type I objects in the sample of n.

Hypergeometric Distribution

Definition 2.3.1 (continued) Then X has a hypergeometric distribution and its p.m.f. is

– The numbers N, n, N1, and N2 are called the parameters of the random variable.

1 2

( ) ( ) , 0,1, ,

N Nx n x

f x P X x x nNn

Example 2.3.2

A manufacturer of radios receives a shipment of 200 transistors, four of which are defective. To determine if they will accept the shipment, they randomly select 10 transistors and test each. If there is more than one defective transistor in the sample, they reject the entire shipment. Find the probability that the shipment is not rejected.

Example 2.3.2

• X = number of defectives in the sample of 10 • X has a hypergeometric distribution with

N = 200, n = 10, N1 = 4, and N2 = 196.

(shipment is not rejected) ( 0 1) 0 1

0 1

4 196 4 1960 10 0 1 10 1

200 20010 10

0.813 0.173 0.986

P P X XP X P X

f f

Bernoulli Experiment

Definition 2.3.2 A random experiment is called a Bernoulli experiment if each outcome is classified into exactly one of two distinct categories. These two categories are often called success and failure. If a Bernoulli experiment is repeated several times in such a way that the probability of a success does not change from one iteration to the next, the experiments are said to be independent. A sequence of n Bernoulli trials is a sequence of n independent Bernoulli experiments.

Binomial Distribution

Definition 2.3.3 Consider a random experiment that meets the following requirements:

1. A sequence of n Bernoulli trials is performed2. The probability of a success in any one trial is p

Define the random variableX = the number of successes in the n trials

Binomial Distribution

Definition 2.3.3 (continued) Then X has a binomial distribution and its p.m.f. is

– The numbers n and p are the parameters of the distribution

– The phrase “X is b(n, p)” means the variable X has a binomial distribution with parameters n and p

( ) ( ) (1 ) , 0,1, ,x n xnf x P X x p p x n

x

Example 2.3.4

If a family with nine children is randomly chosen, find the probability of selecting a family with exactly four boys.– Let X = the number of boys in the family– X is b(9, 0.5)

4 9 49( 4) (4) 0.5 (1 0.5) 0.246

4P X f

Unusual Events

Unusual Event Principle: If we make an assumption (or a claim) about a random experiment, and then observe an event with a very small probability based on that assumption (called an “unusual event”), then we conclude that the assumption is most likely incorrect.

Unusual Events

Unusual Event Guideline: If X is b(n, p) and represents the number of successes in a random experiment, then an observed event consisting of exactly x successes is considered “unusual” if

( ) 0.05 or ( ) 0.05P X x P X x

Example 2.3.7

Suppose a university student body consists of 70% females. To discuss ways of improving dormitory policies, the President selects a panel of 15 students. He claims to have randomly selected the students, however, one administrator questions this claim because there are only five females on the panel. Use the rare event principle to test the claim of randomness.

Example 2.3.7

• Let X = number of females on the panel of 15 • If randomly selected, then X would be

approximately b(15, 0.7)

• Conclusion: Reject the claim of randomness

( 5) ( 0) ( 5)0 0 0 0 0.0006 0.0030.0036 0.05

P X P X P X

2.4 – The Poisson Distribution

Definition 2.4.1 A random variable X has a Poisson distribution if its p.m.f. is

where λ > 0 is a constant.– Describes the number of “occurrences” over a

randomly selected “interval”– The parameter λ is the “average” number of

occurrences per interval

( ) ( ) , 0,1,!

x

f x P X x e xx

Example 2.4.1

Suppose a 1000 ft2 lawn contains 3000 dandelions. Find the probability that a randomly chosen 1 ft2 section of lawn contains exactly five dandelions.– “Occurrence” = dandelion – “Interval” = 1 ft2 section of lawn– X = number of dandelions in a 1 ft2 section of

lawn– Assume X is Poisson

Example 2.4.1

22

3000 dandelions 3 dandelions/ft1000 ft

533( 5) 0.101

5!P X e

2.5 – Mean and Variance

Definition 2.5.1 The mean (or expected value) of a discrete random variable X with range R and p.m.f. f (x) is

provided this series converges absolutely

( ) ( )x R

E X x f x

Variance

Definition 2.5.2 The variance of a discrete random variable X with range R and p.m.f. f (x) is

provided this series converges absolutely. The standard deviation of X, denoted σ, is the square-root of the variance

2 2( ) ( ) ( )x R

Var X x f x

Example 2.5.2

The p.m.f. for a random variable X is

Mean

0(0.19) 1(0.35) 2(0.33) 3(0.13) 1.4

Example 2.5.2

Variance

Example 2.5.3

Consider a random variable X with range R = {1, 2,…, k} and p.m.f. f (x) = 1/k

(X has a uniform distribution)Mean:

1 1

1 1 1 ( 1) 1( ) ( )2 2

k k

x R x x

k k kE X x f x x xk k k

Example 2.5.3

Variance:2 2 2 ( )

x R

x f x

Alternate Formula :

2 2 2

1 1

1 1 1 ( 1)(2 1) ( 1)(2 1)( )6 6

k k

x R x x

k k k k kx f x x xk k k

2 2 2

1

2 2

2

( )

( 1)(2 1) 1 2( 1)(2 1) 3( 1)6 2 12

( 1) 2(2 1) 3( 1) ( 1)( 1) 112 12 12

k

x

x f x

k k k k k k

k k k k k k

2.6 – Functions of a Random Variable

Example 2.6.1: Suppose a man is injured in a car wreck. The doctor tells him that he needs to spend between one and four days in the hospital and that if X is the number of days, its distribution is given below

Example 2.6.1

The man’s supplemental insurance policy will give him $500 plus $100 per day in the hospital to cover expenses. How much should the man expect to get from the insurance company?– Y = amount received from the insurance company

500 100Y X

Example 2.6.1

• Note

500 100P Y x P X x f x

( ) 600(0.3) 700(0.4) 800(0.2) 900(0.1)[500 100(1)] (1) [500 100(4)] (4)710

E Yf f

Mathematical Expectation

Definition 2.6.1 Let X be a discrete random variable with range R and p.m.f. f(x). Also let u(X) be a function of X. The mathematical expectation or the expected value of u(X) is

provided this series converges absolutely

( ) ( ) ( )x R

E u X u x f x

Example 2.6.2

Let X be a random variable with distribution

2 2

2 2 2

2 2

2 2 2

( )

( 2) (0.25) (1) (0.5) (5) (0.25) 7.75

b. ( 1) ( 1) ( )

( 2 1) (0.25) (1 1) (0.5) (5 1) (0.25) 6.2

a.

5

x R

x R

E X x f x

E X x f x

Properties

Theorem 2.6.1 Let X be a discrete random. Whenever the expectations exist, the following three properties hold:

1 2 1

1

2

1 2 2 1

1. If is a constant, then

2. If is a constant and ( ) is a function of , then

3. If and are constants, and ( ) and ( ) are functions of

( , the

) )n

(

E a a

E au X aE u X

E a u X a u X a E

a

a u X X

a a u X u XX

u

1 2 2( ) ( )X a E u X

Example 2.6.3

Let X be a random variable with distribution

2 2

2 0.25 1 0.5 5 0.25 1.25

. 3 4 3 4 3 4 3 1.25 4 7.75

. [ ( 2)] 2 2 [ ] 7.75 2.5 10.2

.

5

E X

b E X E X E E X

c E X X E X X E E X

a

X

2.7 – Moment-Generating Function

Definition 2.7.1 Let X be a discrete random variable with p.m.f f(x) and range R. The moment-generating function (m.g.f.) of X is

for all values of t for which this mathematical expectation exists.

( ) ( )tX tx

x R

M t E e e f x

Example 2.7.1

Consider a random variable X with range R = {2, 5} and p.m.f. f (2) = 0.25, f (5) = 0.75

Its m.g.f. is2 5( ) (0.25) (0.75)t tM t e e

Theorem 2.7.1

If X is a random variable and its m.g.f. M(t) exists for all t in an open interval containing 0, then

2

uniquely determines the distribution of and

2. ' 0

1. ( )

and ''(0)

X

M E X

t

M X

M

E

Uses of m.g.f.

1. If we know the m.g.f. of a random variable, then we can use the first and second derivatives to find the mean and variance of the variable.

2. If we can show that two random variables have the same m.g.f., then we can conclude that they have the same distribution.

Example 2.7.3

Consider a random variable X with a binomial distribution. Its p.m.f. is

where

( ) , 0,1, ,x n xnf x p q x n

x

Example 2.7.3

1. Find the m.g.f.

0

( )n

n k n k

k

na b a b

k

Binomial Theorem :

0

0

( )n

tX tx x n x

x

n xt n x

x

nt

nM t E e e p q

x

npe q

x

q pe

Example 2.7.3

2. Find M’ and M’’

3. Find mean

1

22 1

( )

''( ) ( 1)

nt t

n nt t t t

M t n q pe pe

M t n n q pe pe n q pe pe

10 0

1

( ) (0)n

n

E X M n q pe pe

n q p p np

Example 2.7.3

4. Find variance

2 2 2 2

2 2 1 2

2 2

(0)

( 1)( ) ( ) ( )

( 1) ( )

1 1

1

n n

E X M

n n q p p n q p p np

n n p np np

np n p np

np p npq

Recommended