跳到主要内容

東京大学 新領域創成科学研究科 メディカル情報生命専攻 2019年8月実施 問題11

Author

zephyr, 祭音Myyura

Description

Machine A produces a sequence x=x1x2xnx = x_1 x_2 \cdots x_n with the following output probability {βk}\{\beta_k\}.

Output probabilities: P(xs=k)=βkP(x_s = k) = \beta_k for k{a,c,g,t}k \in \{a, c, g, t\}, s=1,2,,ns = 1, 2, \ldots, n.

Machine B produces a sequence x=x1x2xnx = x_1 x_2 \cdots x_n by a stationary first-order Markov model with the following initial probabilities {πk}\{\pi_k\} and transition probabilities {λij}\{\lambda_{ij}\}.

Initial Probabilities: P(x1=k)=πkP(x_1 = k) = \pi_k for k{a,c,g,t}k \in \{a, c, g, t\}.

Transition Probabilities: P(xs=jxs1=i)=λijP(x_s = j \mid x_{s-1} = i) = \lambda_{ij} for i,j{a,c,g,t}i, j \in \{a, c, g, t\}, s=2,,ns = 2, \ldots, n.

Machine C converts each occurrence of ac in an input sequence independently to gt with probability ϵ\epsilon.

Assume that P(X)P(X) is the probability that XX is true, and that P(XY)P(X \mid Y) is the conditional probability that XX is true when YY is true. Assume also that PA(x)P_A(x) is the probability that Machine A outputs a sequence xx, and PB(x)P_B(x) is the probability that Machine B outputs a sequence xx.

Solve the following problems. For (2) to (4), you can use PA(x)P_A(x) and PB(x)P_B(x) by substituting xx with any concrete sequence (PA(actgt)P_A(\text{actgt}), for example) as they are.

(1) When n=5n = 5, show the four probabilities, PA(actgt)P_A(\text{actgt}), PA(actac)P_A(\text{actac}), PB(actgt)P_B(\text{actgt}), PB(actac)P_B(\text{actac}).

(2) When n=5n = 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=5n = 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=x1x2xnx = x_1 x_2 \cdots x_n,其输出概率为 {βk}\{\beta_k\}

输出概率:P(xs=k)=βkP(x_s = k) = \beta_k,其中 k{a,c,g,t}k \in \{a, c, g, t\}s=1,2,,ns = 1, 2, \ldots, n

机器 B 通过一个固定的一阶马尔可夫模型产生一个序列 x=x1x2xnx = x_1 x_2 \cdots x_n,其初始概率 {πk}\{\pi_k\} 和转移概率 {λij}\{\lambda_{ij}\} 如下。

初始概率:P(x1=k)=πkP(x_1 = k) = \pi_k,其中 k{a,c,g,t}k \in \{a, c, g, t\}

转移概率:P(xs=jxs1=i)=λijP(x_s = j \mid x_{s-1} = i) = \lambda_{ij},其中 i,j{a,c,g,t}i, j \in \{a, c, g, t\}s=2,,ns = 2, \ldots, n

机器 C 将输入序列中的每次出现的 ac 独立地以概率 ϵ\epsilon 转换为 gt

假设 P(X)P(X)XX 为真的概率,P(XY)P(X \mid Y)YY 为真时 XX 为真的条件概率。同样假设 PA(x)P_A(x) 是机器 A 输出序列 xx 的概率,PB(x)P_B(x) 是机器 B 输出序列 xx 的概率。

解决以下问题。从 (2) 到 (4),你可以直接使用 PA(x)P_A(x)PB(x)P_B(x),用任何具体序列(例如 PA(actgt)P_A(\text{actgt}))代替 xx

(1) 当 n=5n = 5 时,展示四个概率 PA(actgt)P_A(\text{actgt})PA(actac)P_A(\text{actac})PB(actgt)P_B(\text{actgt})PB(actac)P_B(\text{actac})

(2) 当 n=5n = 5 时,机器 A 产生三个序列,机器 B 产生两个序列。当从这五个序列中随机选择一个序列时,它是 actgt。展示该序列是从机器 A 产生的三个序列之一的概率。

(3) 当 n=5n = 5 时,展示当机器 C 的输入是机器 A 的输出时,机器 C 的输出序列是 actgt 的概率。

(4) 按照 (2) 的方式产生五个序列,随机从这五个序列中选择两个序列。当选定的两个序列之一被用作机器 C 的输入时,机器 C 的输出序列和剩余的序列都是 actgt。展示这两个序列最初是由同一台机器(机器 A 或机器 B)产生的概率。

题目描述

机器 A 独立产生长度为 nn 的字符序列 x=x1xnx=x_1\cdots x_n,对 k{a,c,g,t}k\in\{a,c,g,t\} 与每个位置 ss

P(xs=k)=βk.P(x_s=k)=\beta_k.

机器 B 依一阶平稳 Markov 模型产生序列,满足

P(x1=k)=πk,P(x_1=k)=\pi_k,
P(xs=jxs1=i)=λij(i,j{a,c,g,t}, s=2,,n).P(x_s=j\mid x_{s-1}=i)=\lambda_{ij} \quad(i,j\in\{a,c,g,t\},\ s=2,\ldots,n).

机器 C 对输入中每一次出现的连续模式 ac,相互独立地以概率 ϵ\epsilon 将其替换为 gt。记 PA(x),PB(x)P_A(x),P_B(x) 分别为 A、B 输出具体序列 xx 的概率;第 2 至第 4 问允许直接保留这类记号。回答:

  1. n=5n=5 时,分别写出

    PA(actgt),PA(actac),PB(actgt),PB(actac).P_A(\mathrm{actgt}),\quad P_A(\mathrm{actac}),\quad P_B(\mathrm{actgt}),\quad P_B(\mathrm{actac}).
  2. A 产生 3 条、B 产生 2 条长度为 5 的序列。从五条中均匀随机选一条,已知其为 actgt,求它来自 A 所产生三条序列之一的条件概率。

  3. 已知 C 的输入是 A 的一条长度 5 输出,求 C 最终输出 actgt 的概率;需计入输入本来就是目标串以及可由 ac 转换得到目标串的情形。

  4. 仍由 A 产生 3 条、B 产生 2 条,并从五条中随机选两条;随机取其中一条送入 C。已知 C 的输出和未送入 C 的另一条均为 actgt,求这两条原本同由 A 或同由 B 产生的条件概率。

Kai

(1)

For Machine A:

PA(x)=s=1nβxsP_A(x) = \prod_{s=1}^n \beta_{x_s}

For sequence actgt:

PA(actgt)=βaβcβtβgβtP_A(\text{actgt}) = \beta_a \beta_c \beta_t \beta_g \beta_t

For sequence actac:

PA(actac)=βaβcβtβaβcP_A(\text{actac}) = \beta_a \beta_c \beta_t \beta_a \beta_c

For Machine B:

PB(x)=πx1s=2nλxs1,xsP_B(x) = \pi_{x_1} \prod_{s=2}^n \lambda_{x_{s-1}, x_s}

For sequence actgt:

PB(actgt)=πaλa,cλc,tλt,gλg,tP_B(\text{actgt}) = \pi_a \lambda_{a, c} \lambda_{c, t} \lambda_{t, g} \lambda_{g, t}

For sequence actac:

PB(actac)=πaλa,cλc,tλt,aλa,cP_B(\text{actac}) = \pi_a \lambda_{a, c} \lambda_{c, t} \lambda_{t, a} \lambda_{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)=35P(M_A) = \frac{3}{5}, and the probability that a sequence is selected from Machine B be P(MB)=25P(M_B) = \frac{2}{5}.

Using Bayes' Theorem, the probability that the sequence was produced by Machine A given that the sequence was actgt is:

P(MAactgt)=P(actgtMA)P(MA)P(actgt)P(M_A \mid \text{actgt}) = \frac{P(\text{actgt} \mid M_A) \cdot P(M_A)}{P(\text{actgt})}

Where:

P(actgt)=P(actgtMA)P(MA)+P(actgtMB)P(MB)P(\text{actgt}) = P(\text{actgt} \mid M_A) \cdot P(M_A) + P(\text{actgt} \mid M_B) \cdot P(M_B)
P(actgt)=PA(actgt)35+PB(actgt)25P(\text{actgt}) = P_A(\text{actgt}) \cdot \frac{3}{5} + P_B(\text{actgt}) \cdot \frac{2}{5}

So:

P(MAactgt)=PA(actgt)35PA(actgt)35+PB(actgt)25P(M_A \mid \text{actgt}) = \frac{P_A(\text{actgt}) \cdot \frac{3}{5}}{P_A(\text{actgt}) \cdot \frac{3}{5} + P_B(\text{actgt}) \cdot \frac{2}{5}}

(3)

Let's correctly calculate the probability by considering both scenarios where the input sequence is actgt or actac.

Case 1: Input Sequence is actgt

If the input sequence is actgt, its initial ac must not be converted. Hence, the probability that the sequence remains unchanged is 1ϵ1 - \epsilon.

PC(actgtactgt from A)=1ϵP_C(\text{actgt} \mid \text{actgt from A}) = 1 - \epsilon

Case 2: Input Sequence is actac

If the input sequence is actac, Machine C converts each occurrence of ac independently to gt with probability ϵ\epsilon.

  • Probability of converting actac to actgt: ϵ\epsilon

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:

  1. Probability of Machine A producing actgt:
PA(actgt)=βaβcβtβgβt P_A(\text{actgt}) = \beta_a \beta_c \beta_t \beta_g \beta_t

Then the first ac should not be converted.

  1. Probability of Machine A producing actac:
PA(actac)=βaβcβtβaβc P_A(\text{actac}) = \beta_a \beta_c \beta_t \beta_a \beta_c

Then the first ac should not be converted, but the next ac should be converted.

The total probability is given by:

PC(actgtinput from A)=PA(actgt)(1ϵ)+PA(actac)(1ϵ)ϵP_C(\text{actgt} \mid \text{input from A}) = P_A(\text{actgt}) \cdot (1 - \epsilon) + P_A(\text{actac}) \cdot (1 - \epsilon) \epsilon

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(actgtinput from A)=βaβcβtβgβt(1ϵ)+(1ϵ)ϵβaβcβtβaβcP_C(\text{actgt} \mid \text{input from A}) = \beta_a \beta_c \beta_t \beta_g \beta_t (1 - \epsilon) + (1 - \epsilon) \epsilon \beta_a \beta_c \beta_t \beta_a \beta_c

(4)

Let

pA=PA(actgt),pB=PB(actgt),p_A=P_A(\text{actgt}),\qquad p_B=P_B(\text{actgt}),

and, for M{A,B}M\in\{A,B\}, let

qM=(1ϵ)(PM(actgt)+ϵPM(actac))q_M=(1-\epsilon)\bigl(P_M(\text{actgt})+\epsilon P_M(\text{actac})\bigr)

be the probability that C outputs actgt from an input generated by MM.

Choosing two sequences and then choosing which one enters C is equivalent to choosing an ordered pair of distinct sequences. The source pairs AA,BB,AB,BAAA,BB,AB,BA therefore have probabilities 3/10,1/10,3/10,3/103/10,1/10,3/10,3/10, respectively. If EE is the observed event, their likelihoods are

qApA,qBpB,qApB,qBpA.q_Ap_A,\qquad q_Bp_B,\qquad q_Ap_B,\qquad q_Bp_A.

Hence, provided the denominator is positive,

P(same machineE)=3qApA+qBpB3qApA+qBpB+3qApB+3qBpA.P(\text{same machine}\mid E) =\frac{3q_Ap_A+q_Bp_B} {3q_Ap_A+q_Bp_B+3q_Ap_B+3q_Bp_A}.

Knowledge

概率论 马尔可夫链 贝叶斯定理 转移概率

  • 概率论 (Probability Theory): 研究随机现象规律的数学学科。
  • 马尔可夫模型 (Markov Model): 具有马尔可夫性质(即未来状态仅与当前状态有关,与过去状态无关)的随机过程模型。
  • 贝叶斯定理 (Bayes' Theorem): 用于计算后验概率的公式,通过已知的先验概率和似然函数来更新概率。
  • 转移概率 (Transition Probability): 从一个状态转移到另一个状态的概率。

难点思路

在解答这类题目时,主要难点在于理解和应用马尔可夫模型的概率计算,以及如何运用贝叶斯定理进行概率的更新。对于每一个具体问题,我们可以按照以下步骤进行解答:

  1. 计算基础概率:根据给定模型参数计算序列在不同机器下的生成概率。
  2. 应用贝叶斯定理:通过已知信息更新概率,计算后验概率。
  3. 考虑转换:对于涉及序列转换的情况,计算转换前后的概率,并结合条件概率公式进行综合计算。

解题技巧和信息

  • 贝叶斯定理应用技巧:

    1. 条件概率的分解:将复杂的概率计算分解为条件概率的乘积。
    2. 归一化:确保计算的概率值归一化,使得总和为 1。
  • 马尔可夫模型技巧:

    1. 初始概率与转移概率:明确初始状态的概率分布和状态之间的转移概率矩阵。
    2. 序列概率计算:利用转移概率逐步计算整个序列的生成概率。
  • 综合概率计算:

    1. 将多种概率结果进行加权平均,以得到综合概率。

重点词汇

  • Probability Theory 概率论
  • Markov Model 马尔可夫模型
  • Bayes' Theorem 贝叶斯定理
  • Transition Probability 转移概率
  • Posterior Probability 后验概率

参考资料

  1. Probability and Statistics for Engineering and the Sciences by Jay L. Devore, Chap. 5 (Discrete Random Variables and Probability Distributions)
  2. Introduction to Probability Models by Sheldon M. Ross, Chap. 4 (Markov Chains)
  3. Pattern Recognition and Machine Learning by Christopher M. Bishop, Chap. 13 (Hidden Markov Models)