random variables numerical quantities whose values are determine by the outcome of a random...

63
Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

Upload: myron-tucker

Post on 12-Jan-2016

217 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

Random Variables

Numerical Quantities whose values are determine by the outcome of a random

experiment

Page 2: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

Discrete Random VariablesDiscrete Random Variable: A random variable usually assuming an integer value.

• a discrete random variable assumes values that are isolated points along the real line. That is neighbouring values are not “possible values” for a discrete random variable

Note: Usually associated with counting

• The number of times a head occurs in 10 tosses of a coin

• The number of auto accidents occurring on a weekend

• The size of a family

Page 3: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

Continuous Random Variables

Continuous Random Variable: A quantitative random variable that can vary over a continuum

• A continuous random variable can assume any value along a line interval, including every possible value between any two points on the line

Note: Usually associated with a measurement

• Blood Pressure

• Weight gain

• Height

Page 4: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

Probability Distributionsof a Discrete Random Variable

Page 5: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

Probability Distribution & Function

Probability Distribution: A mathematical description of how probabilities are distributed with each of the possible values of a random variable.

Notes: The probability distribution allows one to determine probabilities

of events related to the values of a random variable. The probability distribution may be presented in the form of a

table, chart, formula.

Probability Function: A rule that assigns probabilities to the values of the random variable

Page 6: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

Comments:Every probability function must satisfy:

1)(0 xp

1. The probability assigned to each value of the random variable must be between 0 and 1, inclusive:

x

xp

1)(

2. The sum of the probabilities assigned to all the values of the random variable must equal 1:

b

ax

xpbXaP )(3.

)()1()( bpapap

Page 7: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

Mean and Variance of aDiscrete Probability Distribution

• Describe the center and spread of a probability distribution

• The mean (denoted by greek letter (mu)), measures the centre of the distribution.

• The variance (2) and the standard deviation () measure the spread of the distribution.

is the greek letter for s.

Page 8: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

Mean of a Discrete Random Variable• The mean, , of a discrete random variable x is found by

multiplying each possible value of x by its own probability and then adding all the products together:

Notes: The mean is a weighted average of the values of X.

x

xxp

kk xpxxpxxpx 2211

The mean is the long-run average value of the random variable.

The mean is centre of gravity of the probability distribution of the random variable

Page 9: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

-

0.1

0.2

0.3

1 2 3 4 5 6 7 8 9 10 11

Page 10: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

2

Variance and Standard DeviationVariance of a Discrete Random Variable: Variance, 2, of a discrete random variable x is found by multiplying each possible value of the squared deviation from the mean, (x )2, by its own probability and then adding all the products together:

Standard Deviation of a Discrete Random Variable: The positive square root of the variance:

x

xpx 22

2

2

xx

xxpxpx

22 x

xpx

Page 11: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

Example

The number of individuals, X, on base when a home run is hit ranges in value from 0 to 3.

x p (x ) xp(x) x 2 x 2 p(x)

0 0.429 0.000 0 0.0001 0.286 0.286 1 0.2862 0.214 0.429 4 0.8573 0.071 0.214 9 0.643

Total 1.000 0.929 1.786

)(xp )(xxp )(2 xpx

Page 12: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

• Computing the mean:

Note:

• 0.929 is the long-run average value of the random variable

• 0.929 is the centre of gravity value of the probability distribution of the random variable

929.0x

xxp

Page 13: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

• Computing the variance:

x

xpx 22

2

2

xx

xxpxpx

923.0929.786.1 2

• Computing the standard deviation:

2

961.0923.0

Page 14: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

The Binomial distribution1. We have an experiment with two outcomes –

Success(S) and Failure(F).

2. Let p denote the probability of S (Success).

3. In this case q=1-p denotes the probability of Failure(F).

4. This experiment is repeated n times independently.

5. X denote the number of successes occuring in the n repititions.

Page 15: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

The possible values of X are

0, 1, 2, 3, 4, … , (n – 2), (n – 1), n

and p(x) for any of the above values of x is given by:

xnxxnx qpx

npp

x

nxp

1

X is said to have the Binomial distribution with parameters n and p.

Page 16: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

Summary:

X is said to have the Binomial distribution with parameters n and p.

1. X is the number of successes occurring in the n repetitions of a Success-Failure Experiment.

2. The probability of success is p.

3. The probability function

xnx ppx

nxp

1

Page 17: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

Example:

1. A coin is tossed n = 5 times. X is the number of heads occurring in the 5 tosses of the coin. In this case p = ½ and

3215

215

21

21

555

xxxxp xx

x 0 1 2 3 4 5

p(x)321

325

325

321

3210

3210

Page 18: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

Note:

5 5!

! 5 !x x x

5 5!

10 0! 5 0 !

5 5! 5!

51 1! 5 1 ! 4!

5 5 45!10

2 2!3! 2 1

5 5 45!10

3 3!2! 2 1

5 5!5

4 4!1!

5 5!1

5 0!5!

Page 19: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

0.0

0.1

0.2

0.3

0.4

1 2 3 4 5 6

number of heads

p(x

)

Page 20: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

Computing the summary parameters for the distribution – , 2,

x p (x ) xp(x) x 2 x 2 p(x)

0 0.03125 0.000 0 0.0001 0.15625 0.156 1 0.1562 0.31250 0.625 4 1.2503 0.31250 0.938 9 2.8134 0.15625 0.625 16 2.5005 0.03125 0.156 25 0.781

Total 1.000 2.500 7.500

)(xp )(xxp )(2 xpx

Page 21: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

• Computing the mean:

5.2x

xxp

• Computing the variance:

x

xpx 22

2

2

xx

xxpxpx

25.15.25.7 2

• Computing the standard deviation:

2

118.125.1

Page 22: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

Example:• A surgeon performs a difficult operation n =

10 times.

• X is the number of times that the operation is a success.

• The success rate for the operation is 80%. In this case p = 0.80 and

• X has a Binomial distribution with n = 10 and p = 0.80.

Page 23: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

xx

xxp

1020.080.0

10

x 0 1 2 3 4 5p (x ) 0.0000 0.0000 0.0001 0.0008 0.0055 0.0264

x 6 7 8 9 10p (x ) 0.0881 0.2013 0.3020 0.2684 0.1074

Computing p(x) for x = 1, 2, 3, … , 10

Page 24: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

The Graph

-

0.1

0.2

0.3

0.4

0 1 2 3 4 5 6 7 8 9 10

Number of successes, x

p(x

)

Page 25: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

Computing the summary parameters for the distribution – , 2,

)(xxp )(2 xpx

x p (x ) xp(x) x 2 x 2 p(x)

0 0.0000 0.000 0 0.0001 0.0000 0.000 1 0.0002 0.0001 0.000 4 0.0003 0.0008 0.002 9 0.0074 0.0055 0.022 16 0.0885 0.0264 0.132 25 0.6616 0.0881 0.528 36 3.1717 0.2013 1.409 49 9.8658 0.3020 2.416 64 19.3279 0.2684 2.416 81 21.743

10 0.1074 1.074 100 10.737Total 1.000 8.000 65.600

Page 26: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

• Computing the mean:

0.8x

xxp

• Computing the variance:

x

xpx 22

2

2

xx

xxpxpx

60.10.86.65 2

• Computing the standard deviation:

2 118.125.1

Page 27: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

Notes The value of many binomial probabilities are found in Tables posted

on the Stats 244 site.

The value that is tabulated for n = 1, 2, 3, …,20; 25 and various values of p is:

Hence

c

x

c

x

xx xpppx

ncXP

00

101

cpppp 210

1for valueTabledfor valueTabled cccp The other table, tabulates p(x). Thus when using this

table you will have to sum up the values

Page 28: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

Example Suppose n = 8 and p = 0.70 and we want to compute

P[X = 5] = p(5)

Table value for n = 8, p = 0.70 and c =5 is 0.448 = P[X 5]

P[X = 5] = p(5) = P[X 5] - P[X 4] = 0.448 – 0.194 = .254

c 0.05 0.10 0.20 0.30 0.40 0.50 0.60 0.70 0.80 0.90 0.95

n = 5 0 0.663 0.430 0.168 0.058 0.017 0.004 0.001 0.000 0.000 0.000 0.000

1 0.943 0.813 0.503 0.255 0.106 0.035 0.009 0.001 0.000 0.000 0.000

2 0.994 0.962 0.797 0.552 0.315 0.145 0.050 0.011 0.001 0.000 0.000

3 1.000 0.995 0.944 0.806 0.594 0.363 0.174 0.058 0.010 0.000 0.000

4 1.000 1.000 0.990 0.942 0.826 0.637 0.406 0.194 0.056 0.005 0.000

5 1.000 1.000 0.999 0.989 0.950 0.855 0.685 0.448 0.203 0.038 0.006

6 1.000 1.000 1.000 0.999 0.991 0.965 0.894 0.745 0.497 0.187 0.057

7 1.000 1.000 1.000 1.000 0.999 0.996 0.983 0.942 0.832 0.570 0.337

8 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000

Page 29: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

We can also compute Binomial probabilities using Excel

=BINOMDIST(x, n, p, FALSE)

The function

will compute p(x).

=BINOMDIST(c, n, p, TRUE)

The function

will compute

c

x

c

x

xx xpppx

ncXP

00

101

cpppp 210

Page 30: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

Mean,Variance & Standard Deviation

• The mean, variance and standard deviation of the binomial distribution can be found by using the following three formulas:

np 1.

pnpnpq 1 2. 2

pnpnpq 1 3.

Page 31: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

Solutions:

1) n = 20, p = 0.75, q = 1 - 0.75 = 0.25

np ( )(0. )20 75 15

npq ( )(0. )(0. ) . .20 75 25 375 1936

ExampleExample: Find the mean and standard deviation of the

binomial distribution when n = 20 and p = 0.75

p xx

xx x( ) (0. ) (0. )

2075 25 20 for 0, 1, 2, ... , 20

2)These values can also be calculated using the probability function:

Page 32: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

Table of probabilitiesx p (x ) xp(x) x 2 x 2 p(x)

0 0.0000 0.000 0 0.0001 0.0000 0.000 1 0.0002 0.0000 0.000 4 0.0003 0.0000 0.000 9 0.0004 0.0000 0.000 16 0.0005 0.0000 0.000 25 0.0006 0.0000 0.000 36 0.0017 0.0002 0.001 49 0.0088 0.0008 0.006 64 0.0489 0.0030 0.027 81 0.24410 0.0099 0.099 100 0.99211 0.0271 0.298 121 3.27412 0.0609 0.731 144 8.76813 0.1124 1.461 169 18.99714 0.1686 2.361 196 33.04715 0.2023 3.035 225 45.52516 0.1897 3.035 256 48.55917 0.1339 2.276 289 38.69618 0.0669 1.205 324 21.69119 0.0211 0.402 361 7.63220 0.0032 0.063 400 1.268

Total 1.000 15.000 228.750

Page 33: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

• Computing the mean:

0.15x

xxp

• Computing the variance:

x

xpx 22

2

2

xx

xxpxpx

75.30.1575.228 2

• Computing the standard deviation:

2 936.175.3

Page 34: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

Histogram

-0.1

0.1

0.2

0.3

no. of successes

p(x)

Page 35: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

Probability Distributionsof Continuous Random Variables

Page 36: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

Probability Density Function The probability distribution of a continuous random variable is describe by probability density curve f(x).

Page 37: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

Notes:

The Total Area under the probability density curve is 1. The Area under the probability density curve is from a to

b is P[a < X < b].

Page 38: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

xa b

P a x b( )

Normal Probability Distributions

Page 39: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

Normal Probability Distributions

• The normal probability distribution is the most important distribution in all of statistics

• Many continuous random variables have normal or approximately normal distributions

Page 40: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

2 3 2 3

The Normal Probability Distribution

Points of Inflection

Page 41: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

Main characteristics of the Normal Distribution

• Bell Shaped, symmetric

• Points of inflection on the bell shaped curve are at – and + That is one standard deviation from the mean

• Area under the bell shaped curve between – and + is approximately 2/3.

• Area under the bell shaped curve between – 2 and + 2is approximately 95%.

Page 42: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

There are many Normal distributions

depending on by and

0

0.01

0.02

0.03

0 50 100 150 200

x

f(x)

0

0.01

0.02

0.03

0 50 100 150 200

x

f(x)

0

0.01

0.02

0.03

0 50 100 150 200

x

f(x)

Normal = 100, = 40 Normal = 140, =20

Normal = 100, =20

Page 43: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

The Standard Normal Distribution = 0, = 1

0

0.1

0.2

0.3

0.4

-3 -2 -1 0 1 2 3

Page 44: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

• There are infinitely many normal probability distributions (differing in and )

• Area under the Normal distribution with mean and standard deviation can be converted to area under the standard normal distribution

• If X has a Normal distribution with mean and standard deviation than has a standard normal distribution

has a standard normal distribution.

• z is called the standard score (z-score) of X.

X

z

Page 45: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

Example: Suppose a man aged 40-45 is selected at random from a population.

• X is the Blood Pressure of the man.

• Assume that X has a Normal distribution with mean =180 and a standard deviation = 15.

• X is random variable.

Page 46: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

The probability density of X is plotted in the graph below.

• Suppose that we are interested in the probability that X between 170 and 210.

Page 47: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

Let

15

180

XXz

667.015

180170170

a

000.215

180210210

b

000.2667.210170 zPXP

Hence

Page 48: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

000.2667.210170 zPXP

Page 49: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

000.2667.210170 zPXP

Page 50: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

Standard Normal DistributionProperties:• The total area under the normal curve is equal to 1

• The distribution is bell-shaped and symmetric; it extends indefinitely in both directions, approaching but never touching the horizontal axis

• The distribution has a mean of 0 and a standard deviation of 1

• The mean divides the area in half, 0.50 on each side

• Nearly all the area is between z = -3.00 and z = 3.00

Notes: Normal Table, Posted on Stats 244 web site, lists the probabilities below a

specific value of z Probabilities of other intervals are found using the table entries, addition,

subtraction, and the properties above

Page 51: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

Table, Posted on stats 244 web site

• The table contains the area under the standard normal curve between - and a specific value of z

0 z0 z

Page 52: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

ExampleFind the area under the standard normal curve between z = - and z = 1.45

9265.0)45.1( zP

• A portion of Table 3:

z 0.00 0.01 0.02 0.03 0.04 0.05 0.06

1.4 0.9265

...

...

0 145.

9265.0

z0 145.

9265.0

z

Page 53: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

P z( 0. ) 98 .01635

ExampleFind the area to the left of -0.98; P(z < -0.98)

00.98

Area asked for

0000.98

Area asked for

0.980.98

Area asked for

Page 54: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

0735.09265.00000.1)45.1( zP

9265.0

145.

Area asked for

0 z

ExampleFind the area under the normal curve to the right of z = 1.45; P(z > 1.45)

Page 55: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

4265.05000.09265.0)45.1( zP

ExampleFind the area to the between z = 0 and of z = 1.45;

P(0 < z < 1.45)

145.0 z

• Area between two points = differences in two tabled areas

Page 56: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

Notes Use the fact that the area above zero and the area below

zero is 0.5000

the area above zero is 0.5000

When finding normal distribution probabilities, a sketch is always helpful

Page 57: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

0 z 126.

Area asked for

3962.01038.05000.0)026.1( zP

Example Example: Find the area between the mean (z = 0) and

z = -1.26

Page 58: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

Example: Find the area between z = -2.30 and z = 1.80

9534.00107.09641.0)80.126.1( zP

0 .. - 2 . 3 0

Area Required

1 . 8 00 .. 0 .. 0 .. - 2 . 3 0

Area Required

1 . 8 0- 2 . 3 0

Area Required Area Required

1 . 8 0

Page 59: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

Example: Find the area between z = -1.40 and z = -0.50

2277.00808.03085.0)50.040.1( zP

Area asked for

-1.40 -0.500

Area asked for

-1.40 -0.50

Area asked for

-1.40 -0.5000

Page 60: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

Computing Areas under the general Normal Distributions

(mean , standard deviation )

1. Convert the random variable, X, to its z-score.

Approach:

3. Convert area under the distribution of X to area under the standard normal distribution.

2. Convert the limits on random variable, X, to their z-scores.

X

z

bz

aPbXaP

Page 61: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

Example

Example: A bottling machine is adjusted to fill bottles with a mean of 32.0 oz of soda and standard deviation of 0.02. Assume the amount of fill is normally

distributed and a bottle is selected at random:

1) Find the probability the bottle contains between 32.00 oz and 32.025 oz

2) Find the probability the bottle contains more than 31.97 oz

When x z 32.0032.00 32.00 32.0

0.00;0.02

Solutions part 1)

When x z

32 02532.025 32 025 32.0

125. ;.

0.02.

Page 62: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

P X PX

P z

( . )0. 0.

.

0.

( . ) .

32.0 32 02532.0 32.0

02

32.0

02

32 025 32.0

02

0 125 0 3944

Graphical Illustration:

0 1 2 5. z3 2 . 0 x3 2 0 2 5.

A r e a a s k e d f o r

0 1 2 5. z0 1 2 5. z3 2 . 0 x3 2 0 2 5.

A r e a a s k e d f o r

3 2 . 0 x3 2 . 0 x3 2 0 2 5.

A r e a a s k e d f o r

3 2 0 2 5.

A r e a a s k e d f o r

Page 63: Random Variables Numerical Quantities whose values are determine by the outcome of a random experiment

P x Px

P z( . ).

( .

. . .

319732.0

0.023197 32.0

0.02150)

1 0000 00668 0 9332

Example, Part 2)

32.03197. x

0150. z32.03197. x32.03197. x

0150. z0150.150. z