ch 7 & 8 實習

50
Ch 7 & 8 實實

Upload: koto

Post on 05-Jan-2016

91 views

Category:

Documents


1 download

DESCRIPTION

Ch 7 & 8 實習. Random Variables and Probability Distributions. A random variable is a function or rule that assigns a numerical value to each simple event in a sample space. 為了降低分析的複雜性,將所有可能結果加以數值化 例如投銅板十次,正面出現次數的事件就是 random variable 短期不知道是什麼,長期下來會呈現某種分配 - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Ch 7 & 8  實習

Ch 7 & 8 實習Ch 7 & 8 實習

Page 2: Ch 7 & 8  實習

Jia-Ying Chen2

Random Variables and Probability Distributions

A random variable is a function or rule that assigns a numerical value to each simple event in a sample space. 為了降低分析的複雜性,將所有可能結果加以數值化 例如投銅板十次,正面出現次數的事件就是 random v

ariable 短期不知道是什麼,長期下來會呈現某種分配

There are two types of random variables: Discrete random variable Continuous random variable

Page 3: Ch 7 & 8  實習

Jia-Ying Chen3

A table, formula, or graph that lists all possible values a discrete random variable can assume, together with associated probabilities, is called a discrete probability distribution.

To calculate the probability that the random variable X assumes the value x, P(X = x), add the probabilities of all the simple events for which X is

equal to x, or Use probability calculation tools (tree diagram), Apply probability definitions

Discrete Probability Distribution

Page 4: Ch 7 & 8  實習

Jia-Ying Chen4

The number of cars a dealer is selling daily were recorded in the last 100 days. This data was summarized in the table below.

Estimate the probability distribution, and determine the probability of selling more than 2 cars a day.

Daily sales Frequency0 51 152 353 254 20

100

Example 1

Page 5: Ch 7 & 8  實習

Jia-Ying Chen5

0 1 2 3 4

From the table of frequencies we can calculate the relative frequencies, which becomes our estimated probability distribution

Daily sales Relative Frequency0 5/100=.051 15/100=.152 35/100=.353 25/100=.254 20/100=.20

1.00

.05

.15

.35.25

.20

X

P(X>2) = P(X=3) + P(X=4) =.25 + .20 = .45

Solution

Page 6: Ch 7 & 8  實習

Jia-Ying Chen6

Describing the Population/ Probability Distribution

The probability distribution represents a population We’re interested in describing the population by

computing various parameters. Specifically, we calculate the population mean and

population variance.

Page 7: Ch 7 & 8  實習

Jia-Ying Chen7

Population Mean (Expected Value) and Population Variance

Given a discrete random variable X with values xi, that occur with probabilities p(xi), the population mean of X is. 加權平均概念 (權數是機率 )

Let X be a discrete random variable with possible values xi that occur with probabilities p(xi), and let E(xi) = The variance of X is defined by

ixall

ii )x(px)X(E ixall

ii )x(px)X(E

2

isdeviationdardtansThe

2

isdeviationdardtansThe

ixalli

2i

22 )x(p)x()X(E)X(V

Page 8: Ch 7 & 8  實習

Jia-Ying Chen8

The Mean and the Variance

The variance can also be calculated as follows:

Proof

2 2 2 2 2( ) ( ) ( )i

i iall x

V X E X x p x 2 2 2 2 2( ) ( ) ( )i

i iall x

V X E X x p x

2

2 2

2 2

2 2

[( ) ]

[ 2 ]

( ) 2 ( ) ( )

( )

E X

E X X

E X E X E

E X

Page 9: Ch 7 & 8  實習

Jia-Ying Chen9

Laws of Expected Value E(c) = c E(X + c) = E(X) + c E(cX) = cE(X)

Laws of Variance V(c) = 0 V(X + c) = V(X) V(cX) = c2V(X)

Laws of Expected Value and Variance

Page 10: Ch 7 & 8  實習

Jia-Ying Chen10

Example 2 We are given the following probability distribution:

a. Calculate the mean, variance, and standard deviation b. Suppose that Y=3X+2. For each value of X, determine the value

of Y. What is the probability distribution of Y? c. Calculate the mean, variance, and standard deviation from the

probability distribution of Y. d. Use the laws of expected value and variance to calculate the

mean, variance, and standard deviation of Y from the mean, variance, and standard deviation of X. Compare your answers in Parts c and d. Are they the same (except for rounding)

x 0 1 2 3

P(x) 0.4 0.3 0.2 0.1

Page 11: Ch 7 & 8  實習

Jia-Ying Chen11

Solution

a. E(X) = 0(0.4) +1(0.3) + 2(0.2) +3(0.1) = 1 V(X)=E(X2)-{E(X)}2

=(0)2(0.4)+(1)2(0.3)+(2)2(0.2)+(3)2(0.1)-(1)2 =1

b.

x 0 1 2 3

y 2 5 8 11

P(y) 0.4 0.3 0.2 0.1

1)( X

Page 12: Ch 7 & 8  實習

Jia-Ying Chen12

Solution

c. E(Y) = 2(0.4) + 5(0.3) + 8(0.2) + 11(0.1) = 5 V(Y)=E(Y2)-{E(Y)}2

=(2)2(0.4)+(5)2(0.3)+(8)2(0.2)+(11)2(0.1)-(5)2 =9

d. E(Y) = E(3X+2) = 3E(X)+2 = 5 V(Y) = V(3X+2) = 9V(X) = 9

( ) 3Y

Page 13: Ch 7 & 8  實習

Jia-Ying Chen13

Bivariate Distributions

The bivariate (or joint) distribution is used when the relationship between two random variables is studied. 也就是第六章所看到的聯合機率分配

The probability that X assumes the value x, and Y assumes the value y is denoted p(x,y) = P(X=x and Y = y)

1y)p(x, 2.1y)p(x,0 1.

:conditionsfollowingthesatisfies functiony probabilitjoint The

xall y all

Page 14: Ch 7 & 8  實習

Jia-Ying Chen14

Example 7.5 Xavier and Yvette are two real estate agents. L

et X and Y denote the number of houses that Xavier and Yvette will sell next week, respectively.

The bivariate probability distribution is presented next.

Bivariate Distributions

Page 15: Ch 7 & 8  實習

Jia-Ying Chen15

p(x,y)

Bivariate Distributions

X

YX=0 X=2X=1

y=1

y=2

y=0

0.42

0.120.21

0.070.06

0.02

0.06

0.03

0.01

Example 7.5 – continued X

Y 0 1 20 .12 .42 .061 .21 .06 .032 .07 .02 .01

Page 16: Ch 7 & 8  實習

Jia-Ying Chen16

Marginal Probabilities

Example 7.5 – continued Sum across rows and down columns

XY 0 1 2 p(y)0 .12 .42 .06 .601 .21 .06 .03 .302 .07 .02 .01 .10p(x) .40 .50 .10 1.00

p(0,0)p(0,1)p(0,2)

The marginal probability P(X=0)

P(Y=1), the marginal probability.

Page 17: Ch 7 & 8  實習

Jia-Ying Chen17

Describing the Bivariate Distribution

The joint distribution can be described by the mean, variance, and standard deviation of each variable.

This is done using the marginal distributions.

x p(x) y p(y)0 .4 0 .61 .5 1 .32 .1 2 .1

E(X) = .7 E(Y) = .5V(X) = .41 V(Y) = .45

Page 18: Ch 7 & 8  實習

Jia-Ying Chen18

Describing the Bivariate Distribution

To describe the relationship between the two variables we compute the covariance and the coefficient of correlation Covariance:

COV(X,Y) = (X – x)(Y- y)p(x,y)=E(XY)-E(X)E(Y)

Coefficient of Correlation

COV(X,Y) xy

Page 19: Ch 7 & 8  實習

Jia-Ying Chen19

Example 7.6 Calculate the covariance and coefficient of correlation between

the number of houses sold by the two agents in Example 7.5 Solution

COV(X,Y) = (x-x)(y-y)p(x,y) = (0-.7)(0-.5)p(0,0)+…(2-.7)(2-.5)p(2,2) = -.15

=COV(X,Y)/xy = - .15/(.64)(.67) = -.35

Describing the Bivariate Distribution

XY 0 1 2 p(y)0 .12 .42 .06 .601 .21 .06 .03 .302 .07 .02 .01 .10p(x) .40 .50 .10 1.00

Page 20: Ch 7 & 8  實習

Jia-Ying Chen20

Sum of Two Variables

The probability distribution of X + Y is determined by Determining all the possible values that X+Y can assume For every possible value C of X+Y, adding the probabilities of all

the combinations of X and Y for which X+Y = C Example 7.5 - continued

Find the probability distribution of the total number of houses sold per week by Xavier and Yvette.

Solution X+Y is the total number of houses sold. X+Y can have the

values 0, 1, 2, 3, 4.

Page 21: Ch 7 & 8  實習

Jia-Ying Chen21

P(X+Y=0) = P(X=0 and Y=0) = .12

P(X+Y=1) = P(X=0 and Y=1)+ P(X=1 and Y=0) =.21 + .42 = .63

P(X+Y=2) = P(X=0 and Y=2)+ P(X=1 and Y=1)+ P(X=2 and Y=0) = .07 + .06 + .06 = .19

The probabilities P(X+Y)=3 and P(X+Y) =4 are calculated the same way. The distribution follows

XY 0 1 2 p(y)0 .12 .42 .06 .601 .21 .06 .03 .302 .07 .02 .01 .10p(x) .40 .50 .10 1.00

The Probability Distribution of X+Y

Page 22: Ch 7 & 8  實習

Jia-Ying Chen22

The distribution of X+Y

The expected value and variance of X+Y can be calculated from the distribution of X+Y. E(X+Y)=0(.12)+ 1(63)+2(.19)+3(.05)+4(.01)=1.2 V(X+Y)=(0-1.2)2(.12)+(1-1.2)2(.63)+… =.56

x + y 0 1 2 3 4p(x+y) .12 .63 .19 .05 .01

The Expected Value and Variance of X+Y

Page 23: Ch 7 & 8  實習

Jia-Ying Chen23

The Expected Value and Variance of X+Y

The following relationship can assist in calculating E(X+Y) and V(X+Y)E(X+Y) =E(X) + E(Y); V(X+Y) = V(X) +V(Y) +2COV(X,Y) When X and Y are independent COV(X,Y)

= 0, and V(X+Y) = V(X)+V(Y).Proof

),(2)()(

)])((2)()[(

])[()(22

2

YXCovYVarXVar

YXYXE

YXEYXVar

yxyx

yx

Page 24: Ch 7 & 8  實習

Jia-Ying Chen24

Example 3

The bivariate distribution of X and Y is described here.

a. Find the marginal probability distribution of X. b. Find the marginal probability distribution of Y c. Compute the mean and variance of X d. Compute the mean and variance of Y e. Compute the covariance and variance of Y

x

y 1 2

1 0.28 0.42

2 0.12 0.18

Page 25: Ch 7 & 8  實習

Jia-Ying Chen25

Solution

a x P(x) 1 .4 2 .6 b y P(y) 1 .7 2 .3 c E(X) = 1(.4) + 2(.6) = 1.6 V(X) = (1–1.6)^2*(.4) + (2–1.6)^2*(.6) = .24 or (1^2)*0.4+(2^2)*0.6-(1.6)^2=.24

Page 26: Ch 7 & 8  實習

Jia-Ying Chen26

Solution

d E(Y) = 1(.7) + 2(.3) = 1.3 V(Y) = (1–1.3)^2(.7) + (2–1.3)^2(.3) = .21 e E(XY) = (1)(1)(.28) + (1)(2)(.12) + (2)(1)(.42) + (2)(2)(.18) = 2.08

COV(X, Y) = E(XY)–E(X)E(Y) = 2.08 – (1.6)(1.3) = 0 = 0

yx

)Y,X(COV

Page 27: Ch 7 & 8  實習

Jia-Ying Chen27

The Binomial Distribution

The binomial experiment can result in only one of two possible outcomes.

Binomial Experiment There are n trials (n is finite and fixed). Each trial can result in a success or a failure. The probability p of success is the same for all the trials. All the trials of the experiment are independent

Binomial Random Variable The binomial random variable counts the number of successes

in n trials of the binomial experiment. By definition, this is a discrete random variable.

Page 28: Ch 7 & 8  實習

Jia-Ying Chen28

Calculating the Binomial Probability

xnxnx )p1(pC)x(p)xX(P xnxn

x )p1(pC)x(p)xX(P

In general, The binomial probability is calculated by:

Mean and Variance of Binomial Variable

)!xn(!x!n

Cwhere nx

p)-np(1 s V(X)

np E(X)2

Page 29: Ch 7 & 8  實習

Jia-Ying Chen29

Example 4

In the game of blackjack as played in casinos in Las Vegas, Atlantic City, Niagara Falls, as well as many other cities, the dealer has the advantages. Most players do not play very well. As a result, the probability that the average player wins a about 45%.Find the probability that an average player wins

a. twice in 5 hands

b. ten or more times in 25 hands

Page 30: Ch 7 & 8  實習

Jia-Ying Chen30

Solution

a P(X = 2) = = .3369

b Excel with n = 25 and p = .45:

P(X 10) = 1 – P(X 9) = 1 – .2424 = .7576

2 5 25!(.45) (1 .45)

2!(5 2)!

Page 31: Ch 7 & 8  實習

Jia-Ying Chen31

The Poisson experiment typically fits cases of rare events that occur over a fixed amount of time or within a specified region

Typical cases The number of errors a typist makes per page The number of customers entering a service station

per hour The number of telephone calls received by a

switchboard per hour.

Poisson Distribution

Page 32: Ch 7 & 8  實習

Jia-Ying Chen32

The number of successes (events) that occur in a certain time interval is independent of the number of successes that occur in another time interval.

The probability of a success in a certain time interval is the same for all time intervals of the same size, proportional to the length of the interval.

The probability that two or more successes will occur in an interval approaches zero as the interval becomes smaller.

Properties of the Poisson Experiment

Page 33: Ch 7 & 8  實習

Jia-Ying Chen33

The Poisson Random Variable The Poisson variable indicates the number of

successes that occur during a given time interval or in a specific region in a Poisson experiment

Probability Distribution of the Poisson Random Variable.

)X(V)X(E

...2,1,0x!x

e)x(p)xX(P

x

The Poisson Variable and Distribution

Page 34: Ch 7 & 8  實習

Jia-Ying Chen34

Example 5

The number of students who seek assistance with their statistics assignments is Poisson distributed with a mean of three per day.

a. What is the probability that no student seek assistance tomorrow?

b. Find the probability that 10 students seek assistance in a week.

Page 35: Ch 7 & 8  實習

Jia-Ying Chen35

Solution

a. P(X = 0 with = 3) = =

= .0498

b. P(X = 10 with = 21) = =

= .0035

!x

e x

!0

)3(e 03

!x

e x

!10

)21(e 1021

Page 36: Ch 7 & 8  實習

Jia-Ying Chen36

A continuous random variable has an uncountably infinite number of values in the interval (a,b).

Continuous Probability Distributions

The probability that a continuous variable X will assume any particular value is zero. Why?

0 11/21/3 2/3

1/2 + 1/2 = 11/3 + 1/3 + 1/3 = 11/4 + 1/4 + 1/4 + 1/4 = 1

The probability of each value

Page 37: Ch 7 & 8  實習

Jia-Ying Chen37

0 11/21/3 2/3

1/2 + 1/2 = 11/3 + 1/3 + 1/3 = 11/4 + 1/4 + 1/4 + 1/4 = 1

As the number of values increases the probability of each value decreases. This is so because the sum of all the probabilities remains 1.

When the number of values approaches infinity (because X is continuous) the probability of each value approaches 0.

The probability of each value

Continuous Probability Distributions

Page 38: Ch 7 & 8  實習

Jia-Ying Chen38

To calculate probabilities we define a probability density function f(x).

The density function satisfies the following conditions f(x) is non-negative, The total area under the curve representing f(x) equals

1. x1 x2

Area = 1

P(x1<=X<=x2)

Probability Density Function

• The probability that X falls between xThe probability that X falls between x11 and x and x22 is is found by calculating the area under the graph of f(x) found by calculating the area under the graph of f(x) between xbetween x11 and x and x22..

Page 39: Ch 7 & 8  實習

Jia-Ying Chen39

A random variable X is said to be uniformly distributed if its density function is

The expected value and the variance are

12)ab(

)X(V2

baE(X)

.bxaab

1)x(f

2

Uniform Distribution

Page 40: Ch 7 & 8  實習

Jia-Ying Chen40

Example 6

The weekly output of a steel mill is a uniformly distributed random variable that lies between 110 and 175 metric tons.

a. Compute the probability that the steel mill will produce more than 150 metric tons next week.

b. Deter the probability that the steel mill will produce between 120 and 160 metric tons next week.

Page 41: Ch 7 & 8  實習

Jia-Ying Chen41

Solution

f(x) = ,110 ≦ x ≦ 175

a P(X ≧ 150) = = 0.3846

b P(120 ≦ X ≦ 160) = = 0.6154

65

1

)110175(

1

65

1)150175(

65

1)120160(

Page 42: Ch 7 & 8  實習

Jia-Ying Chen42

A random variable X with mean and variance is normally distributed if its probability density function is given by

...71828.2...14159.32

1)(

2

)2/1(

eandwhere

xexfx

...71828.2...14159.32

1)(

2

)2/1(

eandwhere

xexfx

Normal Distribution

N( 2,)

f

21

Page 43: Ch 7 & 8  實習

Jia-Ying Chen43

Two facts help calculate normal probabilities: The normal distribution is symmetrical. Any normal distribution can be transformed into a

specific normal distribution called… “Standard Normal Distribution”

Example: The amount of time it takes to assemble a computer is

normally distributed, with a mean of 50 minutes and a standard deviation of 10 minutes. What is the probability that a computer is assembled in a time between 45 and 60 minutes?

Finding Normal Probabilities

Page 44: Ch 7 & 8  實習

Jia-Ying Chen44

Solution If X denotes the assembly time of a computer,

we seek the probability P(45 X 60).≦ ≦ This probability can be calculated by creating a

new normal variable the standard normal variable.

x

xXZ

x

xXZ

E(Z) = = 0 V(Z) = 2 = 1

Every normal variablewith some and, canbe transformed into this Z.

Therefore, once probabilities for Zare calculated, probabilities of any normal variable can be found.

Finding Normal Probabilities

Page 45: Ch 7 & 8  實習

Jia-Ying Chen45

Example - continued

P(45 ≦ X ≦ 60) = P( ≦ ≦ )45 X 60- 50 - 5010 10

= P(-0.5 ≦ Z ≦ 1)

To complete the calculation we need to compute the probability under the standard normal distribution

Finding Normal Probabilities

Page 46: Ch 7 & 8  實習

Jia-Ying Chen46

Page 47: Ch 7 & 8  實習

Jia-Ying Chen47

Example - continued

P(45 ≦ X ≦ 60) = P( ≦ ≦ )45 X 60- 50 - 5010 10

= P(-.5 ≦ Z ≦ 1)=0.8413-(1-0.6915)=0.5328

z0 = 1z0 = -.5

We need to find the shaded area

Finding Normal Probabilities

Page 48: Ch 7 & 8  實習

Jia-Ying Chen48

Example 7

X is normally distributed with mean 300 and standard deviation 40. What value of X does only the top 15 % exceed?

P(0 < Z < ) = 1-0.15 = 0.85 = 1.04;

15.z

15.z.15

3001.04

40341.6

xz

x

x

Page 49: Ch 7 & 8  實習

Jia-Ying Chen49

Example 8

The long-distance calls made by the employees of a company are normally distributed with a mean of 7.2 minutes and a standard deviation of 1.9 minutes. Find the probability that a call

a. Last between 5 and 10 minutes b. Last more than 7 minutes c. Last less than 4 minutes

Page 50: Ch 7 & 8  實習

Jia-Ying Chen50

Solution

a P(5 < X < 10) =

= P(–1.16 < Z < 1.47) = 0.9292-(1-0.8770)

= .8062

b. P(X > 7) = = P(Z > –.11) = 0.5438

c. P(X < 4) =

=1-0.9535= .0465

9.1

2.710X

9.1

2.75P

9.1

2.77XP

4 7.21.68

1.9

XP