Top Banner
© 蘇蘇蘇 2000 蘇蘇蘇蘇 蘇蘇 () Page 1 Experiment Experiment • An experiment is any activity from which an outcome, measur ement, or result is obtained. 蘇蘇蘇蘇蘇蘇蘇蘇蘇蘇蘇蘇蘇蘇蘇 蘇蘇蘇蘇 「」。 • When the outcomes cannot be p redicted with certainty, the experiment is a random experi ment. 蘇蘇蘇蘇蘇蘇蘇蘇蘇蘇蘇 蘇蘇蘇蘇蘇 蘇蘇蘇蘇蘇蘇 「」。
92

Experiment

Jan 04, 2016

Download

Documents

amy-downs

Experiment. 定義. An experiment is any activity from which an outcome, measurement, or result is obtained. 任何求結果的過程或活動皆可稱為「試驗」。 When the outcomes cannot be predicted with certainty, the experiment is a random experiment . 當結果無法事先預測時,稱此試驗為「隨機試驗」。. Example of Experiments. 實例. - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Experiment

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

Experiment Experiment

• An experiment is any activity from which an outcome, measurement, or result is obtained. 任何求結果的過程或活動皆可稱為「試驗」。

• When the outcomes cannot be predicted with certainty, the experiment is a random experiment. 當結果無法事先預測時,稱此試驗為「隨機試驗」。

定義定義

Page 2: Experiment

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

Example of Experiments Example of Experiments

• 1. Measuring the lifetime (time to failure) of a given product

• 2. Inspecting an item to determine whether it is defective

• 3. Recording the income of a bank employee

• 4. Recording the balance in an individual's checking account

實例實例

Page 3: Experiment

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

Basic Outcomes and Sample SpaceBasic Outcomes and Sample Space

• The set of all possible basic outcomes for a given experiment is called the sample space. 隨機實驗的所有可能結果稱為樣本空間,一般以 S或 Ω 表示。

• Each possible outcome of a random experiment is called a basic outcome (or a sample point, an element in the sample space). 隨機實驗中所得到的任何可能的個別結果稱之為「基本結果」(或樣本點、或簡稱樣本),以小寫 oi表示。

定義定義

Page 4: Experiment

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

Basic Outcomes and Sample SpaceBasic Outcomes and Sample Space

• 某家公司在六個不同的城市有辦公室,某新進員工將被分派到其中的一個辦公室上班,則所有可能的分派為:

• o1= 台北 o2= 桃園 o3= 台中 • o4= 台南 o5= 高雄 o6= 屏東 • 分派的樣本空間為:• S = { o1 , o2 , o3 , o4 ,o5 ,o6 }• 如果這名員工被分派至台南上班,我們說該試驗的結果為 o4 = 台南,即該試驗的 o4結果發生了。

實例實例

Page 5: Experiment

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

Venn DiagramsVenn Diagrams

• S = { o1 , o2 , o3 , o4 ,o5 ,o6 }

o1 o2 o3

o4 o5 o6

‧‧‧

‧‧‧

定義定義

Page 6: Experiment

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

EventEvent 事件事件• An event is a specific collection of basic outco

mes, that is, a set containing one or more of the basic outcomes from the sample space. We say that an event occurs if any one of the basic outcomes in the event occurs.

• 事件為包含樣本空間中一個以上樣本元素(基本結果)的子集合,即樣本空間的任何部分集合 (subset) ,一般以英文大寫字母表示。

定義定義

Page 7: Experiment

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

EventEvent 事件事件

• 上例中,該員工被分派至南台灣的事件為:• A = {o4 ,o5 ,o6 }

• 如果該員工被分派至台南上班,我們可以說 A 事件發生了。

• 若 B 事件為該員工被分派至直轄市上班,則

• B = {o1 ,o5}

實例實例定義定義

Page 8: Experiment

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

Venn DiagramsVenn Diagrams

• S = { o1 , o2 , o3 , o4 ,o5 ,o6 }

o1 o2 o3

o4 o5 o6

‧‧‧

‧‧‧

定義定義

A 事件

B 事件

Page 9: Experiment

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

EventEvent 事件事件

• 寫出丟骰子一次所得數目的樣本空間:• S = {1, 2, 3, 4, 5, 6}

• 寫出得到偶數的事件:• A = {2,4,6}

• 寫出數字大於 2 的事件:• B = {3,4,5,6}

實例實例

Page 10: Experiment

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

EventEvent 事件事件

• 丟銅板得到 H 正面或 T 反面,寫出丟一銅板三次的樣本空間:

• S = {HHH, HHT, HTH, HTT, THH, THT, TTH, TTT}

• 設 A 表示第一次出現正面的事件,則• A = {HHH, HHT, HTH, HTT}

實例實例

Page 11: Experiment

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

Assigning Probabilities to EventsAssigning Probabilities to Events事件的機率事件的機率

• There are two types of random experiments, those that can be repeated over and over again under essentially identical conditions and those that are unique and cannot be repeated.

定義定義

Page 12: Experiment

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

Assigning Probabilities to EventsAssigning Probabilities to Events事件的機率事件的機率

• A numerical measure that indicates the likelihood of a specific outcome in a repeatable random experiment is called an objective probability, whereas the probability associated with a specific outcome of a unique and nonrepeatable random experiment is called a subjective probability.

定義定義

Page 13: Experiment

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

Assigning Probabilities to EventsAssigning Probabilities to Events事件的機率事件的機率

• There are three different approaches to assigning probabilities to basic outcomes:

• 1. The relative frequency approach

• 2. The equally likely approach

• 3. The subjective approach

定義定義

Page 14: Experiment

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

The Relative Frequency Approach The Relative Frequency Approach 相對次數(後天)機率理論相對次數(後天)機率理論

• Let fA be the number of occurrences, or frequency of occurrence, of event A in n repeated identical trials. The probability that A occurs is the limit of the ratio fA/n as the number of trials n becomes infinitely large.

n

fAP A

n lim)(

定義定義

Page 15: Experiment

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

The Relative Frequency Approach The Relative Frequency Approach 相對次數(後天)機率理論相對次數(後天)機率理論

• 當一試驗在完全相同的情境中重複試驗,某事件A發生的機率可以定義為:當試驗在相同情境下重複無限次時, A 所發生的次數與試驗總次數之比。

• 由於這種機率為長期試驗的結果,因此又稱之為後天機率、相對次數。由於這種機率為歸納多次試驗的結果所得,故又稱為統計機率或經驗機率。

n

fAP A

n lim)(

定義定義

Page 16: Experiment

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

後天機率理論的缺陷後天機率理論的缺陷

• (1) Because we can never replicate an experiment an infinite number of times, it is impossible to determine the limit of the ratio fA/n as n approaches infinity.

• (2) We can never be sure that we have repeated an experiment under identical conditions.

定義定義

Page 17: Experiment

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

後天機率理論的缺陷後天機率理論的缺陷

• When we use the relative frequency approach, we use the observed ratio fA/n to approximate the theoretical probability that event A occurs. That is, we assume that P(A) fA/n when n is sufficiently large.

定義定義

Page 18: Experiment

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

The Equally Likely ApproachThe Equally Likely Approach古典(先天)機率理論古典(先天)機率理論

• Suppose that an experiment must result in one of n equally likely outcomes. Then each possible basic outcome is considered to have probability 1/n of occurring on any replication of the experiment.

• 一樣本空間有 n 個樣本點(基本結果),且每一個樣本點發生的機會皆相等。則在任何重複試驗中,每一個樣本點發生的機率為 1/n 。若事件 A 的樣本點個數為 nA,則 A 發生的機率為:

• P(A) = nA/n ,符合某條件結果的個數與總結果數之比。

定義定義

Page 19: Experiment

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

The Equally Likely ApproachThe Equally Likely Approach古典(先天)機率理論古典(先天)機率理論

• 直一骰子兩次,求點數和等於 6 的機率?• E = { (1,5) (2,4) (3,3) (4,2) (5,1)}

• P(E) = 5/36

• 其他先天機率:丟銅板、抽籤、彩券等。• 先天機率最重要的問題:所有樣本點發生的機率是否相同?

實例實例

Page 20: Experiment

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

Objective ProbabilityObjective Probability 客觀機率客觀機率

• A probability obtained by using a relative frequency approach or an equally likely approach is called an objective probability.

定義定義

Page 21: Experiment

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

The Subjective ApproachThe Subjective Approach主觀機率主觀機率

• 如果樣本點出現的可能性不等,則無法求事件的先天機率。若試驗無法進行,或無法多次重複,則相對次數無法計算,事件的後天機率也無法計算。

• 在此情況下,我們經常仰賴主觀機率,即人們對於某事件發生的主觀評價,或可以看成是「專家」的意見。

• A subjective probability is a number in the interval [0, 1] that reflects a person's degree of belief that an event will occur.

定義定義

Page 22: Experiment

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

OddsOdds 可能性可能性

• 有時候人們以「發生」與「不發生」的比值來陳述他們對於事件發生機率的意見。

• 如經常聽到某人說某賭局、競賽、或遊戲有 3:1的勝算,則表示某人有 75% 贏的機率。

• If the odds in favor of event A occurring are a to b, then

定義定義

ba

aAP

)(

Page 23: Experiment

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

Which approach is bestWhich approach is best ??

• The nature of the problem determines which approach is best.

• Problems with an underlying symmetry, such as coin, dice, and card problems, are especially suited to the equally likely approach.

• Problems for which we have large samples of data based on many replications of an experiment are especially suited to the relative frequency approach.

• Problems that occur only once, such as a sporting event, are especially suited to the subjective approach.

定義定義

Page 24: Experiment

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

Which approach is bestWhich approach is best ??

• 已知懷單胎,生男的機率為何?• (1) 依先天機率:• 性別有男女兩類,故生男的機率為 1/2• (2) 依後天機率:• 台灣地區男性人口佔 52% ,故生男的機率為 52

%• (3) 主觀機率:• 由於飲食習慣的改變,現代人大量攝取動物性蛋白質,使生男的機率增加為 60%

實例實例

Page 25: Experiment

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

Set TheorySet Theory

• Subset 子集合• An event A is contained in another event B if every outcom

e that belongs to the subset defining the event A also belongs to the subset defining the event B.

• A = {2,4,6} B={2,3,4,5,6}

• A B, A is a subset of B

• If A B and B A, then A = B

• If A B and B C, then A C

• Empty Set or Null Set 空集合 Ø

• For any event A, Ø A S,

定義定義

Page 26: Experiment

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

Operation of Set Theory: Operation of Set Theory: UnionsUnions聯集聯集

• Unions聯集• Let A and B be two events in

the sample space S. Their union, denoted A U B. is the event composed of all basic outcomes in S that belong to at least one of the two events A or B. Hence, the union A U B occurs if either A or B (or both) occurs.

定義定義

AS

B

Page 27: Experiment

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

Operation of Set Theory: Operation of Set Theory: UnionsUnions聯集聯集

• Unions聯集 : The union of n events A1,A2,…,An is defined to be the event that contains all outcomes which belong to at least one of these n events.

定義定義

AS

B

nini AAAAAA 43211

Page 28: Experiment

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

Operation of Set Theory: Operation of Set Theory: IntersectionIntersection 交集交集

• Intersection交集 :• Let A and B be two events in the sampl

e space S. The intersection of A and B, denoted A B. is the event composed of all basic outcomes in S that belong to both A and B. Hence, the intersection A B occurs if both A and B occur.

定義定義

AS

B

Page 29: Experiment

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

Operation of Set Theory: Operation of Set Theory: IntersectionIntersection 交集交集

• Intersection交集 : • The intersection of n events, A1,

…An is defined to be the event that contains the outcomes which are common to all these n events.

定義定義

n

nini

AAAAA

AAAAAA

4321

43211

AS

B

Page 30: Experiment

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

Complement of an EventComplement of an Event

• Let A denote some event in the sample space S. The complement of A (A 的餘事件) , denoted by Ac, represents the event composed of all basic outcomes in S that do not belong to A.

定義定義

AAc

S

Page 31: Experiment

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

Complement has the following properties:Complement has the following properties:

• (Ac)c =A

• A Ac = S

• Øc = S

• Sc = Ø

• A Ac = Ø

定義定義

AAc

S

Page 32: Experiment

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

Complement has the following properties:Complement has the following properties:

• (A B)∪ c =Ac ∩Bc

• (A ∩ B)c =Ac ∪ Bc

定義定義

A

Ac

S

BBc

Ii

ci

c

Iii AA

)(

Ii

ci

c

Iii AA

)(

• P(A) = P(A ∩ B) +P(A ∩ Bc)• P(Ac ∩ Bc) = 1 - P(A ∪ B)• P(Ac B∪ c) = 1 - P(A ∩ B)

Page 33: Experiment

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

Mutually Exclusive Events Mutually Exclusive Events (Disjoint Events)(Disjoint Events)

• Let A and B be two events in a sample space S. If A and B have no basic outcomes in common, then they are said to be mutually exclusive. If A and B are mutually exclusive events, we write (A B) = Ø, where Ø denotes the empty set. P(A B) = 0.

Page 34: Experiment

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

Some basic rules of probabilitySome basic rules of probability

• Probability of a basic outcome:• For each basic outcome oi, 0 P(oi) 1. • Probability of an event:• Let event A = { o1 , o2 , o3 , o4 ,o5 ,…ok }, where o1 , o2 , o3 , o4

,o5 ,…ok are k different basic outcomes. The probability of any event A is the sum of the probabilities of the basic outcomes in A. That is,

• P(A) = P(o1) + P(o2) + P(o3) + P(o4) + P(o5) +…+P(ok) = AP(oi)

• where AP(oi) means to obtain the sum over all basic outcomes in event A.

定義定義

Page 35: Experiment

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

Some basic rules of probabilitySome basic rules of probability

• Probability of an Event

• For any event A, 0 P(A) 1.

• Probability of a sample space:• Let event S = { o1 , o2 , o3 , o4 ,o5 ,…on } represent t

he sample space of an experiment. The probability of S is

• P(S) = sP(oi) = 1

定義定義

Page 36: Experiment

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

Definition of ProbabilityDefinition of Probability

• Axiom 1 公理 1: For any event A, P(A) 0 事件 A 發生的機率為實數

• Axiom 2: P(S) = 1.

• Axiom 3: For any infinite sequence of disjoint events (互斥事件) A1, A2, …

11

)()(i

ii

i APAP

Page 37: Experiment

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

Definition of ProbabilityDefinition of Probability

• A probability distribution , or simply a probability, on a sample space S is a specification of numbers P(A) which satisfy Axioms 1,2, and 3.

• 設有一試驗其樣本空間為 S ,對 S 中之任一事件 A指定一值 P(A) ,若 P(.)滿足上述三個公理,則稱 P ( . )為一機率測度,且稱 P(A) 為事件 A 的機率。

Page 38: Experiment

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

Theorem 1:Theorem 1: 零事件的機率零事件的機率

• 零事件的機率等於零• Pr(Ø)=0

Page 39: Experiment

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

Theorem 2:Theorem 2:

• For any finite sequence of n disjoint events A1,A2,…,An

n

ii

n

ii APAP

11

)()(

11

)()(i

ii

i APAP

與公理 3的不同處

Page 40: Experiment

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

Theorem 2:Theorem 2:

• Proof. 假設一組無窮盡的事件序列 A1, A2, A3,…, 其中 A1… An 為互斥事件 , A

i = , i > n

0)(1

n

iiAP

11

)()(i

ii

i APAP

111

)()()(ni

i

n

ii

ii APAPAP

Page 41: Experiment

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

Theorem 3:Theorem 3:餘事件的機率餘事件的機率Probability of the complement of an eventProbability of the complement of an event

• Let Ac denote the complement of A. Then P(Ac) = 1 – P(A).

• Proof: • Since A and Ac are disjoint events and A Ac = S, • it follows from Theorem 2 that P(S) = P(A) +

P(Ac). • Since P(S) =1 by Axiom 2, • then P(Ac) = 1 – P(A).

定義定義

Page 42: Experiment

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

Theorem 4:Theorem 4: 機率的範圍機率的範圍

• For any event A, 0 P(A) 1.≦ ≦• Proof.

• 從公理 1 得知 P(A) 0.≧• 如果 P(A) > 1

• 則 P(Ac) < 0 →違反公理 1

• 所以 P(A) 1≦

定義定義

Page 43: Experiment

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

Theorem 5Theorem 5

• If A B, then P(A) P(B)≦• Proof.• B = A BAc

• P(B) = P(A) P(BAc )• P(BAc ) 0≧• P(A) P(B)≦

定義定義

A

BAcB

Page 44: Experiment

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

Theorem 6: Theorem 6:

• P(A B) = P(A) + P(B) – P(AB)

• Proof:• P(A B) = P(ABc) + P(AB) + P(AcB)• P(A) = P(ABc) + P(AB)• P(B) = P(AcB)+ P(AB) A B

ABC AB ACB

Page 45: Experiment

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

Theorem 6: Theorem 6:

• P(A1 A∪ 2 A∪ 3)

= P(A1) + P(A2) + P(A3)

– [ P(A1 ∩ A2 ) + P(A2 ∩ A3 )

+ P(A1 ∩ A3 ) ] + P(A1 ∩ A2 ∩ A3 )

Page 46: Experiment

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

例題例題• Suppose that 15% of the freshmen fail

chemistry, • 12% fail math, • and 5% fail both. • Suppose a first‑year student is picked at

random. Find the probability that the student failed at least one of the courses.

• P(A B) = P(A) + P(B) – P(AB)• = .15 + .12 - .05 =.22

Page 47: Experiment

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

Conditional ProbabilityConditional Probability條件機率條件機率

• P(AB) : The probability that some event A occurs given that some other event B has already occurred.

• If the probability of one event varies depending on whether a second event has occurred, the two events are said to be dependent.

定義定義

Page 48: Experiment

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

Conditional ProbabilityConditional Probability條件機率條件機率

• A : 大學畢業生• B :年薪五萬元• P(B) 年薪五萬元的機率 P(B A) 大學畢業生年薪五萬的機率

Page 49: Experiment

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

Joint Probability TablesJoint Probability Tables聯合機率表聯合機率表

性別 錄取 拒絕 Total

男 3800 4700 8500

女 1600 2400 4000Total 5400 7100 12,500

是否錄取 row sum

column sum

Page 50: Experiment

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

Joint Probability TablesJoint Probability Tables聯合機率表聯合機率表

男生且被拒絕的機率 = 4700/12500 =.376

Marginal

性別 錄取 拒絕 Probability

男 0.304 0.376 0.68

女 0.128 0.192 0.32Marginal 0.432 0.568 1

Probability

是否錄取

A joint probability shows the probability that an observation will possess two (or more) characteristics simultaneously. Every joint probability must be a number in the closed interval [0,1] and the sum of all joint probabilities must be 1.

Page 51: Experiment

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

Marginal ProbabilityMarginal Probability

男生佔全體人數的 6

8%

P(錄取) = P( 男錄取 ) + P( 女錄取 )

= .304 + .128 =.432

Marginal

性別 錄取 拒絕 Probability

男 0.304 0.376 0.68

女 0.128 0.192 0.32Marginal 0.432 0.568 1

Probability

是否錄取

Page 52: Experiment

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

Marginal ProbabilityMarginal Probability

Marginal

性別 錄取 拒絕 Probability

男 0.304 0.376 0.68

女 0.128 0.192 0.32Marginal 0.432 0.568 1

Probability

是否錄取

如何知道組織是否有性別歧視 -- 即女生的錄取率是否顯著的低於男性?

Page 53: Experiment

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

Conditional ProbabilityConditional Probability

• 已知事件 B 發生時,事件 A 發生的條件機率:= A 與 B 的交集比上事件 B 發生的機率

AS

B

0)( provided

)(

)( )(

BP

BP

BAPBAP

定義定義

Page 54: Experiment

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

Conditional ProbabilityConditional Probability

• 我們想要知道下列兩種機率是否有別?• P(拒絕男生 ) = P( 已知申請人為男性,申請人被拒絕)

• P(拒絕女生 ) = P( 已知申請人為女性,申請人被拒絕)

Page 55: Experiment

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

Conditional ProbabilityConditional Probability

)(

)( )(

男生男生被拒絕男生被拒絕

P

PP

Marginal

性別 錄取 拒絕 Probability

男 0.304 0.376 0.68

女 0.128 0.192 0.32Marginal 0.432 0.568 1

Probability

是否錄取

553.680.

376.

Page 56: Experiment

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

Conditional ProbabilityConditional Probability

)(

)( )(

男生男生被拒絕男生被拒絕

f

fP

553.

500,8

700,4

性別 錄取 拒絕 Total

男 3800 4700 8500

女 1600 2400 4000Total 5400 7100 12,500

是否錄取

Page 57: Experiment

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

Conditional ProbabilityConditional Probability

)( 男生被拒絕P

Marginal

性別 錄取 拒絕 Probability

男 0.304 0.376 0.68

女 0.128 0.192 0.32Marginal 0.432 0.568 1

Probability

是否錄取

553.680.

376. )( 女生被拒絕P 600.

320.

192.

為什麼男生的拒絕率看起來好像比較高 ?

<

Page 58: Experiment

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

Multiplicative law of probabilityMultiplicative law of probability

AS

B

)(

)( )(

BP

BAPBAP )()()( BAPBPBAP

)(

)( )(

AP

BAPABP )()()( ABPAPBAP

定義定義

Page 59: Experiment

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

Multiplicative law of probabilityMultiplicative law of probability

• 例題:已知一家電公司當日進貨 60 台電視機中有 5 台有毛病。如果第二天僅賣出兩台電視,求賣出去的兩台都有毛病的機率?

• A = {賣出的第一台有毛病 }• B = {賣出的第二台有毛病 }• A∩B= 兩台都有毛病

)()()( ABPAPBAP 0056.177

1

59

4

60

5

實例實例

Page 60: Experiment

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

Multiplicative law of probabilityMultiplicative law of probability

• 例題:續上題,如果第二天僅賣出兩台電視,求第一台有毛病,第二台沒有毛病的機率?

• A = {賣出的第一台有毛病 }• C = {賣出的第二台沒有毛病 }• P(C|A) = 55/59

)()()( ACPAPCAP

0777.59

55

60

5

實例實例

Page 61: Experiment

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

IndependenceIndependence 獨立獨立• 如果事件 A 發生的機率與事件 B 是否發生無關,即不受事件 B 的影響,則 A 與 B 為獨立事件:

• P(A|B) = P(A)• Event A and B are independent if and only if

)()()( BPAPBAP

定義定義

0)( BAP 互斥事件注意:

Page 62: Experiment

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

IndependenceIndependence 獨立獨立• Theorem: If two events A and B are independen

t, then the events A and Bc are also independent.• Proof.

)()()( BAPAPBAP c

定義定義

AS

B

)()()( BPAPAP

)](1)[( BPAP

)()( cBPAP ∵ A and B are independent

Page 63: Experiment

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

IndependenceIndependence 獨立獨立• Approximately 30% of the sales representatives hired by a firm quit in

less than 1 year. Suppose that two sales representatives are hired and assume that the first sales representative's behavior is independent of the second sales representative's behavior.

• (a) What is the probability that both quit within a year?

• (b) Find the probability that exactly one representative quits.

)()()(quit)both ( BPAPBAPP

)()( BAPBAP cc

09.)3)(.3(.

quits) second and staysP(first stays) second and quitsP(first

quits) oneexactly (

P

例題例題

)()()()( BPAPBPAP cc 42.)3)(.7(.)7)(.3(.

Page 64: Experiment

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

Tree DiagramsTree Diagrams 例題例題

.3

.7

A

Ac

.3

.7

B

Bc

.3

.7

B

Bc

09.)3)(.3(.)( BAP

21.)7)(.3(.)( cBAP

21.)3)(.7(.)( BAP c

49.)7)(.7(.)( cc BAP

Page 65: Experiment

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

IndependenceIndependence 獨立獨立• 一對 20歲的年輕夫婦考慮參加下列退休計畫:福利金只有在活超過 70歲才能領取。假設先生活到 70歲的機率為 .6,太太活到 70歲的機率為 .7,假設兩人死亡的機率為獨立事件,如果兩人都參加該計畫,至少一個人可以領到福利金的機率為?

)()()(

lives)on least at (cc WMPWMPWMP

P

例題例題

88.)3)(.6(.)7)(.4(.)7)(.6(. die)P(both - 1 lives)on least at ( P

88.)3)(.4(.1

Page 66: Experiment

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

Sampling with and without Sampling with and without replacementreplacement

Selecting a random sample can be viewed as a process in which we sequentially obtain one observation after another. When we sample with replacement, successive outcomes are independent:

概念概念

)()()( BAPBPBAP )()()( ABPAPBAP

When we sample without replacement, successive outcomes are not independent:

)()()( BPAPBAP

Page 67: Experiment

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

Sampling without replacementSampling without replacement

租車公司有十部表面上看起來一樣的車,但其中兩部車煞車有問題,有兩人同時來租車,請問第一人租到好車,第二人租到壞車的機率?令 A={ 第一個人租到好車 } B={ 第二人租到壞車 }

例題例題

)()()( ABPAPBAP

178.9

2

10

8

Page 68: Experiment

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

Sampling with replacementSampling with replacement

十家賭場中有 7 家有逃漏稅的情形, IRS 每年抽檢一家,請問第一年抽到沒有逃漏稅的賭場,第二年抽到逃漏稅的賭場的機率為何?

例題例題

21.10

7

10

3

)()()( BPAPBAP

Page 69: Experiment

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

樣本空間分割樣本空間分割The sample space of an experiment is partitioned into k mutually exclusive and exhaustive events A1, A2, … Ak

若 A1, A2, … Ak為樣本空間 S 的部分集合,且滿足下列條件:1. A1 A∪ 2 A∪ 3… A∪ k= S

2. Ai∩Aj =

則稱 {A1, A2, … Ak} 為樣本空間 S 的一分割 (partition)

定義定義

Page 70: Experiment

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

樣本空間分割樣本空間分割若 {A1, A2, … Ak} 為樣本空間 S 的一分割 (partition) ,且 B 為 S 中的任一其他事件,則 {A1B, A2

B,… AkB} 為事件 B 的一分割。

A1 A2

A5 A3A4

B)()()(

)(

21

21

BABABA

BAAABSB

k

k

S

為互斥事件)(,),(),( 21 BABABA k

k

jj BAPBP

1

)()(

定義定義

Page 71: Experiment

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

樣本空間分割樣本空間分割

若 {A1, A2, … Ak} 為樣本空間 S 的一分割 (partition) ,且 P(Aj)>0 ,則對任何 S 中的事件 B

A1 A2

A5 A3A4

BS

k

jj BAPBP

1

)()(

)()()(

1for 0)( if

jjj

j

ABPAPBAP

k,jAP

k

jjj ABPAPBP

1

)()()(

定義定義

Page 72: Experiment

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

樣本空間分割樣本空間分割• 某公司甲乙兩董事要競選董事缺,甲股東當選之機率為 .6 ,乙股東當選的機率為 .4 。假如甲選上,公司發展新產品的機率為 .8 ,若乙選上,公司發展新產品的機率為 .3 ,求公司發展新產品的機率?(交大)

• B = 公司發展新產品• P(甲 ) = .6 P(乙 )=.4• P(B∣甲 )=.8 P(B∣乙 )=.3 • P(B) =P(甲 ) P(B∣甲 ) + P(乙) P(B∣乙 )• =.6 ×.8 + .4 ×.3 = .6

例題例題

Page 73: Experiment

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

Bayes’ TheoremBayes’ Theorem 貝氏定理貝氏定理

令 {A1, A2, … Ak} 為樣本空間 S 的一分割 (partition) ,且 P(A

j)>0 ,令 B 為 S 中的任一事件,且 P(B)>0, 則 for i=1,…k

A1 A2

A5 A3A4

BS

k

jjj

iii

ABPAP

ABPAPBAP

1

)()(

)()()(

)(

)()(

:Proof

BP

BAPBAP i

i

定義定義

Page 74: Experiment

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

Bayes’ TheoremBayes’ Theorem 貝氏定理貝氏定理

k

jjj

iii

ABPAP

ABPAPBAP

1

)()(

)()()(

Posterior probability

事後機率

Prior probability

事前機率

定義定義

Page 75: Experiment

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

Bayes’ TheoremBayes’ Theorem 貝氏定理貝氏定理

• 醫院研發一種新的檢驗方法,可以測出新生兒是否有某種精神疾病,從過去的經驗得知,新生兒得這種病的機率為 .003 。如果一個新生兒患有這種疾病,則檢查的結果 98% 的機率會測出陽性反應,但有 2% 的機率會呈現陰性反應。如果新生兒沒有這種疾病,則此檢驗 99%會得出陰性結果,但有 1% 的機率會得到誤差的陽性結果。

• 一新生兒接受此項檢驗,結果得到陽性反應,此新生兒的到精神疾病的機率為何?

例題例題

Page 76: Experiment

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

Bayes’ TheoremBayes’ Theorem 貝氏定理貝氏定理

• (解一)• 假設有 100,000 個嬰兒接受這個檢驗。• 根據先前資訊( prior information),我們知道 1

00,000 個嬰兒中有 300患有此疾病( .3%), 99,700 為健康兒。

• 300 個患病的嬰兒中,有 294 個( 98%)會呈現陽性反應, 6 個呈現陰性反應。

• 在 99,700健康兒中, 98,703(99%) 會呈現陰性,997 個嬰兒會呈現陽性反應。

例題例題

Page 77: Experiment

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

Bayes’ TheoremBayes’ Theorem 貝氏定理貝氏定理

•(解一)

例題例題

健康狀態 陽性 陰性 Total

健康 997 98703 99700患有精神病 294 6 300Total 1291 98709 100000

檢驗結果

P (患有精神病︳呈陽性反應) =

294/1291 = .2277

Page 78: Experiment

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

Bayes’ TheoremBayes’ Theorem 貝氏定理貝氏定理• (解二) A1={陽性反應} A2={陰性反應}• D1={嬰兒患有精神疾病} D2={健康嬰兒} • 已知 P(D1)=.003 → P(D2)=.997 • P(A1︱D1)=.98• P(A2︱D2)=.99 → P (A1︱D2)=.01

例題例題

)()()()(

)()(

)(

)()()(

212111

111

1

11111 DAPDPDAPDP

DAPDP

AP

DAPDPADP

2277.)01)(.997(.)98)(.003(.

)98)(.003(.)( 11

ADP

Page 79: Experiment

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

Tree DiagramsTree Diagrams 例題例題

.003

.997

D1 有病

D2健康

.98

.02

A1 陽

A2 陰

.01

.99

00294.)98)(.003(.))(( 111 DADP

A1 陽

A2 陰

00006.)02)(.003(.))(( 121 DADP

00997.)01)(.997(.))(( 212 DADP

98703.)99)(.997(.))(( 222 DADP

(.00294)/(.00294+.00997) =.2277

Page 80: Experiment

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

Bayes’ TheoremBayes’ Theorem 貝氏定理貝氏定理

• E1 = 工廠 1 所製造的引擎• E2 = 工廠 2 所製造的引擎• A =引擎有問題• 假設 P(A E∣ 1)=.02 P(A E∣ 2)=.03• P(E1) = .40 P(E2) = .60• 任意檢查一引擎發現有瑕疵,求此引擎來自於工廠 1 的機率為何?

例題例題

Page 81: Experiment

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

Tree DiagramsTree Diagrams 例題例題

.4

.6

E1

E2

.02

.98

A

Ac

.03

.97

008.)02)(.4(.))(( 11 EAEP

Ac

392.)98)(.4(.))(( 11 EAEP c

018.)03)(.6(.))(( 22 EAEP

582.)97)(.6(.))(( 22 EAEP c

(.008)/(.008+.018) =.308

A

Page 82: Experiment

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

• 某女校一年級至四年級學生人數之比率分別為 27% , 26% , 24% , 23% ,在第一學期結束時據了解各年級有固定男朋友之比率為10%, 25%, 30%, 35% 。某男生於該校校慶時認識一位尚無固定男友之女孩,剖為傾心,請問她不巧是四年級老大姐的機率為? (交大)

• P (無男友) = .27 ×.9 + .26 ×.75 + .24 ×.70 + .23 ×.65 = .7555

• P(四年級∣無男友 ) = (.23 ×.65)/.7555 = .1979

例題例題

Page 83: Experiment

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

Fundamental rule of countingFundamental rule of counting

• 若事件 A 有 n1種可能• 事件 B 有 n2種可能• 則事件 A 與事件 B 依序發生的可能共有

( n1 ×n2) 種

概念概念

Page 84: Experiment

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

Factorial NotationFactorial Notation

• Let N be a positive integer.

• The product of all integers from 1 to N is called N factorial and is denoted N!:

N!=N(N-1)(N-2)…(3)(2)(1)

We define 0! = 1

概念概念

Page 85: Experiment

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

PermutationPermutation 排列排列

• A permutation of N different things taken R at a time, denoted NPR or PN, R is an arrangement in a specific order of any R of the N things.

概念概念

Page 86: Experiment

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

PermutationPermutation 排列排列 概念概念

• NP3

N N-1 N-2

n1 n2 n3

Page 87: Experiment

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

PermutationPermutation 排列排列

)1()1(, knnnP kn

1)1)((

1)1)(()1()1(,

knkn

knknknnnP kn

)!(

!, kn

nP kn

Page 88: Experiment

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

PermutationPermutation 排列排列

• 公司面試 10 名應徵者,準備錄取三人,分任三個薪資高低不同的職位,請問有多少種錄取方式?

例題例題

7208910!7

!10

)!310(

!103,10

P

Page 89: Experiment

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

CombinationCombination 組合組合• A combination of N things taken R at a time,

denoted NCR, is an arrangement of any R of these things without regard to order.

• N各物件取 R 個,但不考慮 R 之間的順序。• 請問下列何者為排列問題?何者是組合問題?

• 某職棒球隊共有 24 名球員,要選 9 人參加比賽,共有幾種選法?

• 某職籃球隊共有 12 名球員,要選出 5 人參加比賽,共有幾種選法?

Page 90: Experiment

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

CombinationCombination 組合組合

• 將 A, B, C, D四取二排列: P4,2 = 4 ×3{A, B} {B, A}{A, C} {C, A}{A, D} {D, A}{B, C} {C, B}{B, D} {D, B}{C, D} {D, C}

組合方式有幾種?

先排列後將重複的組刪除

Page 91: Experiment

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

CombinationCombination 組合組合

將 A, B, C, D四取三排列: P4,3 = 4 ×3 ×2{A, B, C} {A, C, B} {B, C, A} {B, A, C} {C, A, B} {C, B, A}{A, B, D} {A, D, B} {B, D, A} {B, A, D} {D, A, B} {D, B, A}{B, D, C} {B, C, D} {C, B, D} {C, D, B} {D, C, B} {D, B, C}{A, C, D} {A, D, C} {C, A, D} {C, D, A} {D, A, C} {D, C, A}

3 個字母有 3! = 3 ×2 =6 種排列可能,這 6 種可能在組合中只能算是一種。

46

24

!33,4

P

Page 92: Experiment

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

CombinationCombination 組合組合

!,

, R

PC RN

RN

R 個元素有 R!種排列方式 !)!(

!, RRN

NC RN

)!(

!

RN

N