東京大学 新領域創成科学研究科 メディカル情報生命専攻 2022年8月実施 問題12
Author
zephyr
Description
We would like to know the probability that the string F R E D \mathbf{FRED} FRED appears in a random protein sequence. Assume the sequence has random independent letters from the protein alphabet A A A , and letter a ∈ A a \in A a ∈ A has probability p ( a ) p(a) p ( a ) . Define Q ( i , X ) Q(i, X) Q ( i , X ) to be the probability that F R E D \mathbf{FRED} FRED appears in a random sequence of length i i i , given that the sequence ends with X X X , where X X X is a length-4 string.
(1) What is Q ( 4 , X ) Q(4, X) Q ( 4 , X ) when X ≠ F R E D X \neq \mathbf{FRED} X = FRED ?
(2) What is Q ( 4 , X ) Q(4, X) Q ( 4 , X ) when X = F R E D X = \mathbf{FRED} X = FRED ?
Define X ′ X' X ′ to be X X X without its final letter. Define a ⋅ X a \cdot X a ⋅ X to be X X X with letter a a a prepended to it. These definitions may be useful to answer the following questions.
(3) What is Q ( i + 1 , X ) Q(i + 1, X) Q ( i + 1 , X ) , in terms of Q ( i , Y ) Q(i, Y) Q ( i , Y ) , where Y Y Y is any length-4 string, when X ≠ F R E D X \neq \mathbf{FRED} X = FRED ?
(4) What is Q ( i + 1 , X ) Q(i + 1, X) Q ( i + 1 , X ) when X = F R E D X = \mathbf{FRED} X = FRED ?
Define P ( X ) P(X) P ( X ) to be the product of the probabilities of the letters in X X X . Define A 4 A^4 A 4 to be the set of all possible length-4 strings. These definitions may be useful to answer the following question.
(5) What is the probability that F R E D \mathbf{FRED} FRED appears in a random sequence of length n n n , in terms of Q ( n , X ) Q(n, X) Q ( n , X ) ?
题目描述
蛋白质字母表为 A A A ,随机序列各位置独立同分布,字母 a ∈ A a\in A a ∈ A 出现的概率为 p ( a ) p(a) p ( a ) 。目标是计算连续字符串 FRED 在随机蛋白质序列中至少出现一次的概率。对任意长度为 4 的字符串 X X X ,定义
Q ( i , X ) = P ( 长度 i 的随机序列中出现过 ‘FRED‘ ∣ 末四个字母为 X ) . Q(i,X)=P(\text{长度 }i\text{ 的随机序列中出现过 `FRED`}\mid
\text{末四个字母为 }X). Q ( i , X ) = P ( 长度 i 的随机序列中出现过 ‘FRED‘ ∣ 末四个字母为 X ) .
回答下列问题:
当 X ≠ F R E D X\ne\mathrm{FRED} X = FRED 时求 Q ( 4 , X ) Q(4,X) Q ( 4 , X ) 。
当 X = F R E D X=\mathrm{FRED} X = FRED 时求 Q ( 4 , X ) Q(4,X) Q ( 4 , X ) 。
令 X ′ X' X ′ 为删去 X X X 最后一个字母所得的长度 3 字符串,a ⋅ X ′ a\cdot X' a ⋅ X ′ 表示在其前端添加字母 a a a 。当 X ≠ F R E D X\ne\mathrm{FRED} X = FRED 时,用所有长度 4 字符串 Y Y Y 对应的 Q ( i , Y ) Q(i,Y) Q ( i , Y ) 表示 Q ( i + 1 , X ) Q(i+1,X) Q ( i + 1 , X ) 。
当 X = F R E D X=\mathrm{FRED} X = FRED 时求 Q ( i + 1 , X ) Q(i+1,X) Q ( i + 1 , X ) 。
定义
P ( X ) = ∏ 字母 a 出现在 X 的各位置 p ( a ) , P(X)=\prod_{\text{字母 }a\text{ 出现在 }X\text{ 的各位置}}p(a), P ( X ) = 字母 a 出现在 X 的各位置 ∏ p ( a ) ,
并令 A 4 A^4 A 4 为全部长度 4 字符串的集合。用 Q ( n , X ) Q(n,X) Q ( n , X ) 、P ( X ) P(X) P ( X ) 对 X ∈ A 4 X\in A^4 X ∈ A 4 的加权和表示长度 n n n 随机序列中 FRED 出现的无条件概率。
Kai
(1)
Q ( 4 , X ) Q(4, X) Q ( 4 , X ) when X ≠ F R E D X \neq \mathbf{FRED} X = FRED :
If X ≠ F R E D X \neq \mathbf{FRED} X = FRED , then F R E D \mathbf{FRED} FRED has not appeared by the time the sequence reaches length 4 with ending X X X . Therefore, the probability Q ( 4 , X ) = 0 Q(4, X) = 0 Q ( 4 , X ) = 0 .
Q ( 4 , X ) = 0 for X ≠ F R E D Q(4, X) = 0 \quad \text{for} \quad X \neq \mathbf{FRED} Q ( 4 , X ) = 0 for X = FRED
(2)
Q ( 4 , X ) Q(4, X) Q ( 4 , X ) when X = F R E D X = \mathbf{FRED} X = FRED :
If X = F R E D X = \mathbf{FRED} X = FRED , then the sequence exactly matches F R E D \mathbf{FRED} FRED , meaning F R E D \mathbf{FRED} FRED has appeared. Therefore, the probability Q ( 4 , F R E D ) = 1 Q(4, \mathbf{FRED}) = 1 Q ( 4 , FRED ) = 1 .
Q ( 4 , F R E D ) = 1 Q(4, \mathbf{FRED}) = 1 Q ( 4 , FRED ) = 1
(3)
Q ( i + 1 , X ) Q(i + 1, X) Q ( i + 1 , X ) in terms of Q ( i , Y ) Q(i, Y) Q ( i , Y ) when X ≠ F R E D X \neq \mathbf{FRED} X = FRED :
To find Q ( i + 1 , X ) Q(i + 1, X) Q ( i + 1 , X ) , we need to consider all possible sequences of length i i i that could lead to a sequence ending with X X X when an additional letter is appended. Specifically, Q ( i + 1 , X ) Q(i + 1, X) Q ( i + 1 , X ) depends on Q ( i , a ⋅ X ′ ) Q(i, a \cdot X') Q ( i , a ⋅ X ′ ) for all possible letters a ∈ A a \in A a ∈ A .
Since X ≠ F R E D X \neq \mathbf{FRED} X = FRED , we have:
Q ( i + 1 , X ) = ∑ a ∈ A p ( a ) Q ( i , a ⋅ X ′ ) Q(i + 1, X) = \sum_{a \in A} p(a) Q(i, a \cdot X') Q ( i + 1 , X ) = a ∈ A ∑ p ( a ) Q ( i , a ⋅ X ′ )
(4)
Q ( i + 1 , X ) Q(i + 1, X) Q ( i + 1 , X ) when X = F R E D X = \mathbf{FRED} X = FRED :
If the sequence ends in F R E D \mathbf{FRED} FRED at length i + 1 i+1 i + 1 , then F R E D \mathbf{FRED} FRED has appeared, so Q ( i + 1 , F R E D ) = 1 Q(i + 1, \mathbf{FRED}) = 1 Q ( i + 1 , FRED ) = 1 .
Q ( i + 1 , F R E D ) = 1 Q(i + 1, \mathbf{FRED}) = 1 Q ( i + 1 , FRED ) = 1
(5)
The probability that F R E D \mathbf{FRED} FRED appears in a random sequence of length n n n :
To find the total probability that F R E D \mathbf{FRED} FRED appears in a sequence of length n n n , we will consider 3 cases:
n < 4 n < 4 n < 4 : In this case, F R E D \mathbf{FRED} FRED cannot appear, so the probability is 0.
n = 4 n = 4 n = 4 : The probability that F R E D \mathbf{FRED} FRED appears in a sequence of length 4 is given by Q ( 4 , F R E D ) = P ( F R E D ) = p ( F ) ⋅ p ( R ) ⋅ p ( E ) ⋅ p ( D ) Q(4, \mathbf{FRED}) = P(\mathbf{FRED}) = p(F) \cdot p(R) \cdot p(E) \cdot p(D) Q ( 4 , FRED ) = P ( FRED ) = p ( F ) ⋅ p ( R ) ⋅ p ( E ) ⋅ p ( D ) .
n > 4 n > 4 n > 4 : The probability that F R E D \mathbf{FRED} FRED appears in a sequence of length n n n is given by:
P ( F R E D ) = ∑ X ∈ A 4 Q ( n , X ) P(\mathbf{FRED}) = \sum_{X \in A^4} Q(n, X) P ( FRED ) = X ∈ A 4 ∑ Q ( n , X )
where P ( X ) P(X) P ( X ) is the product of the probabilities of the letters in X X X .
Therefore, the probability that F R E D \mathbf{FRED} FRED appears in a random sequence of length n n n can be concluded as follows:
P ( F R E D ) = { 0 if n < 4 p ( F ) ⋅ p ( R ) ⋅ p ( E ) ⋅ p ( D ) if n = 4 ∑ X ∈ A 4 Q ( n , X ) if n > 4 P(\mathbf{FRED}) =
\begin{cases}
0 & \text{if} \quad n < 4 \\
p(F) \cdot p(R) \cdot p(E) \cdot p(D) & \text{if} \quad n = 4 \\
\sum_{X \in A^4} Q(n, X) & \text{if} \quad n > 4
\end{cases} P ( FRED ) = ⎩ ⎨ ⎧ 0 p ( F ) ⋅ p ( R ) ⋅ p ( E ) ⋅ p ( D ) ∑ X ∈ A 4 Q ( n , X ) if n < 4 if n = 4 if n > 4
Knowledge
概率论 随机序列 字符串出现概率
难点解题思路
对于随机序列中特定字符串的出现概率问题,关键在于递推关系的构建以及边界条件的处理。通过定义恰当的递推公式,可以逐步推导出所需概率。
解题技巧和信息
构建递推关系,考虑当前状态如何从前一个状态转移。
确定边界条件,并基于这些条件初始化递推公式。
注意概率的加总,确保所有可能的转移情况都被考虑在内。
重点词汇
Probability: 概率
Sequence: 序列
Random: 随机的
Independent: 独立的
Recurrence relation: 递推关系
参考资料
Introduction to Probability Models, Chapter 3
Probability and Statistics for Engineers and Scientists, Chapter 5