2024A
Question 7
For real number and non-negative integer , let denote the function applied times iteratively to ; namely, and if . If for some , define as the minimum such ; namely, . Otherwise, is undefined. Answer each of the following questions and the reasoning behind it.
(1) When , show ( is the minimum integer that is or more).
(2) When , answer the minimum value of that satisfies .
(3) When , which is greater or equal, or ?
对于实数 和非负整数 ,设 表示将函数 迭代地应用于 次;即 并且 当 。如果 对某些 成立,定义 为最小的 ;即 。否则, 未定义。回答以下每个问题并解释其背后的理由。
(1) 当 时,证明 ( 是大于或等于 的最小整数)。
(2) 当 时,回答满足 的 的最小值。
(3) 当 时,比较 和 哪个更大或相等?
Question 8
Answer the following questions regarding the transition matrix $$\mathbf{P} = \begin{pmatrix}
1 - p & p \
q & 1 - q
\end{pmatrix}$$,
.
(1) Show that the vector $$\begin{pmatrix}
p \
-q
\end{pmatrix}$$ is an eigenvector of .
(2) Find the -th order transition matrix .
(3) Find .
The trace of an real-valued matrix is defined as . Answer the following questions.
(4) Prove that where the eigenvalues of are described as .
(5) Prove the following: If there exists a natural number such that ( is the zero matrix), then .
回答以下关于转移矩阵 $$\mathbf{P} = \begin{pmatrix}
1 - p & p \
q & 1 - q
\end{pmatrix}$$ 的问题,
。
(1) 证明向量 $$\begin{pmatrix}
p \
-q
\end{pmatrix}$$ 是 的一个特征向量。
(2) 求 阶转移矩阵 。
(3) 求 。
一个 实数值矩阵 的迹定义为 。回答以下问题。
(4) 证明 ,其中 的特征值为 。
(5) 证明以下命题:如果存在自然数 使得 ( 是零矩阵),则 。
Question 9
Here is an example of a graph, and its corresponding adjacency list:
graph LR;
1 --- 2;
1 --- 3;
2 --- 4;
4 --- 5;
2 --- 5;
(1) Write the adjacency list for this graph:
graph TB;
1 --- 3
1 --- 2
3 --- 2
3 --- 5
2 --- 5
2 --- 4
5 --- 4
5 --- 6
4 --- 6
(2) Draw the graph for this adjacency list:
(3) Suppose we perform a depth-first search of the graph at the top of this page, starting at node 2. Write a possible order in which we might visit the nodes. The first node should be node 2, and the second should be one of the nodes connected to node 2.
(4) Write a possible order in which we might visit the nodes, if we do breadth-first search of the graph at the top of this page, starting at node 2.
(5) Suppose a graph has nodes, and node has edges . The adjacency list is . Write pseudocode for an algorithm that outputs the number of connected components, using depth-first search. The algorithm should explicitly use each element of .
(6) Write pseudocode for an algorithm that outputs the number of connected components, using breadth-first search. The algorithm should explicitly use each element of .
这里有一个图的例子及其对应的邻接表:
graph LR;
1 --- 2;
1 --- 3;
2 --- 4;
4 --- 5;
2 --- 5;
(1) 为这个图写出邻接表:
graph TB;
1 --- 3
1 --- 2
3 --- 2
3 --- 5
2 --- 5
2 --- 4
5 --- 4
5 --- 6
4 --- 6
(2) 画出这个邻接表的图:
(3) 假设我们从图的顶部从节点 2 开始进行深度优先搜索。写出可能访问节点的顺序。第一个节点应该是节点 2,第二个应该是与节点 2 相连的节点之一。
(4) 写出如果我们从节点 2 开始对图进行广度优先搜索时可能访问节点的顺序。
(5) 假设一个图有 个节点,节点 有 条边 。邻接表是 。写出一个使用深度优先搜索输出连通分量数的算法伪代码。该算法应明确使用每个 元素。
(6) 写出一个使用广度优先搜索输出连通分量数的算法伪代码。该算法应明确使用每个 元素。
Question 10
Given , an integer array of elements, the following procedure, quick_sort
sorts the entire array of by calling quick_sort(0, V, 0, N - 1, -\infty, +\infty)
. swap(x, y)
is a special procedure that swaps the values of and .
(1) Answer what (A) does over array .
(2) Answer what holds.
(3) Let be the maximum during the entire sorting procedure. Given , show an example of array which gives the largest possible .
(4) Explain what and hold.
(5) We modify the program so as to work as is when is even and as if we swap inequality symbols and when is odd. Explain what happens if we sort the you answered in (3).
(6) Explain the benefits of introducing the modification explained in (5).
给定整数数组 ,其包含 个元素,以下程序 quick_sort
通过调用 quick_sort(0, V, 0, N - 1, -\infty, +\infty)
对 的整个数组进行排序。swap(x, y)
是一个特殊的过程,用于交换 和 的值。
(1) 解释 (A) 在数组 上的作用。
(2) 解释 的含义。
(3) 设 为整个排序过程中出现的最大 。给定 ,展示一个使得 最大的数组 的例子。
(4) 解释 和 的含义。
(5) 我们修改程序,以便在 为偶数时按原样工作,而在 为奇数时交换不等式符号 和 。解释如果我们对 (3) 中的 进行排序会发生什么。
(6) 解释引入 (5) 中修改的好处。
Question 11
Let be independent nonnegative real-valued random variables with the same probability density function . Answer the following questions with mathematical derivation.
(1) Compute the mean and variance of .
(2) Suppose the value of is given as for some . Compute probability that is less than or equal to for a given index with .
(3) Compute probability by multiplying the probability of (2) by and integrating it with respect to .
(4) Let be the minimum value of set . Compute the probability that is greater than or equal to for a given positive real number .
For given positive real numbers , define random variables as .
(5) Suppose the value of is given as for some . Compute probability that is less than or equal to for a given index with .
(6) Suppose the value of is given as for some . Compute probability that is less than or equal to for all the indices with .
(7) Let be a minimum element in set . Answer the probability distribution of index .
设 是 个独立的非负实值随机变量,其概率密度函数为 。请用数学推导回答以下问题。
(1) 计算 的均值和方差。
(2) 假设 的值为 ,计算 的概率,即 小于或等于 的概率,其中 。
(3) 计算 的概率,通过 (2) 的概率乘以 并对 积分。
(4) 令 为集合 的最小值。计算 的概率,即 大于或等于给定正实数 的概率。
对于 个给定的正实数 ,定义随机变量 为 。
(5) 假设 的值为 ,计算 的概率,即 小于或等于 的概率,其中 。
(6) 假设 的值为 ,计算 的概率,即 小于或等于 的概率,对于所有 。
(7) 令 为集合 中的最小元素。回答索引 的概率分布 。
Question 12
(1) The iterative equations below are for calculation of the score of global alignment of two sequences , , where is the match score of character and , and . The initial values are not shown here.
(1-1) Show the formula of the penalty for a gap of length .
(1-2) Suppose that some of the initial values are
, , ,
for : ,
for : .
Show the initial values and .
(1-3) Show the iterative equations to calculate the maximum score of local alignment using the same type of gap penalty.
(1-4) Explain a method to get a local alignment with the maximum score using the calculation of (1-3).
(2) There is a sequence consisting of . Define the complementary character of as
(2-1) Explain what is reported by the following algorithm.
(2-2) Let us define the ‘reverse complementary alignment score’ of two subsequences and of length and as the maximum score of global alignment of and . Note that is reverse ordered.
Also define the substitution matrix of the alignment as
and the gap penalty is the number of gaps (a gap of length has penalty ).
Show an algorithm to report a pair of (possibly empty) subsequences of with the maximum reverse complementary alignment score.
(1) 下列迭代方程用于计算两个序列 和 的全局比对得分,其中 是字符 和 的匹配得分,且 。初始值未显示。
(1-1) 展示长度为 的空隙的惩罚公式。
(1-2) 假设一些初始值为
, , ,
对于 : ,
对于 : 。
展示初始值 和 。
(1-3) 使用相同类型的空隙惩罚展示计算局部比对最大得分的迭代方程。
(1-4) 解释一种使用 (1-3) 的计算方法获取最大得分的局部比对的方法。
(2) 有一个由 组成的序列 。定义 的互补字符为
(2-1) 解释以下算法报告的内容。
(2-2) 定义两个子序列 和 的“反向互补对齐得分”为 和 的全局对齐的最大得分。注意 是反向排列的。
同样,定义对齐的替换矩阵为
并且间隙惩罚是间隙的数量(长度为 的间隙有惩罚 )。
展示一个算法报告 的一对(可能为空)子序列,具有最大反向互补对齐得分。