令B为非零概率的事件。给定B的任何事件A的条件概率定义为:
换句话说,P(A | B)是观察事件B发生后事件A的概率度量。当且仅当P(A∩B)= P(A)P(B)(或等效地,P(A | B)= P(A))。因此,独立性等同于说观察B对A的概率没有任何影响。
例子
示例1: Sapan参加了两场比赛。她通过两场比赛的机率是0.4她通过第一场比赛的机率是0.6。考虑到她已经通过了第一场比赛,她通过第二场比赛的机率是多少?
Solution:
Let’s say 1st game be first and 2nd game be second.
P(first ∩ second) = 0.4
P(first) = 0.6
Formula:
Here question is which is right way to write it P(first/second) or P(second/first).
we have given the probability of passing the first test as the definition of conditional probability say The probability of an event occurring given that another event has already occurred is called a conditional probability. Hence, Putting the probabilities into the formula.
= 0.66
示例2:在100个跑车购买者的组中,有40个购买了警报系统,30个购买了桶形座椅,还有20个购买了警报系统和桶形座椅。如果随机选择的购车者购买了警报系统,那么他们还购买了桶形座椅的可能性是多少?
Solution:
Let’s say event of buying alarm system as alarm and event of buying bucket seats as bucket.
P(alarm) = 40 / 100 = 0.4
P(alarm ∩ bucket) = 0.2
Applying formula: P(A|B) = P(A∩B) / P(B)
Here we have the probability of alarm systems. and have to find out the probability of bucket seats. Hence, Putting the probabilities into the formula.
= 0.5
示例3:篮子中有2件红色衬衫,4件蓝色衬衫和9件白色衬衫。随机选择两件衬衫。考虑到第一件衬衫是蓝色,找到第二件衬衫是红色的概率。 (假设未更换第一块芯片)。
Solution:
Let A be the event blue shirt is selected and not replaced and B be the event second shirt is red.
P(A) = 4 / 15 = 0.26
So blue shirt is already taken and not replaced We left with 14 shirts.
P(A∩B) = 2 / 14 = 0.14
Applying formula:
P(B|A) = P(A∩B) / P(A) = 0.14 / 0.26 = 0.53
示例4:将硬币翻转两次。设A为两个翻转都落在头上的事件,设B为至少一个翻转落在头上的事件。
Solution:
Sample space of an experiment or random trial is the set of all possible outcomes or results of that experiment. Here ‘S’ denotes the sample space.
S = {(H, H), (H, T), (T, H), (T, T)}
P(A∩B) = 1 / 4 = 0.25
P(B) = 3 / 4 = 0.75
Applying formula:
= 0.33
使用双向表的条件概率
在一所大学进行了一项调查,询问了人们想看什么。此双向表显示了对调查做出回应的学生样本的数据:
Series |
Boys |
Girls |
Total |
---|---|---|---|
Harry Potter | 50 | 25 | 75 |
The Jungle Book | 10 | 15 | 25 |
Total | 60 | 40 | 100 |
问题:考虑到学生投票支持哈利·波特,找到学生是女孩的可能性。
解决方案:
这个问题可以分为两个部分:
1.找出学生选择哈利波特作为他们想要观看的系列的可能性吗?
= 0.7
2.找出学生是女学生并投票给哈利·波特的概率
= 0.25
应用条件概率公式:
P(girl | harry potter) = = 0.25
树形图和条件概率
公司需要检查灯泡是否熔断,并在检测到灯泡熔断时触发警报。假设有5%的电视机装有保险丝灯泡。如果一组灯泡包含保险丝灯泡,则有98%的机会触发警报。如果设备中不包含保险丝灯泡,则有8%的机会触发警报。采取一组随机选择的灯泡,灯泡中包含禁止物品的几率是多少?随机选择包含融合灯泡的集合的概率:
随机选择的行李中没有禁止物品的概率是多少?
P(not fused) = 1 − P(fused) = 1 − 0.05 = 0.95
If a set contains a fused bulb,there is 98% of chance being detected. If a bag doesn’t contain a fused item, there is 8% chance that it triggers the alarm.
给定一个集合包含一个融合项,它不触发警报的可能性是多少?
P(contains the fused bulb not trigger the alarm) = 1 − 0.98 = 0.02
假设一个集合不包含融合项,那么它不触发警报的可能性是多少?
P(does not contain fused and don’t trigger) = 1 − 0.08 = 0.92
完整的树形图:
有条件的问题:给定一个随机选择的集合会触发警报,那么它包含融合灯泡的概率是多少?
P(fused ∣ triggers the alarm) = P(F∩A) / P(A)
我们在树形图中发现了这种可能性。由于5%的袋子中包含融合物品,而其中98%的袋子触发了警报,因此我们可以将这些概率相乘:
P(F∩A) = (0.05) ∗ (0.98) = 0.049
查找随机选择的集合触发警报的概率。在两种情况下,集合可以触发警报,因此我们将这两个概率加在一起:
P(A) = P(F∩A) + P(N∩A) = 0.049 + 0.076 = 0.125
最后结果:
P(F∣A) = P(F∩A) / P(A) = 0.049 / (0.049 + 0.076) = 0.049 / 0.125 = 0.392
分析事件概率的独立性
汤姆(Tom’s)有1件蓝色衬衫,1件绿色衬衫,1件蓝色帽子,1条绿色围巾。一条蓝色的裤子。和1条绿色的裤子,汤姆(Tom)随机选择其中一件服装。假设A为选择一件蓝色衣服的事件,B为选择一件衬衫的事件。
P(A) = 3 / 6 = 1 / 2
P(B) = 2 / 6 = 1 / 3
P(A/B) = 1 / 2
P(B/A) = 1 / 3
P(A∩B) = 1 / 6
确认:
- P(B / A)= P(B)* P(A)
1/6 = 1/6
- P(B / A)= P(B)
1/3 = 1/3
P(A/B) = P(A) It is the probability of choosing a blue garment given that he chooses a shirt is equal to the probability that tom selects a blue garment.
P(B/A) = P(B), the probability that tom selects a shirt given that he has chosen a blue garment is equal to the probability that tom selects a shirt.
Remember the formula of the independent above i.e.
P(A∩B) = P(A) ∗ P(B)
P(A/B) = P(A)