ch 5 probability: thech 5 probability: the mathematics of ...mduan/stat3411/ch5_1.pdf ·...

35
Ch 5 Probability: The Ch 5 Probability: The Mathematics of Randomness

Upload: others

Post on 18-Oct-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Ch 5 Probability: TheCh 5 Probability: The Mathematics of ...mduan/stat3411/ch5_1.pdf · Mathematics of Randomness. 5.1.1 Random Variables and Their Distributions • A random variable

Ch 5 Probability: TheCh 5 Probability: The Mathematics of Randomness

Page 2: Ch 5 Probability: TheCh 5 Probability: The Mathematics of ...mduan/stat3411/ch5_1.pdf · Mathematics of Randomness. 5.1.1 Random Variables and Their Distributions • A random variable

5.1.1 Random Variables and Their Distributions

• A random variable is a quantity that (prior to observation) can be thought of as dependent ) g pon chance phenomena.

Toss a coin 10 times

X=# of heads

T i til h dToss a coin until a head

X=# of tosses needed

Page 3: Ch 5 Probability: TheCh 5 Probability: The Mathematics of ...mduan/stat3411/ch5_1.pdf · Mathematics of Randomness. 5.1.1 Random Variables and Their Distributions • A random variable

More random variablesMore random variablesToss a dieToss a die

X=points showing

Plant 100 seeds of pumpkinsX % germinatingX=% germinating

T li h b lbTest a light bulbX=lifetime of bulb

Test 20 light bulbsX=average lifetime of bulbs

Page 4: Ch 5 Probability: TheCh 5 Probability: The Mathematics of ...mduan/stat3411/ch5_1.pdf · Mathematics of Randomness. 5.1.1 Random Variables and Their Distributions • A random variable

Types of Random VariableTypes of Random Variable

• A discrete random variable is one that has isolated or separated possible values.

(Counts, finite‐possible values)

• A continuous random variable is one that can be idealized as having an entire (continuous) interval of numbers as its set of possible values.

(Lifetimes, time, compression strength 0 infinity)

Page 5: Ch 5 Probability: TheCh 5 Probability: The Mathematics of ...mduan/stat3411/ch5_1.pdf · Mathematics of Randomness. 5.1.1 Random Variables and Their Distributions • A random variable

Probability Distributiony• To specify a probability distribution for a random

variable is to give its set of possible values and (in one h ) l b bway or another) consistently assign numbers between

0 and 1 –called probabilities– as measures of the likelihood that be various numerical values will occur.likelihood that be various numerical values will occur.

• It is basically a rule of assigning probabilities to random y g g pevents.

Roll a die, X=# showing

x 1 2 3 4 5 6f(x) 1/6 1/6 1/6 1/6 1/6 1/6

Page 6: Ch 5 Probability: TheCh 5 Probability: The Mathematics of ...mduan/stat3411/ch5_1.pdf · Mathematics of Randomness. 5.1.1 Random Variables and Their Distributions • A random variable

Probability DistributionProbability Distribution

h l f b bili di ib iThe values of a probability distribution must be numbers on the interval from 0 to 1.

The sum of all the values of a probability distribution must be equal to 1distribution must be equal to 1.

Page 7: Ch 5 Probability: TheCh 5 Probability: The Mathematics of ...mduan/stat3411/ch5_1.pdf · Mathematics of Randomness. 5.1.1 Random Variables and Their Distributions • A random variable

ExampleExample

Inspect 3 parts. Let X be the # of parts with defect.

Find the probability distribution of X.

First, what are possible values of X?, p

(0, 1,2,3)

Page 8: Ch 5 Probability: TheCh 5 Probability: The Mathematics of ...mduan/stat3411/ch5_1.pdf · Mathematics of Randomness. 5.1.1 Random Variables and Their Distributions • A random variable

When does X take on each value?When does X take on each value?

OOutcome X{NNN} 0 {NND, NDN, DNN} 1{NDD, DND, DDN} 2{NDD, DND, DDN} 2{DDD} 3

• If P(D)=0. 5, then P(N)=0.5 We have x 0 1 2 3

f(x)=P(X=x) 1/8 3/8 3/8 1/8

Page 9: Ch 5 Probability: TheCh 5 Probability: The Mathematics of ...mduan/stat3411/ch5_1.pdf · Mathematics of Randomness. 5.1.1 Random Variables and Their Distributions • A random variable

Cumulative Distribution FunctionCumulative Distribution Function

l i di ib i ( ) f d• Cumulative distribution F(x) of a random variable X is

( ) ( )F x P X x= ≤

• Since (for discrete distributions) probabilities l l b l f f( ) fare calculated by summing values of f(x), for a

discrete distribution

( ) ( )F x P X x≤( ) ( )F x P X x= ≤

Page 10: Ch 5 Probability: TheCh 5 Probability: The Mathematics of ...mduan/stat3411/ch5_1.pdf · Mathematics of Randomness. 5.1.1 Random Variables and Their Distributions • A random variable

“Defect” Example continuedDefect Example continued

W h dWe had f(0)=1/8, f(1)=f(2)=3/8, f(3)=1/8.

Therefore

0, 0;x<

• F(0)=f(0)=1/8;

• F(1)=f(0)+f(1)=1/8+3/8=1/2;

= 1/2,1/8,

F(x) 2;x11;x0

<≤<≤

• F(2)=f(0)+f(1)+f(2)=7/8;

• F(3)=f(0)+f(1)+f(2)+f(3)=1.

1,7/8,

3.x3;x2

≥<≤

Page 11: Ch 5 Probability: TheCh 5 Probability: The Mathematics of ...mduan/stat3411/ch5_1.pdf · Mathematics of Randomness. 5.1.1 Random Variables and Their Distributions • A random variable

Summaries of Discrete Probability Distributions

Given a set of numbers, for example,

S= {1, 1, 1, 1, 3, 3, 4, 5, 5 , 6 }

To calculate the average of these 10 numbers, you can use

31030

106554331111

==++++++++++

Or you can get it this way

10(6)(1)(5)(2)(4)(1)(3)(2)(1)(4) ++++

3

)101(6)()

102(5)()

101(4)()

102(3)()

104(1)(

=

++++=

3.=

Page 12: Ch 5 Probability: TheCh 5 Probability: The Mathematics of ...mduan/stat3411/ch5_1.pdf · Mathematics of Randomness. 5.1.1 Random Variables and Their Distributions • A random variable

Mean or ExpectationMean or Expectation

Th b l i h i h d f lThe above result is the weighted sum of x values:

x 1 3 4 5 6x 1 3 4 5 6Weights 4/10 2/10 1/10 2/10 1/10f(x) 0 4 0 2 0 1 0 2 0 1f(x) 0.4 0.2 0.1 0.2 0.1

The weights are actually the probability distribution for a randomThe weights are actually the probability distribution for a random variable X .

The weighted sum, 3, is called the mean or mathematical expectation of random variable X.

Page 13: Ch 5 Probability: TheCh 5 Probability: The Mathematics of ...mduan/stat3411/ch5_1.pdf · Mathematics of Randomness. 5.1.1 Random Variables and Their Distributions • A random variable

DefinitionDefinition

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

∑==x

xf(x)E(X) µ

The expectation or mean of a random variable X is the long run average of the observations from thethe long run average of the observations from the random variable X.

The mean of X is not necessarily a possible value for X.

Page 14: Ch 5 Probability: TheCh 5 Probability: The Mathematics of ...mduan/stat3411/ch5_1.pdf · Mathematics of Randomness. 5.1.1 Random Variables and Their Distributions • A random variable

Back to “defect” exampleBack to defect example

• What is the average number of defective items we expect to see?pX f(x)

0 1/80 1/8

1 3/8

2 3/8

3 1/8

1 3 3 1 3( ) ( ) 0 1 2 3E X x f xµ = = = × + × + × + × =∑( ) ( ) 0 1 2 38 8 8 8 2

E X x f xµ = = = × + × + × + × =∑

Page 15: Ch 5 Probability: TheCh 5 Probability: The Mathematics of ...mduan/stat3411/ch5_1.pdf · Mathematics of Randomness. 5.1.1 Random Variables and Their Distributions • A random variable

VarianceVariance

Th i f th t f• The mean is a measure of the center of a random variable or distributionX: x= ‐1 0 1

f(x) ¼ ½ ¼

Y: y= ‐2 0 2 g(y) ¼ ½ ¼

Both variables have the same center: 0

Which has a larger variability?

Page 16: Ch 5 Probability: TheCh 5 Probability: The Mathematics of ...mduan/stat3411/ch5_1.pdf · Mathematics of Randomness. 5.1.1 Random Variables and Their Distributions • A random variable

VarianceVariance

D i i f h ( )• Deviation from the center (mean)X−µX

The average of X−µX is zero!

• Consider the weighted average of (X−µX)2

E(X−0)2=(1)(1/4)+(0)(1/2)+(1)(1/4)=1/2 E(Y−0)2=(4)(1/4)+(0)(1/2)+(4)(1/4)=2

Y is more variable!

Page 17: Ch 5 Probability: TheCh 5 Probability: The Mathematics of ...mduan/stat3411/ch5_1.pdf · Mathematics of Randomness. 5.1.1 Random Variables and Their Distributions • A random variable

Definition• Let X be a discrete random variable with probability

distribution f(x) and mean µdistribution f(x) and mean µ

h i f i• The variance of X is

f( ))(])E[(X 222 ∑ f(x)µ)(x]µ)E[(X σx

22 ∑ −=−=

The positive square root of the σ2 is called standard deviation of X, denoted by σ.

Page 18: Ch 5 Probability: TheCh 5 Probability: The Mathematics of ...mduan/stat3411/ch5_1.pdf · Mathematics of Randomness. 5.1.1 Random Variables and Their Distributions • A random variable

Back to “defect” exampleBack to defect example

X f(x)

0 1/8

1 3/8

2 3/82 3/8

3 1/8

2 2 2( ) ( ) ( ) ( )Var X E x x f xσ µ µ= = − = −∑2 2 2 2

( ) ( ) ( ) ( )1 3 3 1(0 1.5) (1 1.5) (2 1.5) (3 1.5)8 8 8 8

Var X E x x f xσ µ µ= = − = −

= − × + − × + − × + − ×

∑( ) ( ) ( ) ( )

8 8 8 8

Page 19: Ch 5 Probability: TheCh 5 Probability: The Mathematics of ...mduan/stat3411/ch5_1.pdf · Mathematics of Randomness. 5.1.1 Random Variables and Their Distributions • A random variable

1 3 3 12 2 2 2 2

2 2 2 2

1 3 3 1( ) 0 1 2 3 38 8 8 8

( ) ( )

E X = × + × + × + × =

2 2 2 2

2

( ) ( ) 3 1.5 0.75

0.75

Var X E Xσ µ

σ σ

= = − = − =

= =

Page 20: Ch 5 Probability: TheCh 5 Probability: The Mathematics of ...mduan/stat3411/ch5_1.pdf · Mathematics of Randomness. 5.1.1 Random Variables and Their Distributions • A random variable

Binomial Distribution

I li d blIn many applied problems, we are interested in the probability that an event p ywill occur x times out of n.

Page 21: Ch 5 Probability: TheCh 5 Probability: The Mathematics of ...mduan/stat3411/ch5_1.pdf · Mathematics of Randomness. 5.1.1 Random Variables and Their Distributions • A random variable

For examplepInspect 3 items. X=# of defects.

D d f t N t d f t S P(N) 5/6D=a defect, N=not a defect, Suppose P(N)=5/6

No defect: (x=0)( )NNN (5/6)(5/6)(5/6)

One defect: (x=1)NND (5/6)(5/6)(1/6)NND (5/6)(5/6)(1/6) NDN same DNN same

Two defect: (x=2)Two defect: (x=2)NDD (5/6)(1/6)(1/6)DND sameDDN sameDDN same

Three defect: (x=3)DDD (1/6)(1/6)(1/6)

Page 22: Ch 5 Probability: TheCh 5 Probability: The Mathematics of ...mduan/stat3411/ch5_1.pdf · Mathematics of Randomness. 5.1.1 Random Variables and Their Distributions • A random variable

Binomial distribution• x f(x)

0 (5/6)3How many ways to0 (5/6)

1 3(1/6)(5/6)2

How many ways to choose x of 3 places for D

__ __ __

2 3(1/6)2(5/6)

3 (1/6)33 (1/6)xx

xf−

=

3

65

613

)(x

66

f [1‐P(D)]3‐ # of D[P(D)]# of D [1 P(D)]

Page 23: Ch 5 Probability: TheCh 5 Probability: The Mathematics of ...mduan/stat3411/ch5_1.pdf · Mathematics of Randomness. 5.1.1 Random Variables and Their Distributions • A random variable

In general: n independent trialsg p

p probability of a success

# fx=# of successes

ways to choose x places for sn ways to choose x places for s,x

n

( ) (1 )x n xnf x p p

x−

= −

Page 24: Ch 5 Probability: TheCh 5 Probability: The Mathematics of ...mduan/stat3411/ch5_1.pdf · Mathematics of Randomness. 5.1.1 Random Variables and Their Distributions • A random variable

• Roll a die 20 times. X=# of 6’s,n=20 p=1/6n=20, p=1/6

2020 1 5( )6 6

x x

f xx

− = 4 16

6 6

20 1 5( 4)

x

p x

= =

• Flip a fair coin 10 times X=# of heads

( 4)4 6 6

p x

Flip a fair coin 10 times. X=# of heads

1010 1101110 − xx

2110

21

2110

)(

=

=

xxxf

Page 25: Ch 5 Probability: TheCh 5 Probability: The Mathematics of ...mduan/stat3411/ch5_1.pdf · Mathematics of Randomness. 5.1.1 Random Variables and Their Distributions • A random variable

More example

• Pumpkin seeds germinate with probability 0.93. Plant n=50 seeds

• X= # of seeds germinating

( ) ( ) xxxf −

= 5007093050

)( ( ) ( )x

xf

= 07.093.0)(

0 ( ) ( )248 07.093.04850

)48(

==XP

Page 26: Ch 5 Probability: TheCh 5 Probability: The Mathematics of ...mduan/stat3411/ch5_1.pdf · Mathematics of Randomness. 5.1.1 Random Variables and Their Distributions • A random variable

Mean of Binomial DistributionMean of Binomial Distribution

X # f d f t i 3 it• X=# of defects in 3 itemsx f(x)0 (5/6)3

1 3(1/6)(5/6)2( / )( / )2 3(1/6)2(5/6) 3 (1/6)33 (1/6)

E t d l f X?Expected long run average of X?

Page 27: Ch 5 Probability: TheCh 5 Probability: The Mathematics of ...mduan/stat3411/ch5_1.pdf · Mathematics of Randomness. 5.1.1 Random Variables and Their Distributions • A random variable

The mean of a binomial distribution

• Binomial distribution• Binomial distributionn= # of trials,

b bili f h i lp=probability of success on each trialX=# of successes

( ) (1 )x n xn ∑( ) (1 )x n xE x x p p npx

µ − = = − =

Page 28: Ch 5 Probability: TheCh 5 Probability: The Mathematics of ...mduan/stat3411/ch5_1.pdf · Mathematics of Randomness. 5.1.1 Random Variables and Their Distributions • A random variable

L ’ h k hi• Let’s check this. 33 3 1 5x x− 3

0

3 2 2 3

3 1 5( ) ( )6 6X

xE X x f x x

=

= = =

∑ ∑3 2 2 35 1 5 1 5 10* 1*3 2*3 3* 1/ 2

6 6 6 6 6 6 = + + + =

• Use binomial mean formula

( ) (1 ) 3*1/ 6 1/ 2x n xnE x x p p npµ −

= = − = = = ∑( ) (1 ) 3 1/ 6 1/ 2E x x p p npx

µ

Page 29: Ch 5 Probability: TheCh 5 Probability: The Mathematics of ...mduan/stat3411/ch5_1.pdf · Mathematics of Randomness. 5.1.1 Random Variables and Their Distributions • A random variable

More examplesMore examples

• Toss a die n=60 times, X=# of 6’s

known that p=1/6known that p 1/6

μ=μX =E(X)=np=(60)(1/6)=10

We expect to get 10 6’sWe expect to get 10 6 s.

Page 30: Ch 5 Probability: TheCh 5 Probability: The Mathematics of ...mduan/stat3411/ch5_1.pdf · Mathematics of Randomness. 5.1.1 Random Variables and Their Distributions • A random variable

Variance for Binomial distributionVariance for Binomial distribution

• σ2=np(1-p) where n is # of trials and p is probability ofwhere n is # of trials and p is probability of a success.F h i l 3 1/6• From the previous example, n=3, p=1/6Then e

σ2=np(1-p)=3*1/6*(1-1/6)=5/12

Page 31: Ch 5 Probability: TheCh 5 Probability: The Mathematics of ...mduan/stat3411/ch5_1.pdf · Mathematics of Randomness. 5.1.1 Random Variables and Their Distributions • A random variable
Page 32: Ch 5 Probability: TheCh 5 Probability: The Mathematics of ...mduan/stat3411/ch5_1.pdf · Mathematics of Randomness. 5.1.1 Random Variables and Their Distributions • A random variable
Page 33: Ch 5 Probability: TheCh 5 Probability: The Mathematics of ...mduan/stat3411/ch5_1.pdf · Mathematics of Randomness. 5.1.1 Random Variables and Their Distributions • A random variable

5 1 5 Poisson Distribution5.1.5 Poisson Distribution

Page 34: Ch 5 Probability: TheCh 5 Probability: The Mathematics of ...mduan/stat3411/ch5_1.pdf · Mathematics of Randomness. 5.1.1 Random Variables and Their Distributions • A random variable
Page 35: Ch 5 Probability: TheCh 5 Probability: The Mathematics of ...mduan/stat3411/ch5_1.pdf · Mathematics of Randomness. 5.1.1 Random Variables and Their Distributions • A random variable