Presentation is loading. Please wait.

Presentation is loading. Please wait.

Experiment and random phenomenon

Similar presentations


Presentation on theme: "Experiment and random phenomenon"— Presentation transcript:

1 Experiment and random phenomenon
定義 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. 社會統計(上) 2007

2 Randomness隨機性 如果結果不確定但如果我們重複很多次試驗或事情發生很多次之後,其結果的分佈依循一定的規則,我們稱此一現象具有隨機性。 當一試驗的結果或現象無法事先預測時但結果的分佈依循一定的規則,稱此試驗為「隨機試驗」,此現象為「隨機現象」。 社會統計(上) 2007

3 Example of Experiments
實例 試驗: Measuring the lifetime (time to failure) of a given product Inspecting an item to determine whether it is defective 丟銅板 隨機現象: 生男生女 革命或政變的發生 社會統計(上) 2007

4 機率法則要回答的問題:如果我們重複很多次結果會如何?

5 Probability機率 機率理論是數學中用來描述隨機現象的一支學問。
一個隨機現象的結果發生的機率為:重複很多次試驗之後,這個特定結果發生次數所佔的比例,也就是說,機率為長期的相對次數。 社會統計(上) 2007

6 Probability Models機率模型
機率模型涉及兩個步驟: (1) 描述隨機現象所有可能發生的結果(outcomes) (2) 將適當機率配給這些結果。 社會統計(上) 2007

7 Basic Outcomes and Sample Space
定義 The set of all possible basic outcomes for a given experiment (random phenomenon) 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表示。 社會統計(上) 2007

8 Basic Outcomes and Sample Space
實例 某家公司在六個不同的城市有辦公室,某新進員工將被分派到其中的一個辦公室上班,則所有可能的分派為: o1= 台北 o2= 桃園 o3= 台中 o4= 台南 o5= 高雄 o6= 屏東 分派的樣本空間為: S = { o1 , o2 , o3 , o4 ,o5 ,o6 } 如果這名員工被分派至台南上班,我們說該試驗的結果為 o4 =台南,即該試驗的o4結果發生了。 社會統計(上) 2007

9 Venn Diagrams S = { o1 , o2 , o3 , o4 ,o5 ,o6 } o1 o2 o3 o4 o5 o6 ‧ ‧
定義 S = { o1 , o2 , o3 , o4 ,o5 ,o6 } o o o3 o o o6 社會統計(上) 2007

10 Event事件 定義 An event is an outcome or a set of outcomes of a random phenomenon. That is, an event is a subset of the sample space. 事件為包含樣本空間中一個或一個以上樣本元素(基本結果)的子集合,即樣本空間的任何部分集合(subset),一般以英文大寫字母表示。 社會統計(上) 2007

11 Event事件 上例中,該員工被分派至南台灣的事件為: A = {o4 ,o5 ,o6 }
定義 實例 上例中,該員工被分派至南台灣的事件為: A = {o4 ,o5 ,o6 } 如果該員工被分派至台南上班,我們可以說A事件發生了。 若B事件為該員工被分派至直轄市上班,則 B = {o1 ,o5} 社會統計(上) 2007

12 Venn Diagrams S = { o1 , o2 , o3 , o4 ,o5 ,o6 } o1 o2 o3 o4 o5 o6 ‧ ‧
定義 S = { o1 , o2 , o3 , o4 ,o5 ,o6 } B事件 o o o3 o o o6 A事件 社會統計(上) 2007

13 Event事件 寫出丟骰子一次所得數目的樣本空間: S = {1, 2, 3, 4, 5, 6} 寫出得到偶數的事件:
實例 寫出丟骰子一次所得數目的樣本空間: S = {1, 2, 3, 4, 5, 6} 寫出得到偶數的事件: A = {2,4,6} 寫出數字大於2的事件: B = {3,4,5,6} 社會統計(上) 2007

14 Event事件 丟銅板得到H正面或T反面,寫出丟一銅板三次的樣本空間:
實例 丟銅板得到H正面或T反面,寫出丟一銅板三次的樣本空間: S = {HHH, HHT, HTH, HTT, THH, THT, TTH, TTT} 設A表示第一次出現正面的事件,則 A = {HHH, HHT, HTH, HTT} 社會統計(上) 2007

15 Assigning 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. 社會統計(上) 2007

16 Assigning 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. 社會統計(上) 2007

17 Assigning 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 社會統計(上) 2007

18 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. 社會統計(上) 2007

19 The Relative Frequency Approach 相對次數(後天)機率理論
定義 當一試驗在完全相同的情境中重複試驗,某事件A發生的機率可以定義為:當試驗在相同情境下重複無限次時,A所發生的次數與試驗總次數之比。 由於這種機率為長期試驗的結果,因此又稱之為後天機率、相對次數。由於這種機率為歸納多次試驗的結果所得,故又稱為統計機率或經驗機率。 社會統計(上) 2007

20 後天機率理論的缺陷 定義 (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. 社會統計(上) 2007

21 後天機率理論的缺陷 定義 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. 社會統計(上) 2007

22 The 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,符合某條件結果的個數與總結果數之比。 社會統計(上) 2007

23 The Equally Likely Approach 古典(先天)機率理論
實例 直一骰子兩次,求點數和等於6的機率? E = { (1,5) (2,4) (3,3) (4,2) (5,1)} P(E) = 5/36 其他先天機率:丟銅板、抽籤、彩券等。 先天機率最重要的問題:所有樣本點發生的機率是否相同? 社會統計(上) 2007

24 Objective Probability客觀機率
定義 A probability obtained by using a relative frequency approach or an equally likely approach is called an objective probability. 社會統計(上) 2007

25 The 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. 社會統計(上) 2007

26 Odds可能性 有時候人們以「發生」與「不發生」的比值(odds)來陳述他們對於事件發生機率的意見。
定義 有時候人們以「發生」與「不發生」的比值(odds)來陳述他們對於事件發生機率的意見。 如經常聽到某人說某賭局、競賽、或遊戲有3:1的勝算,則表示某人有75%贏的機率。 If the odds in favor of event A occurring are a to b, then 社會統計(上) 2007

27 Which 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. 社會統計(上) 2007

28 Which approach is best?
實例 已知懷單胎,生男的機率為何? (1) 依先天機率: 性別有男女兩類,故生男的機率為1/2 (2) 依後天機率: 台灣地區男性人口佔52%,故生男的機率為52% (3) 主觀機率: 由於飲食習慣的改變,現代人大量攝取動物性蛋白質,使生男的機率增加為60% 社會統計(上) 2007

29 Set Theory 定義 Subset子集合 An event A is contained in another event B if every outcome 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, 社會統計(上) 2007

30 Operation of Set Theory: Unions聯集
定義 S 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. A B 社會統計(上) 2007

31 Operation of Set Theory: Unions聯集
定義 S 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. A B 社會統計(上) 2007

32 Operation of Set Theory: Intersection交集
定義 Intersection交集: Let A and B be two events in the sample 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. S A B 社會統計(上) 2007

33 Operation of Set Theory: Intersection交集
定義 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. S A B 社會統計(上) 2007

34 Complement 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. S A Ac 社會統計(上) 2007

35 Complement has the following properties:
定義 (Ac)c =A A  Ac = S Øc = S Sc = Ø A  Ac = Ø S A Ac 社會統計(上) 2007

36 Complement has the following properties:
定義 (A ∪ B)c =Ac ∩Bc (A ∩ B)c =Ac ∪ Bc S Bc B A Ac P(A) = P(A ∩ B) +P(A ∩ Bc) P(Ac ∩ Bc) = 1 - P(A ∪ B) P(Ac ∪ Bc) = 1 - P(A ∩ B) 社會統計(上) 2007

37 Mutually Exclusive 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. 社會統計(上) 2007

38 Some 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. 社會統計(上) 2007

39 Some basic rules of probability
定義 Rule1. 所有機率的數值皆介於0與1之間: For each basic outcome oi, 0 P(oi)  1. The probability of P(A) satisfies 0 P(A)  1. Rule 2. 將所有的可能發生的結果的機率加總必等於一: Let event S = { o1 , o2 , o3 , o4 ,o5 ,…on } represent the sample space of an experiment. The probability of S is P(S) = sP(oi) = 1 Rule 3. 一個事件不發生的機率等於1減去發生的機率: P(Ac) = 1- P(A) Rule 4. 如果兩事件沒有共同的結果,兩事件發生的總和機率為個別機率的和: If A and B are disjoint: P(A or B) = P(A) + P(B)

40 Definition 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, … 社會統計(上) 2007

41 Definition 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的機率。 社會統計(上) 2007

42 Theorem 1:零事件的機率 零事件的機率等於零 Pr(Ø)=0 社會統計(上) 2007

43 Theorem 2: For any finite sequence of n disjoint events A1,A2,…,An
與公理3的不同處 社會統計(上) 2007

44 Theorem 2: Proof. 假設一組無窮盡的事件序列A1, A2, A3,…, 其中A1… An 為互斥事件, Ai = , i > n 社會統計(上) 2007

45 Theorem 3:餘事件的機率 Probability 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). 社會統計(上) 2007

46 Theorem 4:機率的範圍 For any event A, 0≦ P(A) ≦ 1. Proof. 從公理1得知 P(A) ≧ 0.
定義 For any event A, 0≦ P(A) ≦ 1. Proof. 從公理1得知 P(A) ≧ 0. 如果 P(A) > 1 則 P(Ac) < 0 →違反公理1 所以 P(A) ≦ 1 社會統計(上) 2007

47 Theorem 5 If A  B, then P(A) ≦ P(B) Proof. B = A  BAc
定義 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) B BAc A 社會統計(上) 2007

48 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 社會統計(上) 2007

49 Theorem 6: P(A1 ∪ A2 ∪A3) = P(A1) + P(A2) + P(A3)
– [ P(A1 ∩ A2 ) + P(A2 ∩ A3 ) + P(A1 ∩ A3 ) ] + P(A1 ∩ A2 ∩ A3 ) 社會統計(上) 2007

50 例題 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) = - .05 =.22 社會統計(上) 2007

51 聯合機率 若A, B為同一樣本空間的兩事件,則A與B同時發生的可能性叫做A與B的聯合機率 (joint probability)。
聯合機率即A 與B之交集合發生的機率,以P(A ∩B)來表示。 社會統計(上) 2007

52 例子 擲公平骰子一次, A : 出現奇數點 B : 出現點1 P(A ∩B) = 1/6 社會統計(上) 2007

53 例子 擲兩顆公平骰子一次, A : 點數和為7 B : 第一顆骰子點數為6 P(A∩B) = 1/36 社會統計(上) 2007

54 Joint Probability Tables 聯合機率表
row sum column sum 社會統計(上) 2007

55 Joint Probability Tables 聯合機率表
男生且被拒絕的機率= 4700/12500 =.376 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. 社會統計(上) 2007

56 Marginal Probability 男生佔全體人數的68% P(錄取)= P(男錄取) + P(女錄取)
= =.432 社會統計(上) 2007

57 Marginal Probability 如何知道組織是否有性別歧視--即女生的錄取率是否顯著的低於男性? 社會統計(上) 2007

58 Conditional Probability 條件機率
定義 P(AB) : 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. 社會統計(上) 2007

59 Conditional Probability 條件機率
P(B) 年薪五萬元的機率  P(B  A) 大學畢業生年薪五萬的機率 社會統計(上) 2007

60 例子 擲公平骰子一次, A : 出現奇數點 B : 出現點1 P(B| A) = ?
已知事件A發生(出現奇數點),樣本空間縮減成為僅有三個樣本點的「縮減樣本空間」(reduced sample space) P(B| A)=(縮減樣本空間中屬於B事件的樣本點數目)/ (縮減樣本空間的樣本點總數) 社會統計(上) 2007

61 Conditional Probability
定義 已知事件B發生時,事件A發生的條件機率: = (A與B的交集) 比上(事件B發生的機率) S A B 社會統計(上) 2007

62 Conditional Probability
我們想要知道下列兩種機率是否有別? P(拒絕男生) = P(已知申請人為男性,申請人被拒絕) P(拒絕女生) = P(已知申請人為女性,申請人被拒絕) 社會統計(上) 2007

63 Conditional Probability
社會統計(上) 2007

64 Conditional Probability
社會統計(上) 2007

65 Conditional Probability
< 為什麼男生的拒絕率看起來好像比較高? 社會統計(上) 2007

66 Multiplicative law of probability
定義 S A B 社會統計(上) 2007

67 Multiplicative law of probability
實例 例題:已知一家電公司當日進貨60台電視機中有5台有毛病。如果第二天僅賣出兩台電視,求賣出去的兩台都有毛病的機率? A = {賣出的第一台有毛病} B = {賣出的第二台有毛病} A∩B=兩台都有毛病 社會統計(上) 2007

68 Multiplicative law of probability
實例 例題:續上題,如果第二天僅賣出兩台電視,求第一台有毛病,第二台沒有毛病的機率? A = {賣出的第一台有毛病} C = {賣出的第二台沒有毛病} P(C|A) = 55/59 社會統計(上) 2007

69 Independence獨立 如果事件A發生的機率與事件B是否發生無關,即不受事件B的影響,則A與B為獨立事件:
定義 如果事件A發生的機率與事件B是否發生無關,即不受事件B的影響,則A與B為獨立事件: Event A and B are independent if and only if 社會統計(上) 2007

70 Independence獨立 定義 若A與B為獨立,則 P(A|B) = P(A) P(B|A) = P(B) 社會統計(上) 2007

71 Independence獨立 若A, B為樣本空間上面的事件,且P(A) ≠0, P(B) ≠0 P(A|B) = P(A)
或 P(B|A) = P(B) 則A, B稱為彼此獨立的事件 P(A|B) ≠ P(A) 或 P(B|A) ≠ P(B) 則A, B稱為彼此相依的事件(dependent events) 社會統計(上) 2007

72 例子 擲公平骰子一次, A : 出現奇數點 B : 出現點1 P(B| A) = 1/3 ≠ P(A|B) = 1 社會統計(上) 2007

73 Independence獨立 定義 獨立事件 注意: 互斥事件 社會統計(上) 2007

74 互斥與獨立 若A與B彼此獨立,則A與B一定不互斥 P(A|B) = P(A) ∵P(A) ≠0 ∴P(A∩B) ≠0
社會統計(上) 2007

75 互斥與獨立 若A與B彼此不互斥,則A與B不一定獨立 不互斥 P(A∩B) ≠0 P(A|B) ≠ 0
P(A|B) ≠0不一定會意含 P(A|B) = P(A) 社會統計(上) 2007

76 互斥與獨立 若A與B彼此互斥,則A與B一定不獨立 互斥 P(A∩B) = 0 P(A|B) = 0 ≠P(A)
P(A|B) ≠P(A) 意含 A與B不獨立 彼此互斥表示當B發生之後,A一定不會發生,兩者有相依關係。 社會統計(上) 2007

77 互斥與獨立 若A與B彼此不獨立,則A與B不一定互斥 社會統計(上) 2007

78 Independence獨立 定義 Theorem: If two events A and B are independent, then the events A and Bc are also independent. Proof. S A B ∵ A and B are independent 社會統計(上) 2007

79 Independence獨立 例題 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. 社會統計(上) 2007

80 Independence獨立 例題 (a) What is the probability that both quit within a year? (b) Find the probability that exactly one representative quits. 社會統計(上) 2007

81 Tree Diagrams 例題 B .3 A .7 Bc .3 B .3 .7 Ac .7 Bc 社會統計(上) 2007

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

83 Sampling with and without replacement
概念 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: When we sample without replacement, successive outcomes are not independent: 社會統計(上) 2007

84 Sampling without replacement
例題 租車公司有十部表面上看起來一樣的車,但其中兩部車煞車有問題,有兩人同時來租車,請問第一人租到好車,第二人租到壞車的機率? 令 A={第一個人租到好車} B={第二人租到壞車} 社會統計(上) 2007

85 Sampling with replacement
例題 十家賭場中有7家有逃漏稅的情形,IRS每年抽檢一家,請問第一年抽到沒有逃漏稅的賭場,第二年抽到逃漏稅的賭場的機率為何? 社會統計(上) 2007

86 樣本空間分割 定義 The sample space of an experiment is partitioned into k mutually exclusive and exhaustive events A1, A2, … Ak 若A1, A2, … Ak為樣本空間S的部分集合,且滿足下列條件: 1. A1∪A2 ∪A3… ∪Ak= S 2. Ai∩Aj =  則稱{A1, A2, … Ak}為樣本空間S的一分割(partition) 社會統計(上) 2007

87 樣本空間分割 定義 若{A1, A2, … Ak}為樣本空間S的一分割(partition),且B為S中的任一其他事件,則{A1B, A2B,… AkB}為事件B的一分割。 S A1 B A2 A5 A3 A4 社會統計(上) 2007

88 樣本空間分割 若{A1, A2, … Ak}為樣本空間S的一分割(partition),且P(Aj)>0,則對任何S中的事件B S
定義 S A1 B A2 A5 A3 A4 若{A1, A2, … Ak}為樣本空間S的一分割(partition),且P(Aj)>0,則對任何S中的事件B 社會統計(上) 2007

89 樣本空間分割 例題 某公司甲乙兩董事要競選董事缺,甲股東當選之機率為.6 ,乙股東當選的機率為.4。假如甲選上,公司發展新產品的機率為.8,若乙選上,公司發展新產品的機率為.3,求公司發展新產品的機率?(交大) B = 公司發展新產品 P(甲) = P(乙)=.4 P(B∣甲)=.8 P(B∣乙)=.3 P(B) =P(甲) P(B∣甲) + P(乙) P(B∣乙) =.6 × ×.3 = .6 社會統計(上) 2007

90 Bayes’ Theorem貝氏定理 定義 令{A1, A2, … Ak}為樣本空間S的一分割(partition),且P(Aj)>0,令B為S中的任一事件,且P(B)>0, 則for i=1,…k S A1 B A2 A5 A3 A4 社會統計(上) 2007

91 Bayes’ Theorem貝氏定理 Posterior probability 事後機率 Prior probability 事前機率
定義 Posterior probability 事後機率 Prior probability 事前機率 社會統計(上) 2007

92 Bayes’ Theorem貝氏定理 例題 醫院研發一種新的檢驗方法,可以測出新生兒是否有某種精神疾病,從過去的經驗得知,新生兒得這種病的機率為.003。如果一個新生兒患有這種疾病,則檢查的結果98%的機率會測出陽性反應,但有2%的機率會呈現陰性反應。如果新生兒沒有這種疾病,則此檢驗99%會得出陰性結果,但有1%的機率會得到誤差的陽性結果。 一新生兒接受此項檢驗,結果得到陽性反應,此新生兒的到精神疾病的機率為何? 社會統計(上) 2007

93 Bayes’ Theorem貝氏定理 (解一) 假設有100,000個嬰兒接受這個檢驗。
例題 (解一) 假設有100,000個嬰兒接受這個檢驗。 根據先前資訊(prior information),我們知道100,000個嬰兒中有300患有此疾病(.3%),99,700為健康兒。 300個患病的嬰兒中,有294個(98%)會呈現陽性反應,6個呈現陰性反應。 在99,700健康兒中,98,703(99%)會呈現陰性,997個嬰兒會呈現陽性反應。 社會統計(上) 2007

94 Bayes’ Theorem貝氏定理 (解一) P(患有精神病︳呈陽性反應)= 294/1291 = .2277 例題 2007
社會統計(上) 2007

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

96 Tree Diagrams A1陽 .98 (.00294)/(.00294+.00997) =.2277 D1有病 .02 A2陰
例題 A1陽 .98 (.00294)/( ) =.2277 D1有病 .02 A2陰 .003 A1陽 .01 .997 D2健康 .99 A2陰 社會統計(上) 2007

97 Bayes’ Theorem貝氏定理 E1 = 工廠1所製造的引擎 E2 = 工廠2所製造的引擎 A =引擎有問題
例題 E1 = 工廠1所製造的引擎 E2 = 工廠2所製造的引擎 A =引擎有問題 假設 P(A∣E1)=.02 P(A∣E2)=.03 P(E1) = .40 P(E2) = .60 任意檢查一引擎發現有瑕疵,求此引擎來自於工廠1的機率為何? 社會統計(上) 2007

98 Tree Diagrams A .02 (.008)/(.008+.018) =.308 E1 .98 Ac .4 A .6 .03 E2
例題 A .02 (.008)/( ) =.308 E1 .98 Ac .4 A .6 .03 E2 .97 Ac 社會統計(上) 2007

99 例題 某女校一年級至四年級學生人數之比率分別為27%,26%,24%,23%,在第一學期結束時據了解各年級有固定男朋友之比率為10%, 25%, 30%, 35%。某男生於該校校慶時認識一位尚無固定男友之女孩,剖為傾心,請問她不巧是四年級老大姐的機率為?(交大) P(無男友)= .27 × × × ×.65 = .7555 P(四年級∣無男友) = (.23 ×.65)/.7555 = .1979 社會統計(上) 2007

100 Fundamental rule of counting
概念 若事件A有n1種可能 事件B有n2種可能 則事件A與事件B依序發生的可能共有 (n1 ×n2) 種 例如:事件A = {冷、暖} 事件B = {雨、陰、晴} 則明天的天候狀況共有2 *3 = 6種 社會統計(上) 2007

101 Factorial Notation 令N 為一正整數.
概念 令N 為一正整數. 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 社會統計(上) 2007

102 Permutation排列 概念 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. 社會統計(上) 2007

103 Permutation排列 概念 NP3 N N-1 N-2 n1 n2 n3 社會統計(上) 2007

104 Permutation排列 社會統計(上) 2007

105 Permutation排列 公司面試10名應徵者,準備錄取三人,分任三個薪資高低不同的職位,請問有多少種錄取方式? 例題 2007
社會統計(上) 2007

106 Combination組合 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人參加比賽,共有幾種選法? 社會統計(上) 2007

107 Combination組合 將A, B, C, D四取二排列:P4,2 = 4 ×3 組合方式有幾種? 先排列後將重複的組刪除 2007
社會統計(上) 2007

108 Combination組合 將A, B, C, D四取三排列:P4,3 = 4 ×3 ×2
3個字母有3! = 3 ×2 =6 種排列可能,這6種可能在組合中只能算是一種。 社會統計(上) 2007

109 Combination組合 R個元素有R!種排列方式 社會統計(上) 2007

110 Number of possible sample
The number of possible samples of size n from a population of size N is CN, n 蘇老師想要從全班50名同學中抽取5位同學來詢問上課反應,請問共有多少種可能的樣本? C50, 5=2,118,760 社會統計(上) 2007

111 EXCEL function PN, R PERMUT(N, R) NCR COMBIN(N, R) 社會統計(上) 2007


Download ppt "Experiment and random phenomenon"

Similar presentations


Ads by Google