東京大学 新領域創成科学研究科 メディカル情報生命専攻 2019年8月実施 問題11
Author
zephyr
Description
Machine A produces a sequence x=x1x2⋯xn with the following output probability {βk}.
Output probabilities: P(xs=k)=βk for k∈{a,c,g,t}, s=1,2,…,n.
Machine B produces a sequence x=x1x2⋯xn by a stationary first-order Markov model with the following initial probabilities {πk} and transition probabilities {λij}.
Initial Probabilities: P(x1=k)=πk for k∈{a,c,g,t}.
Transition Probabilities: P(xs=j∣xs−1=i)=λij for i,j∈{a,c,g,t}, s=2,…,n.
Machine C converts each occurrence of ac in an input sequence independently to gt with probability ϵ.
Assume that P(X) is the probability that X is true, and that P(X∣Y) is the conditional probability that X is true when Y is true. Assume also that PA(x) is the probability that Machine A outputs a sequence x, and PB(x) is the probability that Machine B outputs a sequence x.
Solve the following problems. For (2) to (4), you can use PA(x) and PB(x) by substituting x with any concrete sequence (PA(actgt), for example) as they are.
(1) When n=5, show the four probabilities, PA(actgt), PA(actac), PB(actgt), PB(actac).
(2) When n=5, three sequences from Machine A and two sequences from Machine B were produced. When a sequence is selected randomly from those five sequences, it was actgt. Show the probability that this sequence was one of the three sequences produced from Machine A.
(3) When n=5, show the probability that the output sequence of Machine C is actgt when the input of Machine C was an output of Machine A.
(4) Five sequences were produced in the same manner as (2), and two sequences were randomly selected from the five sequences. When one of the selected two sequences was used as the input of Machine C, both the output sequence of Machine C and the remaining sequence were actgt. Show the probability that those two sequences were originally produced from the same machine (Machine A or Machine B).
机器 A 产生一个序列 x=x1x2⋯xn,其输出概率为 {βk}。
输出概率:P(xs=k)=βk,其中 k∈{a,c,g,t},s=1,2,…,n。
机器 B 通过一个固定的一阶马尔可夫模型产生一个序列 x=x1x2⋯xn,其初始概率 {πk} 和转移概率 {λij} 如下。
初始概率:P(x1=k)=πk,其中 k∈{a,c,g,t}。
转移概率:P(xs=j∣xs−1=i)=λij,其中 i,j∈{a,c,g,t},s=2,…,n。
机器 C 将输入序列中的每次出现的 ac 独立地以概率 ϵ 转换为 gt。
假设 P(X) 是 X 为真的概率,P(X∣Y) 是 Y 为真时 X 为真的条件概率。同样假设 PA(x) 是机器 A 输出序列 x 的概率,PB(x) 是机器 B 输出序列 x 的概率。
解决以下问题。从 (2) 到 (4),你可以直接使用 PA(x) 和 PB(x),用任何具体序列(例如 PA(actgt))代替 x。
(1) 当 n=5 时,展示四个概率 PA(actgt),PA(actac),PB(actgt),PB(actac)。
(2) 当 n=5 时,机器 A 产生三个序列,机器 B 产生两个序列。当从这五个序列中随机选择一个序列时,它是 actgt。展示该序列是从机器 A 产生的三个序列之一的概率。
(3) 当 n=5 时,展示当机器 C 的输入是机器 A 的输出时,机器 C 的输出序列是 actgt 的概率。
(4) 按照 (2) 的方式产生五个序列,随机从这五个序列中选择两个序列。当选定的两个序列之一被用作机器 C 的输入时,机器 C 的输出序列和剩余的序列都是 actgt。展示这两个序列最初是由同一台机器(机器 A 或机器 B)产生的概率。
题目描述
机器 A 独立产生长度为 n 的字符序列 x=x1⋯xn,对 k∈{a,c,g,t} 与每个位置 s,
P(xs=k)=βk.
机器 B 依一阶平稳 Markov 模型产生序列,满足
P(x1=k)=πk,
P(xs=j∣xs−1=i)=λij(i,j∈{a,c,g,t}, s=2,…,n).
机器 C 对输入中每一次出现的连续模式 ac,相互独立地以概率 ϵ 将其替换为 gt。记 PA(x),PB(x) 分别为 A、B 输出具体序列 x 的概率;第 2 至第 4 问允许直接保留这类记号。回答:
- 当 n=5 时,分别写出
PA(actgt),PA(actac),PB(actgt),PB(actac).
- A 产生 3 条、B 产生 2 条长度为 5 的序列。从五条中均匀随机选一条,已知其为
actgt,求它来自 A 所产生三条序列之一的条件概率。
- 已知 C 的输入是 A 的一条长度 5 输出,求 C 最终输出
actgt 的概率;需计入输入本来就是目标串以及可由 ac 转换得到目标串的情形。
- 仍由 A 产生 3 条、B 产生 2 条,并从五条中随机选两条;随机取其中一条送入 C。已知 C 的输出和未送入 C 的另一条均为
actgt,求这两条原本同由 A 或同由 B 产生的条件概率。
- 序列源的似然:分别按独立字符概率连乘和初始概率乘 Markov 转移概率,计算具体序列在两个模型下的概率。
- 贝叶斯模型选择:把机器的先验抽样比例与观测序列的模型似然结合,求来源机器的后验概率。
- 含随机替换通道的条件概率:枚举经机器 C 可产生指定输出的输入与转换事件,并在两条无放回抽样的来源组合上应用全概率公式。
Kai
(1)
For Machine A:
PA(x)=s=1∏nβxs
For sequence actgt:
PA(actgt)=βaβcβtβgβt
For sequence actac:
PA(actac)=βaβcβtβaβc
For Machine B:
PB(x)=πx1s=2∏nλxs−1,xs
For sequence actgt:
PB(actgt)=πaλa,cλc,tλt,gλg,t
For sequence actac:
PB(actac)=πaλa,cλc,tλt,aλa,c
(2)
Given three sequences from Machine A and two sequences from Machine B, the total number of sequences is five. Let the probability that a sequence is selected randomly from Machine A be denoted by P(MA)=53, and the probability that a sequence is selected from Machine B be P(MB)=52.
Using Bayes' Theorem, the probability that the sequence was produced by Machine A given that the sequence was actgt is:
P(MA∣actgt)=P(actgt)P(actgt∣MA)⋅P(MA)
Where:
P(actgt)=P(actgt∣MA)⋅P(MA)+P(actgt∣MB)⋅P(MB)
P(actgt)=PA(actgt)⋅53+PB(actgt)⋅52
So:
P(MA∣actgt)=PA(actgt)⋅53+PB(actgt)⋅52PA(actgt)⋅53
(3)
Let's correctly calculate the probability by considering both scenarios where the input sequence is actgt or actac.
If the input sequence is actgt, there is no ac to convert. Hence, the probability that the sequence remains unchanged (no conversion needed) is 1−ϵ.
PC(actgt∣actgt from A)=1−ϵ
If the input sequence is actac, Machine C converts each occurrence of ac independently to gt with probability ϵ.
- Probability of converting
actac to actgt: ϵ
Now, we need to calculate the total probability that the output sequence of Machine C is actgt when the input is an output of Machine A. This involves considering both cases and their probabilities:
- Probability of Machine A producing
actgt:
PA(actgt)=βaβcβtβgβt
Then the first ac should not be converted.
- Probability of Machine A producing
actac:
PA(actac)=βaβcβtβaβc
Then the first ac should not be converted, but the next ac should be converted.
The total probability is given by:
PC(actgt∣input from A)=PA(actgt)⋅(1−ϵ)+PA(actac)⋅(1−ϵ)ϵ
Therefore, the probability that the output sequence of Machine C is actgt when the input of Machine C was an output of Machine A is:
PC(actgt∣input from A)=βaβcβtβgβt(1−ϵ)+(1−ϵ)ϵβaβcβtβaβc
(4)
Given:
- Five sequences were produced: three from Machine A and two from Machine B.
- Two sequences were randomly selected from these five.
- One selected sequence was input to Machine C, resulting in
actgt.
- The other selected sequence is also
actgt.
We need to find the probability that both sequences were originally produced by the same machine (either both from A or both from B).
Let's approach this step-by-step:
- First, let's define our events:
- Let E be the event that both sequences are
actgt after one goes through Machine C.
- Let S be the event that both sequences were from the same machine.
- We need to calculate P(S∣E) using Bayes' theorem:
P(S∣E)=P(E)P(E∣S)P(S)
- Let's calculate each component:
a) P(S): The probability that both selected sequences are from the same machine.
- Probability of both from A: (25)(23)=103
- Probability of both from B: (25)(22)=101
- P(S)=103+101=104=52
b) P(E∣S): The probability of getting two
actgt sequences given they're from the same machine.
If both from A:
P(E∣SA)=PA(actgt)⋅[PA(actgt)(1−ϵ)+PA(actac)(1−ϵ)ϵ]
If both from B:
P(E∣SB)=PB(actgt)⋅[PB(actgt)(1−ϵ)+PB(actac)(1−ϵ)ϵ]
So,
P(E∣S)=53⋅P(E∣SA)+51⋅P(E∣SB)
c) P(E): The overall probability of the observed event.
P(E)=P(E∣S)⋅P(S)+P(E∣¬S)⋅P(¬S)
where P(E∣¬S) is the probability of getting two actgt sequences given they're from different machines:
P(E∣¬S)=[PA(actgt)⋅PB(actgt)(1−ϵ)+PA(actgt)⋅PB(actac)(1−ϵ)ϵ+PB(actgt)⋅PA(actgt)(1−ϵ)+PB(actgt)⋅PA(actac)⋅(1−ϵ)ϵ]
And,
P(E∣¬S)=P(E∣S)⋅(1−P(S))
- Putting it all together:
P(S∣E)=P(E)P(E∣S)⋅P(S)
Where:
P(E∣SA)=PA(actgt)⋅[PA(actgt)(1−ϵ)+PA(actac)(1−ϵ)ϵ]
P(E∣SB)=PB(actgt)⋅[PB(actgt)(1−ϵ)+PB(actac)(1−ϵ)ϵ]
P(E)=[P(E∣SA)⋅53+P(E∣SB)⋅51]+P(E∣¬S)⋅53
This completes the solution for each problem.
Knowledge
概率论 马尔可夫链 贝叶斯定理 转移概率
- 概率论 (Probability Theory): 研究随机现象规律的数学学科。
- 马尔可夫模型 (Markov Model): 具有马尔可夫性质(即未来状态仅与当前状态有关,与过去状态无关)的随机过程模型。
- 贝叶斯定理 (Bayes' Theorem): 用于计算后验概率的公式,通过已知的先验概率和似然函数来更新概率。
- 转移概率 (Transition Probability): 从一个状态转移到另一个状态的概率。
难点思路
在解答这类题目时,主要难点在于理解和应用马尔可夫模型的概率计算,以及如何运用贝叶斯定理进行概率的更新。对于每一个具体问题,我们可以按照以下步骤进行解答:
- 计算基础概率:根据给定模型参数计算序列在不同机器下的生成概率。
- 应用贝叶斯定理:通过已知信息更新概率,计算后验概率。
- 考虑转换:对于涉及序列转换的情况,计算转换前后的概率,并结合条件概率公式进行综合计算。
解题技巧和信息
-
贝叶斯定理应用技巧:
- 条件概率的分解:将复杂的概率计算分解为条件概率的乘积。
- 归一化:确保计算的概率值归一化,使得总和为 1。
-
马尔可夫模型技巧:
- 初始概率与转移概率:明确初始状态的概率分布和状态之间的转移概率矩阵。
- 序列概率计算:利用转移概率逐步计算整个序列的生成概率。
-
综合概率计算:
- 将多种概率结果进行加权平均,以得到综合概率。
重点词汇
- Probability Theory 概率论
- Markov Model 马尔可夫模型
- Bayes' Theorem 贝叶斯定理
- Transition Probability 转移概率
- Posterior Probability 后验概率
参考资料
- Probability and Statistics for Engineering and the Sciences by Jay L. Devore, Chap. 5 (Discrete Random Variables and Probability Distributions)
- Introduction to Probability Models by Sheldon M. Ross, Chap. 4 (Markov Chains)
- Pattern Recognition and Machine Learning by Christopher M. Bishop, Chap. 13 (Hidden Markov Models)