500 likes | 673 Views
2. Probability. Using Statistics Basic Definitions: Events, Sample Space, and Probabilities 基本定義 Basic Rules for Probability 機率基本法則 Conditional Probability 條件機率 Independence of Events 獨立事件 Combinatorial Concepts 組合 The Law of Total Probability and Bayes’ Theorem 總和機率法則與貝氏定理
E N D
2 Probability • Using Statistics • Basic Definitions: Events, Sample Space, and Probabilities 基本定義 • Basic Rules for Probability 機率基本法則 • Conditional Probability 條件機率 • Independence of Events 獨立事件 • Combinatorial Concepts 組合 • The Law of Total Probability and Bayes’ Theorem 總和機率法則與貝氏定理 • Summary and Review of Terms
LEARNING OBJECTIVES After studying this chapter, you should be able to: • Define probability, sample space, and event. • Distinguish between subjective and objective probability. • Describe the complement of an event, the intersection, and the union of two events. • Compute probabilities of various types of events. • Explain the concept of conditional probability and how to compute it. • Describe permutation and combination and their use in certain probability computations. • Explain Bayes’ theorem and its applications.
2-1 Probability is: (p.81) • A quantitative measure of uncertainty不確定性之定量衡量 • A measure of the strength of beliefin the occurrence of an uncertain event 對一不確定事件發生的信心強度之衡量 • A measure of the degree of chance or likelihood of occurrenceof an uncertain event 不確定事件發生的可能性之衡量 • Measured by a number between 0 and 1 (or between 0% and 100%) 介於0 ~ 1
Types of Probability • Objective or Classical Probability客觀機率或古典機率 • based on equally-likely events 基於相等事件 • based on long-run relative frequency of events 基於一事件之長期相對相對機率 • not based on personal beliefs 不基於個人信念 • is the same for all observers (objective) 每一觀測值均一樣 • examples: toss a coin, throw a die, pick a card
Types of Probability (Continued) • Subjective Probability 主觀機率 • based on personal beliefs, experiences, prejudices, intuition - personal judgment 基於個人信仰、經驗、偏見、直覺 • different for all observers (subjective) 所有觀測者可能有不同見解 • examples: Super Bowl(美式足球), elections, new product introduction, snowfall(降雪量)
2-2 Basic Definitions 基本定義(p.83) • Set 集合 - a collection of elements or objects of interest • Empty set 空集合(denoted by ) • a set containing no elements • Universal set 宇集(denoted by S) • a set containing all possible elements • Complement 餘集合(Not). The complement of A is • a set containing all elements of S not in A
Basic Definitions (Continued) • Intersection交集(And) • a set containing all elements in both A and B • Union聯集(Or) • a set containing all elements in A or B or both
Sets: A Intersecting with B(交集) Venn diagram(凡氏圖):呈現不同集合間的關係 S A B
Sets: A Union B(聯集) S A B
Basic Definitions (Continued) • Mutually exclusive or disjoint sets 互斥 • sets having no elements in common, having no intersection, whose intersection is the empty set • Partition 分割:互斥且聯集為宇集S • a collection of mutually exclusive sets which together include all possible elements, whose union is the universal set
Mutually Exclusive or Disjoint Sets Sets have nothing in common S B A
Sets: Partition S A3 A1 A4 A2 A5
Experiment 實驗 (p.85) • Process that leads to one of several possible outcomes * 導致某種出象(結果)的一個過程, e.g.: • Coin toss 丟銅板 • Heads,Tails • Throw die 擲骰子 • 1, 2, 3, 4, 5, 6 • Pick a card 撿撲克牌 • AH, KH, QH, ... • Introduce a new product • Each trial of an experiment has a single observed outcome. 每一次實驗只會有一個觀測出象(結果) • The precise outcome of a random experiment is unknown before a trial. 實驗前出象(結果)是未知的 * Also called a basic outcome, elementary event, or simple event
Events 事件: Definition (p.85) • Sample Space or Event Set 樣本空間 • Set of all possible outcomes (universal set宇集) for a given experiment 一個實驗所有可能的出象 • E.g.: Throw die 擲骰子 • S = {1,2,3,4,5,6} • Event 事件:具有共同特性的出象所成的子集合 • Collection of outcomes having a common characteristic • E.g.: Even number偶數 • A = {2,4,6} • Event A occurs if an outcome in the set A occurs • Probability of an event 事件機率 • Sum of the probabilities of the outcomes of which it consists 該事件所包含的各出象機率之總和 • P(A) = P(2) + P(4) + P(6)
Equally-likely Probabilities等可能發生機率(Hypothetical假設的or Ideal Experiments) • For example: • Throw a die 擲骰子 • Six possible outcomes {1,2,3,4,5,6} • If each is equally-likely, the probability of each is 1/6 = .1667 = 16.67% • Probability of each equally-likely outcome is 1 over the number of possible outcomes • Event A (even number) • P(A) = P(2) + P(4) + P(6) = 1/6 + 1/6 + 1/6 = 1/2 • for e in A 事件A大小(元素個數) p.70 樣本空間大小(元素個數)
Hearts Diamonds Clubs Spades Unionof Events ‘Heart’ and ‘Ace’ Event ‘Ace’ A A A A K K K K Q Q Q Q J J J J 10 10 10 10 9 9 9 9 8 8 8 8 7 7 7 7 6 6 6 6 5 5 5 5 4 4 4 4 3 3 3 3 2 2 2 2 The intersection of the events ‘Heart’ and ‘Ace’ comprises the single point circled twice: the ace of hearts Event ‘Heart’ Pick a Card: Sample Space 聯集 交集
2-3 Basic Rules for Probability機率基本法則(p.88) • Range of Values • Complements餘集- Probability ofnotA • Intersection交集- Probability of both AandB • Mutually exclusive events (A and C) :
Basic Rules for Probability (Continued) • Union聯集- Probability of A orB or both (rule of unions) • Mutually exclusive events互斥事件: If A and B are mutually exclusive, then 加法法則
Sets: P(A Union B) S A B
Ex. 2-13 Exercise, p.91, 10min • Exercise 2-10 (Ans. see p.700) • Exercise 2-11 (Ans. 0.49) • Exercise 2-12 (Ans. 0.7909) • Exercise 2-13 (Ans.(1)0.6, (2)0.1)
2-4 Conditional Probability (p.92) • Conditional Probability- Probability of A given B 條件機率:已知B發生時,A發生之機率 • Independent events獨立事件: if and only if(若且唯若) 公式:
2-4 Conditional Probability (Cond.) Rules of conditional probability:條件機率->乘法法則 so If events A and D are statistically independent獨立事件: so
Contingency Table列聯表 - Example 2-2(p.92) Counts IBM Total AT& T Probability that a project is undertaken by IBM given it is a telecommunications project: Telecommunication 40 10 50 Computers 20 30 50 Total 60 40 100 Probabilities AT& T IBM Total Telecommunication .40 .10 .50 Computers .20 .30 .50 Total .60 .40 1.00
Example & Exercises, p.94,15min • Example 2-3 (p.94) • Example 2-4 (p.94) • Exercise 2-16 (Ans. see p.700) • Exercise 2-17 (Ans. see p.700)
2-5 Independence of Events獨立事件(p.96) Conditions for the statistical independence of events A and B: 獨立事件乘法原則
Independence of Events - Example 2-5 Events Television (T) and Billboard (B) are assumed to be independent.
Random Sampling隨機抽樣(p.97) • 每一樣本均服從其母體機率分配 • 取後放回→機率相等→彼此獨立 →無記憶性 • 取後不放回(if 母體較樣本相對較大)→彼此獨立 • 假設:由一大母體隨機抽樣意指獨立事件
Product Rules for Independent Events獨立事件乘法法則 The probability of the intersection交集of several independent events is the product of their separate individual probabilities: The probability of the union聯集of several independent events is 1 minus the product of probabilities of their complements: Example 2-7: (p.82)
定理 條件機率展開 若諸事件均獨立,則:
Exercise, p.100, 10min • Exercise 2-19 (Ans. 0.34) • Exercise 2-20 (Ans. 0.72675) • Exercise 2-21 (Ans. 0.32) • Exercise 2-26 (Ans. 0.0039, 0.684)
Pick 5 cards from a deck of 52 - with replacement(放回) 52*52*52*52*52=525 =380,204,032 different possible outcomes Pick 5 cards from a deck of 52 - without replacement (不放回) 52*51*50*49*48 = 311,875,200 different possible outcomes 2-6 Combinatorial Concepts排列組合(p.101) Consider a pair of six-sided dice. There are six possible outcomes from throwing the first die {1,2,3,4,5,6} and six possible outcomes from throwing the second die {1,2,3,4,5,6}. Altogether, there are 6*6=36 possible outcomes from throwing the two dice. In general, if there are n events and the event i can happen in Ni possible ways, then the number of ways in which the sequence of n events may occur is N1N2...Nn.
More on Combinatorial Concepts(Tree Diagram) . . 排列 Order the letters: A, B, and C C . . . ABC B . . . . C B ACB . . A C A . . BAC . B C A C BCA . . A B CAB B A CBA 3 * 2 * 1 = 6
Factorial階乘 How many ways can you order the 3 letters A, B, and C? (不放回) There are 3 choices for the first letter, 2 for the second, and 1 for the last, so there are 3*2*1 = 6 possible ways to order the three letters A, B, and C. How many ways are there to order the 6 letters A, B, C, D, E, and F? (6*5*4*3*2*1 = 720) Factorial: For any positive integer n, we define n factorialas: n(n-1)(n-2)...(1). We denote n factorial as n!. The number n! is the number of ways in which n objects can be ordered. By definition 1! = 1 and 0! = 1.
Permutations排列 (Order is important)順序有別 What if we chose only 3 out of the 6 letters A, B, C, D, E, and F? There are 6 ways to choose the first letter, 5 ways to choose the second letter, and 4 ways to choose the third letter (leaving 3 letters unchosen). That makes 6*5*4=120 possible orderings or permutations. Permutations are the possible ordered selections of r objects out of a total of n objects. The number of permutations of n objects taken r at a time is denoted by nPr, where
Combinations組合 (Order is not Important)無順序之別 Suppose that when we pick 3 letters out of the 6 letters A, B, C, D, E, and F we chose BCD, or BDC, or CBD, or CDB, or DBC, or DCB. (These are the 6 (3!) permutations or orderings of the 3 letters B, C, and D.) But these are orderings of the same combination of 3 letters. How many combinations of 6 different letters, taking 3 at a time, are there? Combinationsare the possible selections of r items from a group of n items regardless of the order of selection. The number of combinations is denoted and is read as n choose r. An alternative notation is nCr. We define the number of combinations of r out of n elements as:
Perm & Comb Example2-8: Template for Calculating Permutations & Combinations(p.103)
Exercise, p.103, 5min • Exercise 2-29 (Ans. 0.00275) • Exercise 2-30 (Ans. 0.000018449) • Example:自1,2,3,4,5個號碼中任選3個號碼 ,中2個號碼的機率? 123 124 125 134 135 145 234 235 245 345
樂透彩劵試算每筆投注中獎機率 • 猜中三組號碼以上才有獎金,猜中三組獎金200元 • 頭獎機率六組全中:C(6,6)/C(42,6) = 0.000019% • 貳獎機率猜中五組加一特別號:[C(1,1)*C(6,5)]/C(42,6) = 0.00011437% • 參獎機率猜中五組:[C(35,1)*C(6,5)]/C(42,6) = 0.0040% • 肆獎機率猜中四組:[C(36,2)*C(6,4)]/C(42,6) = 0.1801% • 普獎機率猜中三組:[C(36,3)*C(6,3)]/C(42,6) = 2.722185% 有錢拿的機率 = 頭獎機率+貳獎機率+參獎機率+肆獎機率+普獎機率 = 2.9065% 猜中二組:[C(36,4)*C(6,2)]/C(42,6) = 16.8435% 猜中一組:[C(36,5)*C(6,1)]/C(42,6) = 43.1194% 全部槓龜:C(36,6) / C(42,6) = 37.1306% →槓龜機率:97.0935% 樂透??? 誰樂?誰透?
2-7 The Law of Total Probability總和機率法則and Bayes’ Theorem貝氏定理(p.104) The law of total probability總和機率法則: In terms of conditional probabilities條件機率: More generally (where Bi make up a partition分割): (圖2-11, p.105)
The Law of Total Probability總和機率法則 Example 2-9, p.106 Event U: Stock market will go up in the next year Event W: Economy will do well in the next year
Bayes’ Theorem貝氏定理***(p.106) • Bayes’ theorem enables you, knowing just a little more than the probability of A given B, to find the probability of B given A.在從已知B會發生A之機率,求得已知A會發生B之機率 • Based on the definition of conditional probability and the law of total probability. Applying the law of total probability to the denominator Applying the definition of conditional probability throughout
Bayes’ Theorem - Example 2-10(p.107) • A medical test for a rare disease (affecting 0.1% of the population [ ]) is imperfect: • When administered to an ill person, the test will indicate so with probability 0.92 [ ] • The event is a false negative • When administered to a person who is not ill, the test will erroneously give a positive result (false positive) with probability 0.04 [ ] • The event is a false positive. . 已知得病之下,檢驗出陽性反應,要反求檢驗出陽性反應 下,得病的機率為多少? 令Z表事件“檢驗結果是感染”,I表事件“某民眾真的得病”
Example 2-10 (continued) 令Z表事件“檢驗結果是感染”,I表事件“某民眾真的得病”
Example 2-10 (Tree Diagram) Prior Probabilities Conditional Probabilities Joint Probabilities 先驗機率 令Z表事件“檢驗結果是感染”,I表事件“某民眾真的得病”
Bayes’ Theorem Extended貝氏定理延伸(p.109) • Given a partition分割 of events B1,B2 ,...,Bn: Applying the law of total probability to the denominator Applying the definition of conditional probability throughout
Bayes’ Theorem Extended -Example 2-11 • An economist believes that during periods of high economic growth, the U.S. dollar appreciates增值with probability 0.70; in periods of moderate economic growth, the dollar appreciateswith probability 0.40; and during periods of low economic growth, the dollar appreciates with probability 0.20. • During any period of time, the probability of high economic growth is 0.30, the probability of moderate economic growth is 0.50, and the probability of low economic growth is 0.20. • Suppose the dollar has been appreciating during the present period. What is the probability we are experiencing a period of high economic growth? Partition: H - High growth P(H) = 0.30 M - Moderate growth P(M) = 0.50 L - Low growth P(L) = 0.20
Example 2-11 (Tree Diagram) Prior Probabilities Conditional Probabilities Joint Probabilities
2-8 Using Computer: Template for Calculating the Probability of at least one success Exercise, p.113, 15min Exercise 2-31 (Ans. 0.86) Exercise 2-32 (Ans. 0.78) Exercise 2-33 (Ans. 0.37) Exercise 2-34 (Ans. 0.2857) Exercise 2-35 (Ans. 0.8824)