23
© 蘇蘇蘇 2000 蘇蘇蘇蘇 蘇蘇 () Page 1 The Bernoulli Distribution The Bernoulli Distribution •蘇 蘇蘇蘇蘇蘇蘇蘇蘇蘇蘇蘇蘇蘇蘇 蘇蘇蘇蘇蘇 蘇蘇蘇蘇蘇 蘇 蘇蘇蘇蘇蘇蘇蘇蘇蘇蘇蘇蘇蘇 一(、),。 A random variable X has a Bernoulli dist ribution with parameter p (0 p 1) i f X can take only the values 0 and 1 and the probabilities are P(X=1) = p P(X=0) = (1-p) If we let q = 1- p, then the p.f of X ca n be written as follows: otherwis 0 1 , 0 for ) ( 1 x q p x f x x

The Bernoulli Distribution

  • Upload
    licia

  • View
    57

  • Download
    0

Embed Size (px)

DESCRIPTION

The Bernoulli Distribution. 定義. 若一隨機試驗只有兩種課能的結果(正面反面、成功失敗),則此試驗稱之為伯弩利試驗。 A random variable X has a Bernoulli distribution with parameter p (0  p  1) if X can take only the values 0 and 1 and the probabilities are P(X=1) = p P(X=0) = (1-p) - PowerPoint PPT Presentation

Citation preview

Page 1: The Bernoulli Distribution

©蘇國賢 2000社會統計(上) Page 1

The Bernoulli DistributionThe Bernoulli Distribution

• 若一隨機試驗只有兩種課能的結果(正面反面、成功失敗),則此試驗稱之為伯弩利試驗。

• A random variable X has a Bernoulli distribution with parameter p (0 p 1) if X can take only the values 0 and 1 and the probabilities are

• P(X=1) = p • P(X=0) = (1-p)• If we let q = 1- p, then the p.f of X can be written as foll

ows:

定義定義

otherwise 0

1,0for )(

1 xqpxf

xx

Page 2: The Bernoulli Distribution

©蘇國賢 2000社會統計(上) Page 2

The Bernoulli DistributionThe Bernoulli Distribution

• E(X) = 1·p +0·q = p

• E(X2) =X2 f(x)=12·p+02·q = p

• Var(X) = E(X2) –[E(X)]2 =p-p2

• =p(1-p) = p·q

定義定義

otherwise 0

1,0for )(

1 xqpxf

xx

Page 3: The Bernoulli Distribution

©蘇國賢 2000社會統計(上) Page 3

例題例題

• 執銅板一次, X 為出現正面的數目,其分配為何?其期待值及變異數為何?

otherwise 0

1,0for )2

11()

2

1(

)(1 x

xfxx

2

1)( XE )

2

1(

2

1)( XVar

Page 4: The Bernoulli Distribution

©蘇國賢 2000社會統計(上) Page 4

The Binomial DistributionThe Binomial Distribution 二項分配二項分配

• 若間斷 r.v X 的機率分配函數為:

定義定義

otherwise 0

...,2,1,0for )(

nxqpCxf

xnxnx

• n 為完全相同且獨立之試驗的次數。• 每次試驗只有「成功」「失敗」兩種戶斥可能• p 為每次試行成功之機率,失敗的機率為 q = 1 –

p, 其中 0<p<1 。• 隨機變數 X 表示 n 次獨立試驗中成功之次數。

Page 5: The Bernoulli Distribution

©蘇國賢 2000社會統計(上) Page 5

The Binomial DistributionThe Binomial Distribution 二項分配二項分配

• 一個正常 20 歲的成年人活至 65 歲的機率為 80% ,請問三個三個年輕人中有兩人活到 65 歲的機率為?

定義定義

Page 6: The Bernoulli Distribution

©蘇國賢 2000社會統計(上) Page 6

Page 236, Figure 5.4Page 236, Figure 5.4

Page 7: The Bernoulli Distribution

©蘇國賢 2000社會統計(上) Page 7

The Binomial DistributionThe Binomial Distribution 二項分配二項分配• 每一個人存活至 65 的機率為 85% ,三人中有兩人可以存

活至 65:• (0.8)2

• 一個死亡的機率:• (0.2)1

• 根據上圖我們知道這種情形共有 (ssf)(sfs)(fss) 三種 :• C3,2 = 3!/(2!(3-2)!)=3

定義定義

xnxnx qpCxf )(

23232 )2.0()8.0()2( Cf

Page 8: The Bernoulli Distribution

©蘇國賢 2000社會統計(上) Page 8

The Binomial DistributionThe Binomial Distribution 二項分配二項分配

• 鑽油井的成功機率為 .30 ,某公司找到五處有可能蘊藏石油的地點。求正好兩處挖到石油的機率?

• p=.3, q=1-.3=.7• n=5• 五次中有兩次成功,

定義定義

10)!25(!2

!552

C

• P( 正好挖到兩處) =P(X=2) = (.3)2(.7)3+ (.3)2(.7)3+…(.3)2(.7)3=10 (.3)2(.7)3=.3087

Page 9: The Bernoulli Distribution

©蘇國賢 2000社會統計(上) Page 9

The Binomial DistributionThe Binomial Distribution 二項分配二項分配

• X 為五次獨立的試驗成功的次數,列出 X 的機率分配:

定義定義

X Probability P(X=x)

0 C5,0(.3)0(.7)

50.16807

1 C5,1(.3)1(.7)

40.36015

2 C5,2(.3)2(.7)

30.30870

3 C5,3(.3)3(.7)

20.13230

4 C5,4(.3)4(.7)

10.02835

5 C5,5(.3)5(.7)

00.00243

P(X=x)

0

0.1

0.2

0.3

0.4

0 1 2 3 4 5

Binomial distribution, n=5 p=.3

Page 10: The Bernoulli Distribution

©蘇國賢 2000社會統計(上) Page 10

Page 240, Figure 5.6Page 240, Figure 5.6

Page 11: The Bernoulli Distribution

©蘇國賢 2000社會統計(上) Page 11

The Binomial DistributionThe Binomial Distribution 二項分配二項分配

• 如果 p=.5, 則成功失敗的機率各半,此機率分配為對稱 (symmetric) 。

• 若 p>.5 ,表示「成功」的機率大於「失敗」,圖形右方的機率會大於左方。

• n 愈大,機率分配愈接近鐘型 (bell shaped)• 如果 p 很接近 .5 ,既使 n 很小,機率分配也會呈現鐘型狀態。

• 圖 5.6 顯示,隨著 p 增加,圖形的高峰愈往右邊偏移,且愈接近 .5 ,愈呈現鐘型。

Page 12: The Bernoulli Distribution

©蘇國賢 2000社會統計(上) Page 12

The Binomial DistributionThe Binomial Distribution 二項分配二項分配

• If the random variable X1, X2,…Xn form n Bernoulli trials with parameter p and if X =X1+X2…+Xn, then X has a binomial distribution with parameter n and p.

npXEXEXEXEXE n

n

ii

)()()()()( 211

pXE i )(

tindependen are and )( i i XpqXVar

npqXVarXVarXVarXVar n

n

ii

)()()()( 11

Page 13: The Bernoulli Distribution

©蘇國賢 2000社會統計(上) Page 13

例題例題

• 設 X~b(n,p) 已知 E(X)=3, Var(X)=2 ,求 P(X=7)( 中山企研)

2)1()(

3)(

pnpXVar

npXE

3

1,9 pn

0073.0)3

2()

3

1()7( 279

7 CXP

Page 14: The Bernoulli Distribution

©蘇國賢 2000社會統計(上) Page 14

Cumulative binomial distribution Cumulative binomial distribution functionfunction

• 累積二項分配機率函數xnx

c

x

ppx

ncXP

)1()()(

0

c Probability P(X=c) P(X<=c)

0 C5,0(.3)0(.7)

50.16807 0.16807

1 C5,1(.3)1(.7)

40.36015 0.52822

2 C5,2(.3)2(.7)

30.30870 0.83692

3 C5,3(.3)3(.7)

20.13230 0.96922

4 C5,4(.3)4(.7)

10.02835 0.99757

5 C5,5(.3)5(.7)

00.00243 1.00000

p =.3, n=5

Page 15: The Bernoulli Distribution

©蘇國賢 2000社會統計(上) Page 15

在在 EXCELEXCEL 中求解中求解• 語法:• BINOMDIST( 成功次數 number_s, 實驗次數 trials, 成功機率 probability_s, 求累積函數 cumulative)– Number_s    為欲求解的實驗成功次數。– Trials    為獨立實驗的次數。– Probability_s    為每一次實驗的成功機率。– Cumulative    為一邏輯值,主要用來決定函數的型態。如果 cumulative 為 TRUE ,則 BINOMDIST 傳回累加分配函數值,其代表最多有 number_s 次成功的機率;如果其值為 FALSE ,則傳回機率密度函數的機率值,代表有 number_s 次成功的機率。

Page 16: The Bernoulli Distribution

©蘇國賢 2000社會統計(上) Page 16

在在 EXCELEXCEL 中求解中求解

Page 17: The Bernoulli Distribution

©蘇國賢 2000社會統計(上) Page 17

在在 EXCELEXCEL 中求解中求解

Page 18: The Bernoulli Distribution

©蘇國賢 2000社會統計(上) Page 18

例題例題• According to IRS, approximately 20% of all income tax returns contain mathematical errors.• (a) find the probability that 3 or fewer returns out of a sample of 10 contain mathematical errors.• (b) Find the probability that fewer than three of the returns contain errors.• (c) Find the probability that exactly three of the returns contains errors.• (d) find the probability that three or more of the returns contain errors.

Page 19: The Bernoulli Distribution

©蘇國賢 2000社會統計(上) Page 19

例題例題

• Let X denote the number of errors, then X follows the binomial distribution with n=10 and p=.20

• (a) P(X3) = P(X=0) +P(X=1)+P(X=2)+P(X=3)• 查表可之 n=10, p=.2, c=3 P(X 3) = .879• (b) P(X<3)• N=10, p=.2, c=2, P(X<3)= P(X 2)=.678• (c) P(X=3)=P(X 3) – P(X 2)=.879-.678=.201• (d) P(X3) =1- P(X 2) = 1-.678=.322

Page 20: The Bernoulli Distribution

©蘇國賢 2000社會統計(上) Page 20

例題例題

• 生壞血病復原之機率為 40% ,現有 15 人患此病,求• (一)至少 10 人存活的機率• P(X10)=1-P(X9) =.0338

• (二) 3-8 人存活的機率• P(3X 8)=P(X 8)-P(X 2)=.8779

• (三)恰巧 5 人存活的機率• P(X=5)

• (四)期望值及變異數• E(X)=15(.4)=6 Var(X)=15(.4)(.6)=3.6

Page 21: The Bernoulli Distribution

©蘇國賢 2000社會統計(上) Page 21

Sample proportion of successesSample proportion of successes

• Statisticians frequently are more interested in the proportion of successes in a sample than in the number of successes.

• If we obtain X successes in n trials, then the sample proportion ^p = X/n

• P(X=x) = P(^p=x/n) • E(^p)=E(X/n)=np/n=p• The sample proportion ^p is an unbiased estimator of popu

lation proportion p.• Var(^p)=Var(X/n)=(1/n)2Var(X)= npq/n2 = pq/n

Page 22: The Bernoulli Distribution

©蘇國賢 2000社會統計(上) Page 22

例題例題

• A councilman claims that at least 30% of the voters of a large city are in favor of increasing taxes on alcoholic beverages. To test this claim, a polling agent obtains a random sample of 500 voters. Suppose that X=100 voters in the sample say they favor the tax. Thus, the sample proportion is ^p=100/500=.2. Is it reasonable to reject the claim that, in the population, p is at least .3?

Page 23: The Bernoulli Distribution

©蘇國賢 2000社會統計(上) Page 23

例題例題

• If the claim is true, the the sample proportion ^p has expected value E(^p)=p=.3

• Var(^p)=pq/n=(.3)(.7)/500=.00042• S^p=sqrt(.00042)=.02• Empirical rule more than 99.7% of the value of ^p shoul

d fall within 3 standard deviation of the mean:• (.3-.06, .3+.06) = (.24, .36)• .02 lies outside this interval, we have strong evidence that,

in the population, p does not equal to .3. If p were .3, it would be quite unusual to observe a value as extreme as ^p=.2 in a sample of n=500.