2018S2

Problem 1

Consider solving numerically a system of first-order linear ordinary differential equations

on a set of real functions of a real independent variable ,

where is the component of an coefficient matrix . Let be the step size used in the numerical methods. Suppose that the numerical solution is computed from initial values

Assume that matrix has distinct eigenvalues for any . Answer the following questions.

  1. Suppose that is a constant matrix , which is independent of . Answer a necessary and sufficient condition for the eigenvalues of to satisfy

for any initial value.

  1. Answer a recurrence formula to solve Eq. () by the forward Euler method. In addition, express the order of the local truncation error by big O notation of the step size .

  2. Suppose that Eq. () is solved by the forward Euler method. The obtained approximation of is expressed as , where is a non-negative integer to express the step number of the method. Suppose that is a constant matrix , which is independent of . Answer a necessary and sufficient condition for the eigenvalues of to satisfy

for any initial value.

  1. Give an advantage of the backward Euler method compared to the forward Euler method with a brief explanation.

  2. Compare the computational complexity of one step to solve Eq. () by the forward Euler method with that by the backward Euler method, by using big O notation of . Assume that the computational complexity to read each is .


考虑对一个一阶线性常微分方程组进行数值求解:

在一组关于实数独立变量 个实函数上,

其中 系数矩阵 分量。令 为数值方法中使用的步长。假设数值解是从初始值

计算得出的。假设矩阵 对于任何 都有 个不同的特征值。回答以下问题。

  1. 假设 是与 无关的常数矩阵 。回答 的特征值满足

的必要和充分条件。

  1. 用前向欧拉法回答求解方程 () 的递推公式。此外,用大 O 记号表示步长 的局部截断误差的阶数。

  2. 假设用前向欧拉法求解方程 ()。所得的 的近似值表示为 ,其中 是表示方法的步数的非负整数。假设 是与 无关的常数矩阵 。回答 的特征值满足

的必要和充分条件。

  1. 简要说明后向欧拉法相比前向欧拉法的一个优势。

  2. 比较用大 O 记号表示的,前向欧拉法和后向欧拉法求解方程 () 的一步计算复杂度。假设读取每个 的计算复杂度为


Problem 2

Let be a finite set of symbols denoting variables, a finite set of constant symbols, a finite set of binary function symbols, and the set of terms constructed from symbols in , , and . Let be a finite set of rewrite rules of the form or of the form , where , and , and each appears in the left-hand side of exactly one rewrite rule in . For , the relation is defined as follows:

The relation is defined as the reflexive and transitive closure of , and the relation is defined as the reflexive, transitive and symmetric closure of .

Answer the following questions.

  1. Show that if and , then there exists such that and .

  2. Give an algorithm that judges for , and explain its correctness.

For and , the operation that extracts a sub term of is inductively defined as follows:

Here is an empty word. For , the relation is then defined as follows:

Answer the following question:

  1. Give an algorithm that judges for , and explain its correctness.

为表示变量的有限符号集, 为有限常量符号集, 为二元函数符号的有限集, 为由 中的符号构成的项的集合。设 为重写规则的有限集合,形式为 ,其中 ,且每个 仅出现在一个重写规则的左侧。对于 ,关系 定义如下:

关系 定义为 的自反和传递闭包,关系 定义为 的自反、传递和对称闭包。

回答以下问题。

  1. 证明如果 ,那么存在 使得

  2. 给出一个算法来判断 对于 ,并解释其正确性。

对于 ,运算 提取 的子项,其递归定义如下:

这里 是空字。对于 ,关系 定义如下:

回答以下问题:

  1. 给出一个算法来判断 对于 ,并解释其正确性。

Problem 3

Let denote the set of leaves in the descendants of node in a tree, and let denote the number of edges of the simple path from node to node . For a non-leaf node , is called the height of . Let the height of a leaf be . The height of the root of a tree is called the height of the tree.

Here, we have a binary tree with height , in which each node must have one of the following properties.

  • is a leaf.
  • has only one child, and the height of is .
  • has two children, and the heights of the two children of differ by .

Let denote the number of nodes in for . Let . Answer the following questions.

  1. Calculate .

  2. Express in terms of and for .

  3. Prove that for every .

  4. Prove that for every .

  5. Consider the problem of assigning each of given integers to a distinct node of . The integer assigned to each node must be no smaller than any of the integers assigned to ‘s children. Show an algorithm that computes such an assignment, with a proof that the algorithm runs indeed in time. Note that the integers may not be sorted in the input.


表示树中节点 的后代中的叶子集合, 表示从节点 到节点 的简单路径的边数。对于非叶子节点 称为 的高度。令叶子的高度为 。树根的高度称为树的高度。

在此,我们有一个高度为 的二叉树 ,其中每个节点 必须具有以下属性之一。

  • 是一个叶子。
  • 只有一个孩子,且 的高度为
  • 有两个孩子,并且 的两个孩子的高度相差

表示 中的节点数,对于 。令 。回答以下问题。

  1. 计算

  2. 表示 对于

  3. 证明 对于每个

  4. 证明 对于每个

  5. 考虑将给定的 个整数分配给 的不同节点的问题。分配给每个节点 的整数必须不小于分配给 的孩子的任何整数。给出一个 算法来计算这样的分配,并证明该算法确实在 时间内运行。注意,输入中的 个整数可能没有排序。


Problem 4

Answer the following questions regarding cache memory of a microprocessor with 32-bit memory-addressing.

  1. Consider cache memory with a capacity of bytes and a block size of 64 bytes. The cache memory uses a full associative scheme, a two-way set-associative scheme, or a direct mapping scheme. For each of those schemes, obtain the bit length for each of a tag, an index, and an offset.

  2. Consider cache memory with a capacity of 64 bytes and a block size of 8 bytes. Obtain the number of cache hits, when the hexadecimal memory addresses below are accessed by 4-byte read operations in this order, in case that the cache memory uses a full associative scheme, a two-way set-associative scheme, and a direct mapping scheme, respectively. Assume that the cache memory is empty at the beginning, and the cache block is replaced based on the LRU (Least Recently Used) algorithm.

    0x20, 0x48, 0x40, 0x4C, 0x58, 0x80, 0xB8, 0xC8, 0x40, 0x44, 0x48, 0x4C, 0x50, 0x54, 0x58, 0x30, 0x28
    

回答以下有关具有 32 位内存地址的微处理器缓存存储器的问题。

  1. 考虑容量为 字节、块大小为 64 字节的缓存存储器。缓存存储器使用全相联方案、二路组相联方案或直接映射方案。对于这些方案中的每一种,计算标记、索引和偏移的位长度。

  2. 考虑容量为 64 字节、块大小为 8 字节的缓存存储器。当按以下顺序访问十六进制内存地址时,计算在使用全相联方案、二路组相联方案和直接映射方案的情况下,缓存命中次数。假设缓存存储器在开始时为空,并且缓存块基于 LRU(最近最少使用)算法进行替换。

    0x20, 0x48, 0x40, 0x4C, 0x58, 0x80, 0xB8, 0xC8, 0x40, 0x44, 0x48, 0x4C, 0x50, 0x54, 0x58, 0x30, 0x28
    

Problem 5

Denote the set of real numbers with and the absolute value of a real value with . For a -dimensional real column vector , we write its -th element as , and define and . The transpose of is written as .

A vector is a subgradient of a convex function at if

holds. The set of subgradients of a convex function at , is called the subdifferential of at , and is denoted by . You may use the following facts (i), (ii), and (iii). (i) A differentiable convex function satisfies

(ii) For convex functions and , it holds that . (iii) is a necessary and sufficient condition that a convex function is minimized by .

Answer the following questions.

  1. (a) For , obtain . (b) For , obtain .

  2. For , obtain . Also obtain that minimizes .

  3. For , obtain . Also, assuming that minimizes , and letting be an integer satisfying , obtain a necessary and sufficient condition for .

Consider the problem of predicting one dimensional real-valued label from a -dimensional real vector . Suppose that a set of training samples

is given where means that is the real-valued label of .

By using a -dimensional parameter , define a loss function as

We formulate the training of a predictor as the following optimization problem with a positive real value :

The following algorithm is known for obtaining the optimal solution . It iteratively solves the optimization problem () from an initial value and using the step size :

Answer the following question.

  1. Express using and such that is a necessary and sufficient condition for , where is an integer satisfying .

表示实数集,用 表示实数 的绝对值。对于 维实数列向量 ,我们将其第 个元素写为 ,并定义 的转置写为

向量 是凸函数 处的一个次梯度,如果

成立。凸函数 处的次梯度集合 被称为 处的次微分,并用 表示。你可以使用以下事实 (i)、(ii) 和 (iii)。 (i) 可微凸函数 满足

(ii) 对于凸函数 ,有 。 (iii) 是凸函数 最小化的必要且充分的条件。

回答以下问题。

  1. (a) 对于 ,求 。 (b) 对于 ,求

  2. 对于 ,求 。 还要求出使 最小化的

  3. 对于 ,求 。 还要假设 最小化 ,并且令 为满足 的整数,求 的必要且充分的条件。

考虑从 维实数向量 预测一维实值标签 的问题。假设给定一组 个训练样本

其中 表示 的实值标签。

通过使用 维参数 ,定义损失函数为

我们将预测器的训练表述为以下具有正实值 的优化问题:

已知以下算法用于获得最优解 。 它从初始值 开始,使用步长 迭代求解优化问题 ():

回答以下问题。

  1. 表示 使得 的必要且充分的条件,其中 是满足 的整数。

Problem 6

Consider the decomposition time of an RNA molecule. Assume that the probability density function of the decomposition time is

where is a positive real constant.

Answer the following questions.

  1. Calculate the cumulative distribution function

Also compute the median of .

  1. We measured the decomposition times of RNA molecules. Assume that the decomposition time of each RNA molecule follows the probability density function independently and identically. Calculate the expected value and the variance of
  1. Let , which is the maximum of the measured times in question (2). Let denote the probability that . Give an expression for in terms of .

  2. Calculate the probability density function of , and the expected value of .


考虑 RNA 分子的分解时间。假设分解时间 的概率密度函数为

其中 是正实常数。

回答以下问题。

  1. 计算累积分布函数

并计算 的中位数。

  1. 我们测量了 个 RNA 分子的分解时间 。假设每个 RNA 分子的分解时间独立且同分布,并服从概率密度函数 。计算

的期望值和方差。

  1. ,它是问题 (2) 中测量时间 的最大值。设 表示 的概率。用 表示 的表达式。

  2. 计算 的概率密度函数 以及 的期望值。