這是用戶在 2024-7-28 24:20 為 https://app.immersivetranslate.com/pdf-pro/b1f5ba8c-cedd-4dc4-881a-884dbd114d72 保存的雙語快照頁面,由 沉浸式翻譯 提供雙語支持。了解如何保存?
2024_07_28_6488eba88e98ae316eb7g

CSE392/CSE39284 L3-Probability
CSE392/CSE39284 L3-機率

Dr Tony Sze Tony Sze 博士

Lecture 3 to lecture 12
第3 講至第12 講

Objective 目標

  • Introduce the basic statistical and data analysis techniques that can be used to address problems in environmental and safety studies
    介紹可用於解決環境和安全研究問題的基本統計和資料分析技術
  • A series of 10 lectures will covers the data analysis process from data collection, analysis, to reaching of conclusion and presentation of the findings.
    10 個系列講座將涵蓋從資料收集、分析到得出結論和展示結果的資料分析過程。

Lecture 3 to lecture 12
第3 講至第12 講

  • Lecture 3 - Fundamental Probability
    第3 講- 基本機率
  • Lecture 4 - Distributions & Descriptive Statistics
    第4 講- 分佈與描述統計
■ Lecture 5 - Central Limit Theorem
第5 講- 中心極限定理
  • Lecture 6 - Hypothesis Testing
    第6 講- 假設檢驗
  • Lecture 7 - Inferential Statistics for Means
    第7 講- 平均值推論統計
  • Lecture 8 - One-way ANOVA
    第8 講- 單因子變異數分析
■ Lecture 9 - Two-way ANOVA
第9 講- 雙向變異數分析
  • Lecture 10 - Correlation & Regression
    第10 講- 相關與迴歸
  • Lecture 11 - Chi-square tests
    第11 講- Chi-square 檢驗
  • Lecture 12 - Non-parametric tests
    第12 講- 非參數檢驗

Probability & Chance 機率與機會

  • Probability is the chance (likelihood) that an event will occur. It is a number between 0 and 1.
    機率是指某一事件發生的幾率(可能性)。它是一個介於0 和1 之間的數字。
  • An event is an occurrence of any type, designated by A, B, C etc.
    事件是指以A、B、C 等表示的任何類型的發生。
  • Possibility determines whether an event can occur or not.
    可能性決定了事件是否可能發生。
  • If the likelihood of an event is remote, then the study is considered to be significant.
    如果發生事件的可能性很小,則認為研究意義重大。
  • P used as shorthand for probability. probability of event A to occur.
    P 用作機率的簡稱。 事件A 發生的機率。

Probability 機率

Complementary Event 補充活動
  • Probability for A to occur.
    A發生的機率。
  • Probability for not-A to occur
    非A 出現的機率
  • All cases of A + all cases of not-A = total cases.
    所有A 病例+ 所有非A 病例= 病例總數。

Probability of Simple Event
簡單事件的機率

Simple Event Formula 簡單事件公式
  • Number of occurring case Total number of possible events
    發生案例數可能事件總數
  • Example: What is the probability of getting 1 or 2 or 3 when we throw a dice?
    舉例說明:當我們擲骰子時,得到1、2 或3 的機率是多少?
  • Possible outcomes are: 1, 2, 3, 4, 5, 6
    可能的結果是1, 2, 3, 4, 5, 6
  • Number of possible outcomes is 6
    可能的結果數為 6
  • If the dice is fair,
    如果骰子是公平的,

Probability of Joint event
聯合事件的機率

Probability of A and B Occurring at the Same Time
A 和B 同時發生的機率
  • and B
    和B
  • Example: What is the probability of getting when we throw a dice twice?
    舉例說明:當我們擲兩次骰子時,得到 的機率是多少?
  • Number of possible outcome is 6 x
    可能的結果數為6 x
  • If the dice is fair,
    如果骰子是公平的,
  • Alternately, , and ,
    或者,
  • and 2
    和2
Such formula is for "Independent" events, it is more appropriate to say
這種公式是針對"獨立"事件的,更恰當的說法是
  • "Intersection of Set A and Set B "
    "集合A 和集合B 的交集"

Outcome of Throwing a Dice
擲骰子的結果

Twice 兩次

Probability of Joint event
聯合事件的機率

Why Multiplication? 為什麼是乘法?
  • You can see from the outcome table when we throw a dice once, there are 6 possible outcome.
    從結果表中可以看出,當我們擲骰子一次時,有6 種可能的結果。
  • When we throw it twice, total possible outcome becomes .
    當我們丟兩次時,總的可能結果就會變成
  • First throw gives an even number and the second throw gives an odd. Counting the case are:
    第一次擲出的是偶數,第二次擲出的是奇數。算出的情況是
  • , actually it is also
    ,實際上也是
  • even (odd)
    偶數 (奇數)

Safety Example 安全實例

  • There are two identical power generators.
    有兩台相同的發電機。
  • Chance of failure of one generator is .
    一台發電機發生故障的幾率為
  • During a storm when electricity was cut off, what is the chance that both generators does not work?
    在暴風雨停電期間,兩台發電機都不工作的可能性有多大?
  • and B .
    和B
  • How about three generators?
    三台發電機怎麼樣?
  • and B and C and B
    和B 和C 和B

Compound Event 複合事件

  • Occurrence of multiple events in a situation.
    在一種情況下發生多個事件。
  • Instead of determining the failure due to all events occurring at the same time, we may wish to determine the occurrence of one or events at a time.
    與確定所有事件同時發生導致的故障相比,我們可能希望確定一次發生一個或多個事件。
  • The overall probability of a compound event is obtained by summing the individual event probabilities together.
    將單一事件的機率相加,就得到了複合事件的總機率。
  • Restrain: Probability cannot exceed 1.
    限制:機率不能超過1。

Probability of Compound Event
複合事件的機率

  • Probability of A or B occurring at the same time:
    A 或B 同時發生的機率:
  • or B Number of A cases +B cases - Overlap
    或B A 病例數+B 病例數- 重疊
Total number of possible events
可能發生的事件總數
  • or B and B
    或B 和B
  • Example: What is the probability of getting either 1 or 2 when we throw a dice?
    舉例說明:擲骰子時,得到1 或2 的機率是多少?
■ Number of possible outcome is 2, total outcome
可能的結果數為2,總結果為
or B
或B
■ or , and ,
■或 ,以及
  • or 2   或2
  • and B "Union of A and B "
    和B "A 和B 的聯合 "

Safety Example 安全實例

  • A worker is working on the roof. His chance of slip and fell is 0.05 . The chance of roof collapse is 0.01 .
    一名工人正在屋頂工作。他滑倒的幾率是0.05 。屋頂坍塌的幾率是0.01 。
  • What is the probability that he has an accident?
    他發生事故的機率是多少?
  • Any one of the event will lead to an accident.
    任何一個事件都會導致事故。
  • or B   或B
  • When he work 100 times on the roof, accident will happen 6 times. When 100 workers work on the same roof, 6 will have accidents.
    當他在屋頂上工作100 次時,會發生6 起事故。當100 名工人在同一個屋頂上工作時,將有6 人發生事故。

Exclusive Events 獨家活動

  • In the previous example, to be precise, I should have estimate the chance that he slip and fell and roof collapse at the same time.
    在上一個例子中,確切地說,我應該估計他滑倒和屋頂坍塌同時發生的幾率。
  • or B and B
    或B 和B
  • I assume that and B
    我假設 和B
  • This situation is called exclusive event.
    這種情況稱為獨家事件。
  • When and B , the 2 events are not exclusive.
    和B 時,這兩個事件並不排斥。

Exclusive Example 獨家範例

  • Find the probability of selecting a red card or a king from a deck of card.
    求從一副撲克牌中選出紅牌或國王的機率。
■ One deck has 52 cards.
一副牌有52 張牌。
  • One deck has 4 kings.
    一個甲板上有4 個國王。
  • One deck has 26 red cards.
    一副牌有26 張紅牌。
  • Then kings red
    那麼 國王 紅色
  • Then or B
    或B
  • But when we count the possible outcome, P is wrong.
    但當我們計算可能的結果時,P 是錯的。
  • This is because there are two kings that are red.
    這是因為有兩個國王是紅色的。
  • Actually, possible outcome is only 28.
    實際上,可能的結果只有28 個。
  • or B gives the correct answer.
    或B 給出正確答案。

Conditional Probability 條件機率

  • Some restriction or condition is placed upon the sample.
    對樣本施加某種限製或條件。
  • The total size is reduced in some way.
    總體積以某種方式縮小。
  • is read as "Given that B has occur, what is the probability of A occur?"
    讀作"已知B 已發生,那麼A 發生的機率是多少?

Conditional Prob Example 條件機率範例

  • When we throw 2 dice, what is the probability that the sum when at least one of the dice is 1 ?
    當我們擲2 個骰子時,當至少有一個骰子是1 時,和 的機率是多少?
  • See that dice outcome table. All outcome with at least one 1 show up are highlighted in blue color.
    請看骰子結果表。所有至少出現一個1 的結果都以藍色標示。
  • There are altogether 11 cases that one 1 has shown up. Out of these 11 cases, only the 2 case and have sum greater than 6 .
    共有11 種情況出現了1。在這11 種情況中,只有 這兩種情況的總和大於6。
  • Thus by manual count: 因此,透過人工計數:
  • sum one or two 1 show up
    一個或兩個1 出現

Conditional Prob Example 條件機率範例

  • By formula: 以公式計算
  • The case of sum > 6 and one 1 shows up are not independent event, therefore we cannot use the formular of and B
    總和大於6 和出現一個1 的情況並非獨立事件,因此我們不能使用 和B 的公式。
  • sum shows up
    顯示
  • shows up
    顯示
  • sum shows up
    顯示
  • which is identical to the manual count result.
    與手動計數結果相同。

Outcome of throwing a dice
擲骰子的結果

twice 兩倍

Exercise 運動

  • If a box contains 10 left-handed and 20 right-handed screws, what is the prob. of obtaining at least one right-handed in drawing 2 screws with replacement? (8/9)
    如果一個盒子裡有10 個左旋螺絲和20 個右旋螺絲,那麼在抽取2 個螺絲的過程中, 至少抽到一個右旋螺絲的機率是多少? (8/9)
  • Under what conditions will it make practically no difference whether we sample with or without replacement? (large N )
    在什麼條件下,使用或不使用替換法進行抽樣幾乎沒有差異? (大N)
  • If we inspect envelops by drawing 4 of them without replacement from every lot of 100 , what is the prob of getting 4 clean envelops although 3% of them contain spots? (88.36%)
    如果我們從每批100 個信封中抽取4 個信封進行檢查,而不進行替換,那麼雖然有3% 的信封含有斑點,但抽到4 個乾淨信封的機率是多少?
  • A pressure control apparatus contains 3 electronic tubes. The apparatus will not work unless all tubes are operative. If the prob. of failure of each tube during some interval of time is 0.04 , what is the corresponding prob. of failure of the apparatus.. (11.5%)
    一個壓力控制裝置包含3 個電子管。除非所有電子管都正常運作,否則儀器將無法運作。如果在某個時間間隔內每個電子管發生故障的機率為0.04,那麼儀器發生故障的相應機率是多少?

Permutation 排列

  • A permutation is an arrangement of elements in a row in some order.
    排列是將一行中的元素依一定順序排列。
  • Used to compute the number of all possible outcomes when counting become impossible.
    當計算變得不可能時,用於計算所有可能結果的數量。
  • E.g. arrange 4 letters in a row:
    例如,將4 個字母排成一行:

Permutation of 4 letters 4 個字母的排列組合

ABCD BACD CABD DABC
ABDC BADC CADB DADB
ACBD BCAD CBAD DBAC
ACDB BCDA CBDA DBCA
ADBC BDAC CDAB DCAB
ADCB BDCA CDBA DCBA

Permutation 排列

  • We can see that the number of outcome is 24 .
    我們可以看到,結果數為24。
  • We imagine there are 4 boxes.
    我們想像有4 個盒子。
  • When we fill the first box, there are 4 possible candidates, ABCD.
    當我們填寫第一個方格時,有4 個可能的候選方格,即ABCD。
  • After the box is filled, we are left with 3 letters to choose from. For the box, only 2 letters are left. For the last box, we have one 1 choice.
    填完 框框後,我們只剩下3 個字母可供選擇。在 框中,只剩下2 個字母。對於最後一個方框,我們只有1 個字母可供選擇。
  • total number of outcome
    結果總數

Permutation 排列

  • We denote by a symbol called
    我們用一個名為
  • 4 factorial !. 4 係數 !
  • Thus in general for N different letters, the permutation is N ! which is
    因此,一般情況下,對於N 個不同的字母,排列組合為N! ,即
  • Note that 0 !
    請注意,0 !
  • ! 

Order Combination 訂單組合

  • When we do not use all of the letter, it becomes a permutation of n things taken k at a time.
    當我們不使用所有字母時,它就變成了一次取k 的n 個事物的排列組合。
  • If no repetition is allowed, the first box has N choice, the second has choice and so on until we fill the k box, we stop.
    如果不允許重複,則第一個方框有N 個選項,第二個方框有 個選項,以此類推,直到填滿k 個方框,我們才停止。
  • the permutation is
    排列方式為
■ but  但是

Order Combination Example
訂單組合範例

  • When we arrange 2 letters out of ABCD,
    當我們從ABCD 排列出2 個字母時、
  • We can have 12 possible outcome.
    我們可以有12 種可能的結果。
  • When repetition is allowed:
    允許重複時:
  • the permutation is
    排列方式為
  • e.g. ABCD permutation, then AAAA is also a posibility.
    例如ABCD permutation,那麼AAAA 也是一種可能性。
  • 4 choices for box 1, then again 4 choices for box 2 .... thus total outcome is
    框1 有4 個選擇,然後框2 又有4 個選擇....,因此總結果為

Combination 組合

  • In a permutation, the order of the selected things is essential. In combination, the order is disregarded. ABC is considered the same as ACB, BCA, BAC, CBA, and CAB. The 6 cases are considered as one case only.
    在排列組合中,所選事物的順序至關重要。而在組合中,順序是可以忽略的。 ABC 與ACB、BCA、BAC、CBA 和CAB 相同。這6 種情況只視為一種情況。
  • The number of different combinations of different things, k at a time, without repetitions is:
    不同事物的不同組合的數量,一次為k,不重複:

Combination example 組合範例

  • The number of samples of five employees that can be selected from a lot of 500 is:
    從500 個樣本中可以抽取5 個僱員的樣本數是多少?
  • Possible outcome of Mark 6:
    馬可福音第6 章的可能結果:

Exercise 運動

  • How many different samples of 4 mice can be drawn from a lot of 50 mice?
    從一批50 隻小鼠中可以抽取多少個不同的4 隻小鼠樣本?
  • How many ways we can choose a committee of 3 from 8 persons? (56)
    從8 人中選出3 人委員會的方法有幾種? (56)
  • How many different license plates showing 6 symbols: namely 3 letters followed by 3 digits, could be made?
    可以製作多少種顯示6 個符號(即3 個字母和3 個數字)的不同車牌?
  • In a lot of 8 items, 2 are defective. Draw different samples of 3 items. Find the no. of samples containing no defect, 1 defect and 2 defects.
    在一批8 件商品中,有2 件是次品。抽取3 件不同的樣本。找出不含缺陷、含1 個缺陷和含2 個缺陷的樣本數。 .

Binomial Probabilities 二項式機率

  • In situations where there are only two possible outcomes for an event, such as a
    在一個事件只有兩種可能結果的情況下,如
  • "head/tail", or "yes/no", or "left/right", or "male/female", or "sick/healthy",
    "頭/尾",或"是/否",或"左/右",或"男/女",或"生病/健康"、
  • the distribution is considered to be binomial.
    則該分佈視為二項分佈。
  • the binomial coefficients are defined by the formula:
    的二項式係數由公式定義:

Binomial Probabilities 二項式機率

  • The formula of binomial probability is:
    二項式機率公式為

Binomial Probability Example
二項式機率範例

  • Make 4 babies. What is the probability 3 boys?
    製造4 個嬰兒。 3 個男孩的機率是多少?
  • By count: 4 out of 16 , thus
    按計數:16 人中有4 人,因此
BBBB BBBG BBGB BBGG
BGBB BGBG BGGB BGGG
GBBB GBBG GBGB GBGG
GGBB GGBG GGGB GGGG

Binomial Probability Example
二項式機率範例

  • By formula: 4!/3!/(4-3)!
    依公式計算: 4!/3!/(4-3)!
  • Explanation: 解釋:
  • Probability of a boy
    男孩 的機率
  • Probability of 3 boys
    3 個男孩的機率
  • Probability of girl
    女孩 的機率
  • Combination of 3 boys out of 4 is
    4 個男孩中3 個男孩的組合是
  • Note that because to get 3 boys out of four birth is the same as getting one girl out of 4 birth.
    請注意 ,因為四胎中生三個男孩和四胎中生一個女孩是一樣的。

Binomial Probability Example
二項式機率範例

  • Compute the prob. of getting at least 2 "six" in rolling a fair dice 4 times.
    計算擲4 次公平骰子至少得到2 個"6 "的機率。
  • Solution: not a 6
    解決方案: 不是6
  • Combinations of putting 2 six into 4 boxes is
    將2 個6 放入4 個盒子的組合是
  • six six

Poisson Probabilities 泊松機率

  • Very important to the safety professional. It is used to determine the probability of an event when the frequency of their occurrence is quite low when compare with the overall exposure. Many types of accident occurrences can be expected to follow a Poisson distribution.
    對安全專業人員非常重要。當事故發生的頻率與整體風險相比很低時,它就會被用來確定事故發生的機率。許多類型的事故發生都可能遵循泊松分佈。
  • N = exposure period, prob. of 1 mishap,
    N = 暴露期, 1 次事故的機率、
  • no of mishaps in question,
    沒有相關的事故、
  • M = expected no of mishaps during an exposure period.
    M = 暴露期間內預計發生的事故次數。

Example 範例

  • A system was found to have 3 failures after 25,000 hours of operation. SO modified the system to reduce failure. Run again for 55000 hours and there were 2 failures. What was the probability of this happening?
    發現一個系統在運作25000 小時後出現3 次故障。 SO 對系統進行了修改,以減少故障。再次運轉55,000 小時後,出現2 次故障。發生這種情況的機率是多少?
  • Originally, failure
    最初,失敗

Example 範例

  • If the probability of producing a defective screw is , what is the prob. that a lot of 100 screws will contain more than 2 defectives?
    如果生產次品螺絲的機率是 ,那麼一批100 個螺絲中含有2 個以上次品的機率是多少?
  • We used the complementary event method
    我們採用了補充事件法
  • we have 3 cases: 0 bad screw, 1 bad, and 2 bad.
    我們有3 個案例:0 個壞螺絲、1 個壞螺絲和2 個壞螺絲。
  • Using binomial probability:
    使用二項式機率
  • screws
    螺絲釘
  • , thus bad screws
    ,因此 壞螺絲

Example 範例

  • Poisson distribution is in fact a limiting case of binomial distribution: when and
    泊松分佈其實是二項分佈的極限情況:當
  • Redo the previous screws example using Poisson distribution approximation:
    使用泊松分佈近似值重做之前的螺絲範例:
  • since which is very small,
    因為 非常小、
  • bad screws
    壞螺絲
thus bad screws)
因此 壞螺絲)
  • which is quite close to using binomial
    這與使用二項式計算的 非常接近

Exercise 運動

  • If the probability of hitting a target is and 4 shots are fired independently, what is the probability of that the target will be hit at least once?
    如果擊中目標的機率是 ,並且獨立發射了4 發子彈,那麼目標至少被擊中一次的機率是多少?
  • The no of alpha particles emitted per second in a radioactive process is a random variable X having a Poisson distribution. If X has mean 0.5 , what is the probability of observing two or more particles during any given second?
    在一個放射性過程中,每秒發射的α粒子數量是一個具有泊松分佈的隨機變數X。如果X 的平均值為0.5,那麼在任何給定的一秒內觀察到兩個或更多粒子的機率是多少?
End of Lecture 3 第3 講結束
You have learnt elementary probability
您已經學習了基本機率
Next lecture we will discuss Elementary
下一講我們將討論初等教育
Statistics. 統計資料