Eighth lecture Random Variables. Consider the experiment of tossing a coin twice.. If we are...

25
Eighth lecture Random Variables

Transcript of Eighth lecture Random Variables. Consider the experiment of tossing a coin twice.. If we are...

Page 1: Eighth lecture Random Variables. Consider the experiment of tossing a coin twice.. If we are interested in the number of heads that show on the top face,

Eighth lecture

Random Variables

Page 2: Eighth lecture Random Variables. Consider the experiment of tossing a coin twice.. If we are interested in the number of heads that show on the top face,

Random Variables

Consider the experiment of tossing a coin twice. .If we are interested in the number of heads that

show on the top face, describe the sample space.

Solution:S={ HH , HT , TH , TT } 2 1 1 0

w

S X(w) R

Page 3: Eighth lecture Random Variables. Consider the experiment of tossing a coin twice.. If we are interested in the number of heads that show on the top face,

Random Variables

Definition (1):A random variable is a function that associates a real number with each element in the sample space.

Remark:We shall use a capital letter, say X, to denote a random variable and its corresponding small letter, x in this case, for one of its values.

Page 4: Eighth lecture Random Variables. Consider the experiment of tossing a coin twice.. If we are interested in the number of heads that show on the top face,

Random Variables

Example (1):Two balls are drawn in succession without replacement from an urn containing 4 red balls and 3 black balls. The possible outcomes and the values y of the random variable Y, where Y is the number of red balls, are

y Sample Space

2 RR

1 RB

1 BR

0 BB

Page 5: Eighth lecture Random Variables. Consider the experiment of tossing a coin twice.. If we are interested in the number of heads that show on the top face,

Random Variables

Example (2):A stockroom clerk returns three safety helmets at random to three steel mill employees who had previously checked them. If Smith, Jones, and Brown, in that order, receive one of the three hats, list the sample points for the possible orders of returning the helmets, and find the value m of the random variable M that represents the number of correct matches.

y Sample Space

3 SJB

1 SBJ

1 BJS

1 JSB

0 JBS

0 BSJ

Solution:If S, J and B stand for Smith’s, Jones’s, and Brown’s helmets, respectively, then the possible arrangements in which the helmets ma be returned and the number of correct matches are

Page 6: Eighth lecture Random Variables. Consider the experiment of tossing a coin twice.. If we are interested in the number of heads that show on the top face,

Random Variables

Example (3):Interest centers around the proportion of people who respond to a certain mail order solicitation. Let X be that proportion. X is a random variable that takes on all values x for which 0 ≤ x ≤ 1.

Example (4):Let X be the random variable defined by the waiting time, in hours, between successive speeders spotted by a rader unit. The random variable X takes on all values x for which x≥ 0.

Page 7: Eighth lecture Random Variables. Consider the experiment of tossing a coin twice.. If we are interested in the number of heads that show on the top face,

Random Variables

Definition (2):If a sample space contains a finite number of possibilities or an unending sequence with as many elements as there are whole numbers , it is called a discrete sample space.

Definition (3):If a sample space contains an infinite number of possibilities equal to the number of points on a line segment, it is called a continuous sample space.

Page 8: Eighth lecture Random Variables. Consider the experiment of tossing a coin twice.. If we are interested in the number of heads that show on the top face,

Random Variables

Types of random variables:1. Discrete random variable.A random variable is called a discrete random variable if its set

of possible outcomes is countable.2. Continuous random variable.A random variable is called a continuous random variable when

can take on values on a continuous scale .Example (5):Classify the following random variables as discrete or continuous:X: the number of automobile accidents per year in Virginia.Y: the length of time to play 18 holes of golf.M: the amount of milk produced yearly by a particular cow.N: the number of eggs laid each month by a hen.P: the number of building permits issued each month in a certain city.Q: the weight of grain produced per acre.

Page 9: Eighth lecture Random Variables. Consider the experiment of tossing a coin twice.. If we are interested in the number of heads that show on the top face,

Random Variables

Discrete Probability Distributions:Definition (4):The set of ordered pairs (x, f(x)) is a probability function, probability mass function, or probability distribution of the discrete random variable X if, for each possible outcome x,1 ( ) 0,

2 ( ) 1,

3 ( ) ( ).x

f x

f x

P X x f x

Example(6):Determine the value c so that each of the following function can serve as a probability distribution of the discrete random variable X:f(x)=c(x2+4), for x= 0,1,2,3.

Page 10: Eighth lecture Random Variables. Consider the experiment of tossing a coin twice.. If we are interested in the number of heads that show on the top face,

Random Variables

Example(7):Let W be a random variable giving the number of heads minus the number of tails in three tosses of a coin. List the elements of the sample space S for the three tosses of the coin and to each sample points assign a value w of W.

Example(8):Find a formula for the probability distribution of the random variable X representing the outcome when a single die is rolled once.

Page 11: Eighth lecture Random Variables. Consider the experiment of tossing a coin twice.. If we are interested in the number of heads that show on the top face,

Random Variables

Definition (5):The cumulative distribution function F(x) of a discrete random variable X with probability distribution f(x) is

( ) ( ) ( ),t x

F x P X x f t for x

Example(9):

If :

Prove that f(x) is a probability mass function?Find the cumulative distribution function of the random variable X.

4

( ) , 0,1,2,3,416

xf x x

4

( ) , 0,1,2,3,416

xf x x

Page 12: Eighth lecture Random Variables. Consider the experiment of tossing a coin twice.. If we are interested in the number of heads that show on the top face,

Random Variables

Continuous Probability Distributions:•A continuous random variable has a probability of zero of assuming exactly any of its values.•Its probability distribution cannot be given in tabular form, it can be stated as a formula f(x), is usually called the probability density function or the density function of X.• A probability density function is constructed so that the area under its curve bounded by the x axis is equal 1 when computed over the range of X for which f(x) is defined.

a b x

f(x)

The probability that X assumes a value between a and b is equal to the shaded area under the density function between the ordinates at x=a and x=b and from integral calculus is given

( ) ( )b

aP a X b f x dx

Page 13: Eighth lecture Random Variables. Consider the experiment of tossing a coin twice.. If we are interested in the number of heads that show on the top face,

Random Variables

Definition (6):The function f(x) is a probability density function for the continuous random variable X, defined over the set of real number R, if 1 ( ) 0,

2 ( ) 1

3 ( ) ( ) .b

a

f x for all x R

f x dx

P a X b f x dx

Example(10):Suppose that the error in the reaction temperature, in oC, for controlled laboratory experiment is a continuous random variable X having the probability density function 2

, 1 2 ( ) 3

0,

xx

f x

elsewhere

(a) Verify condition (2) of Definition(6).(b) Find P(0<X≤1)

Page 14: Eighth lecture Random Variables. Consider the experiment of tossing a coin twice.. If we are interested in the number of heads that show on the top face,

Random Variables

Definition (7):The cumulative distribution function F(x) of a continuous random variable X with density function f(x) is

( ) ( ) ( ) ,x

F x P X x f t dt for x

As an immediate consequence of Definition (7) one can write the two results,

( )( ) ( ) ( ), ( )

dF xP a X b F b F a and f x

dx

If the derivative exists.

Page 15: Eighth lecture Random Variables. Consider the experiment of tossing a coin twice.. If we are interested in the number of heads that show on the top face,

Random Variables

Example(11):For the density function of Example (10) find F(x) and use it to evaluate P(0<X≤1)

2

, 1 2 ( ) 3

0,

xx

f x

elsewhere

Page 16: Eighth lecture Random Variables. Consider the experiment of tossing a coin twice.. If we are interested in the number of heads that show on the top face,

Random Variables

Example(12):The waiting time, in hours, between successive speeders spotted by a radar unit is a continuous random variable with cumulative distribution function

Find the probability of waiting less than 12 minutes between successive speeders(a)Using the cumulative distribution function of X;(b) Using the probability density function of X.

8

0, 0( )

1 , 0x

xF x

e x

Page 17: Eighth lecture Random Variables. Consider the experiment of tossing a coin twice.. If we are interested in the number of heads that show on the top face,

Random Variables

Definition(8):Let X a random variable with probability distribution f(x). The mean or expected value of X is

If X is discrete, and

If X is continuous.

( ) ( )x

E x x f x

( ) ( )E x x f x dx

Example (13):A lot containing 7 components is sampled by a quality inspector; the lot contains 4 good components and 3 defective components. A sample of 3 is taken by the inspector. Find the expected value of the number of good components in this sample.

Page 18: Eighth lecture Random Variables. Consider the experiment of tossing a coin twice.. If we are interested in the number of heads that show on the top face,

Random Variables

Example(14):Let X be the random variable that denotes the life in hours of a certain electronic device. The probability density function is

Find the expected life of this type of device.

3

20,000, 100

( )0,

xf x x

elsewhere

Page 19: Eighth lecture Random Variables. Consider the experiment of tossing a coin twice.. If we are interested in the number of heads that show on the top face,

Random Variables

Definition(9):Let X be a random variable with probability distribution f(x). The expected value of the random variable g(x) is

If X is discrete, and

If X is continuous.

( ) ( ) ( ) ( )g Xx

E g X g x f x

( ) ( ) ( ) ( )g X E g X g x f x dx

Page 20: Eighth lecture Random Variables. Consider the experiment of tossing a coin twice.. If we are interested in the number of heads that show on the top face,

Random Variables

Example (15):Suppose that the number of cars X that pass through a car wash between 4 p.m. and 5 p.m. on any sunny Friday has the following probability distribution:

Let g(X)=2X-1 represent the amount of money in dollars, paid to the attendant by the manager. Find the attendant’s expected earning for this particular time period.

9 8 7 6 5 4 x

1/6 1/6 1/4 1/4 1/12 1/12 P(X=x)

Page 21: Eighth lecture Random Variables. Consider the experiment of tossing a coin twice.. If we are interested in the number of heads that show on the top face,

Random Variables

Definition(8):Let X a random variable with probability distribution f(x) and mean m. The variance of X is if X is discrete, and

if X is continuous.

The positive square root of the variance, , s is called standard deviation of X.

2 2 2( ) ( ) ( )x

E X x f x 2 2 2( ) ( ) ( )E X x f x

Page 22: Eighth lecture Random Variables. Consider the experiment of tossing a coin twice.. If we are interested in the number of heads that show on the top face,

Random Variables

Example(16):Suppose that the number of cars X that pass through a car wash between 4 p.m. and 5 p.m. on any sunny Friday has the following probability distribution:

Find the variance of X.

9 8 7 6 5 4 x

1/6 1/6 1/4 1/4 1/12 1/12 P(X=x)

Page 23: Eighth lecture Random Variables. Consider the experiment of tossing a coin twice.. If we are interested in the number of heads that show on the top face,

Random Variables

2 2 2( )E X

Theorem(1):The variance of a random variable X is

Example(16):Use Theorem (1) to find the variance in Example (15).

Example(17):The weekly demand for Pepsi, in thousand of liters, from a local chain of efficiency stores, is a continuous random variable X having the probability density

Find the mean and the variance of X.

2( 1),1 2( )

0,

x xf x

eleswhere

Page 24: Eighth lecture Random Variables. Consider the experiment of tossing a coin twice.. If we are interested in the number of heads that show on the top face,

Random Variables

Some prosperities of means and variance of random variables:

Theorem(2):If a and b are conestants, then

E(aX+b)=aE(X)+bCorollary(1):Setting a=0, we see that E(b)=bCorollary(2):Setting b=0, we see that E(aX)=aE(X)

Theorem(3):If a and b are conestants, then

s2aX+b=a2s2

XCorollary(1):Setting a=1, we see that s2

X+b=s2X

Corollary(2):Setting b=0, we see that s2

aX=a2s2X

Page 25: Eighth lecture Random Variables. Consider the experiment of tossing a coin twice.. If we are interested in the number of heads that show on the top face,

Random Variables

Example(18):Use the result above to Find the mean of 2X-1 in Example(18).

9 8 7 6 5 4 x

1/6 1/6 1/4 1/4 1/12 1/12 P(X=x)