2019S2

Problem 1

Assume that we have a sequence of 2-dimensional vertices in an orthogonal coordinate system. Let be the polygon surrounded by the edges constructed by connecting the adjacent vertices as well as the last and first vertices . The polygon may not be convex. Assume that the edges meet only at their endpoints, and that holds for all . Assume also that no three vertices among lie on the same line. Answer the following questions.

  1. Explain a method to judge whether the orientation of the vertex sequence is clockwise or counterclockwise. We call the orientation of a vertex sequence counterclockwise.

  2. Give the area of the polygon as an expression of ‘s coordinates .

  3. Assume that a new vertex is given. Explain a method to judge whether the vertex is inside the polygon or not. You need not consider the case where the vertex is on the boundary of the polygon .

  4. Consider a process of dividing the interior of the polygon into triangles by adding edges between some of the vertices of the polygon so that the new edges are inside the polygon , and do not intersect. Give the number of triangles as an expression of . Prove that the expression is valid for any .

  5. Assume that two vertex sequences and with equal length are given. We apply a linear transformation to so that the distance between the resulting and is minimum. Here, the distance between and is defined as , where . Give such a linear transformation as an expression of and ‘s coordinates .


假设我们有一个二维顶点序列 在一个正交坐标系中。 设 为多边形,由连接相邻顶点 的边以及最后一个和第一个顶点 围成的多边形。 多边形 可能不是凸的。 假设边缘仅在端点相交,并且 对于所有 成立。 还假设没有三个顶点 在同一条直线上。 回答以下问题。

  1. 解释一种判断顶点序列的方向是顺时针还是逆时针的方法。 我们称顶点序列 的方向为逆时针。

  2. 的坐标 表示多边形 的面积。

  3. 假设给定一个新顶点 。 解释一种判断顶点 是否在多边形 内的方法。 您不需要考虑顶点 在多边形 边界上的情况。

  4. 考虑一种通过在多边形 的一些顶点之间添加边,将多边形 的内部分割成三角形的过程,使得新边在多边形 内部,并且不相交。 以 的表达式给出三角形的数量。 证明该表达式对任何 都有效。

  5. 假设给定两个长度相等的顶点序列 。 我们应用线性变换 使得得到的 之间的距离最小。 这里, 之间的距离定义为 ,其中 。给出这样的线性变换 作为 坐标的表达式


Problem 2

The probability density function of the normal distribution with mean and variance is given by

Let be random variables that independently follow this distribution, where is an integer no less than 2. Consider the estimation of based on loss function given by

where log is the natural logarithm and the regularization parameter is a positive real number. Let be the value minimizing the loss function . Answer the following questions.

  1. Express using .

  2. Obtain the expectations of and .

  3. Let and consider an orthogonal matrix and a random variable that are expressed as

for some real numbers .

(i) Obtain the values of .

(ii) Express and using .

(iii) Show that are independent of each other. You may use the following facts.

  • follows a trivariate normal distribution with mean vector and covariance matrix .
  • The probability density function of for is given by

where is the determinant of .


平均值 和方差 的正态分布的概率密度函数由下式给出

为独立服从此分布的随机变量,其中 为不小于 2 的整数。考虑基于损失函数 估计,定义损失函数

其中对数为自然对数,正则化参数 为正实数。令 为使损失函数 最小的值。回答以下问题。

  1. 使用 表示

  2. 的期望。

  3. 并考虑一个正交矩阵 和一个随机变量 ,它们表示为

其中 为一些实数。

(i) 求 的值。

(ii) 使用 表示

(iii) 证明 彼此独立。你可以使用以下事实。

  • 服从三元正态分布,均值向量 和协方差矩阵
  • 对于 的概率密度函数由下式给出

其中 的行列式。


Problem 3

Let be a non-negative real number, and let be a recursive function (i.e., computable function) from natural numbers (i.e., non-negative integers) to natural numbers. The expression means that is total and holds for any natural number . A non-negative real number is called computable if there exists a recursive function that satisfies . Answer the following questions.

  1. Show that is computable.

  2. Show that there exists a non-negative real number that is not computable.

  3. Show that if there exists a recursive function that satisfies , then there exists a recursive function that satisfies .

  4. For a unary function parameter , a function is called a -recursive function if can be defined by function composition, minimization and primitive recursion with as a basic function in addition to constants and , addition and projection functions are natural numbers and . The expression denotes the recursive function obtained by replacing with a unary recursive function in the definition of . The function from non-negative real numbers to non-negative real numbers is defined as follows.

Show that there exists no -recursive function that satisfies the following condition.

For any and , implies .


为非负实数, 为从自然数(即非负整数)到自然数的递归函数(即可计算函数)。 表达式 表示 是全函数并且 对于任意自然数 成立。 一个非负实数 称为可计算的,如果存在满足 的递归函数 。 回答以下问题。

  1. 证明 是可计算的。

  2. 证明存在不可计算的非负实数。

  3. 证明如果存在满足 的递归函数 ,则存在满足 的递归函数

  4. 对于一元函数参数 ,函数 称为 -递归函数,如果 可以通过函数组合、最小化和基本递归定义,其中 作为基本函数,另外还包括常数 ,加法 和投影函数 为自然数且 。表达式 表示在 的定义中用一元递归函数 替换 所得到的递归函数。从非负实数到非负实数的函数 定义如下。

证明不存在满足以下条件的 -递归函数

对于任何 蕴含


Problem 4

Consider a microprocessor that processes each instruction in the following four stages.

StageDescription
FetchFetch an instruction from memory.
DecodeDecode the instruction and read the specified registers.
ExecutePerform ALU or memory operations.
WriteWrite the result to the specified register.

Answer the following questions. Assume that the processing time required for each stage is seconds in questions (1) and (2).

  1. Obtain the execution time per instruction on this microprocessor. Also, obtain the throughput of this microprocessor (the number of instructions processed per second). Assume that each instruction always requires the four stages, and the next instruction is fetched only after the four stages are completed.

  2. The pipelining method is used to increase the throughput of a microprocessor. Explain how the above four stages are executed by the pipelining method. Also, obtain the throughput of this microprocessor under the assumption that the pipelining method works ideally.

  3. If pipeline hazards occur, the pipelining method may not work ideally. Explain the following three types of pipeline hazards.

    • Structural hazard
    • Data hazard
    • Control hazard
  4. The loop unrolling method is used to avoid pipeline hazards to some extent. Explain what is the loop unrolling method, and how it avoids pipeline hazards.


考虑一个微处理器,该处理器在以下四个阶段处理每条指令。

阶段描述
取指令从存储器中取出一条指令。
解码解码指令并读取指定的寄存器。
执行执行 ALU 或内存操作。
写回将结果写入指定的寄存器。

回答以下问题。在问题 (1) 和 (2) 中,假设每个阶段所需的处理时间为 秒。

  1. 求该微处理器每条指令的执行时间。 另外,求该微处理器的吞吐量(每秒处理的指令数)。假设每条指令始终需要四个阶段,并且只有在四个阶段完成后才取出下一条指令。

  2. 流水线方法用于提高微处理器的吞吐量。解释如何通过流水线方法执行上述四个阶段。 另外,假设流水线方法理想工作,求该微处理器的吞吐量。

  3. 如果发生流水线阻塞,流水线方法可能无法理想工作。解释以下三种类型的流水线阻塞。

    • 结构性阻塞
    • 数据阻塞
    • 控制阻塞
  4. 循环展开方法在一定程度上用于避免流水线阻塞。解释什么是循环展开方法,以及它如何避免流水线阻塞。


Problem 5

Suppose that is an dimensional positive-definite real symmetric matrix. Answer the following questions.

  1. An dimensional real lower triangular matrix whose diagonal entries are all positive can be expressed in a block form,

where , , and are a positive real number, an dimensional real vector, and an dimensional real lower triangular matrix whose diagonal entries are all positive, respectively. Using this expression, reduce the Cholesky decomposition of , to the Cholesky decomposition of an dimensional real symmetric matrix. Here, you need not show that we may assume to be a positive real number. You need not show that the obtained dimensional real symmetric matrix is positive definite, either.

  1. Using the Cholesky decomposition, construct a direct method to solve a system of linear equations whose coefficient matrix is .

  2. Prove that the -entry (the entry in the first row and first column) of is a positive real number.

  3. Using the result of question (1), answer the total number of the four arithmetic operations required for the Cholesky decomposition of in the form of , where and are constants. Note that this form means that the obtained number of operations may include an error which becomes relatively negligible when . In addition, suppose that the number of the four arithmetic operations required to compute a square root is a constant.


假设 是一个 维正定实对称矩阵。回答以下问题。

  1. 一个 维实数下三角矩阵 其对角线元素均为正可以用块形式表示为

其中 分别为一个正实数、一个 维实数向量和一个 维实数下三角矩阵,其对角线元素均为正。使用这个表达式,将 的 Cholesky 分解 约化为一个 维实对称矩阵的 Cholesky 分解。在这里,你不需要证明我们可以假设 是一个正实数。你也不需要证明得到的 维实对称矩阵是正定的。

  1. 使用 Cholesky 分解,构造一种直接方法来解系数矩阵为 的线性方程组。

  2. 证明 -元素(第一行和第一列的元素)是正实数。

  3. 使用问题 (1) 的结果,回答 Cholesky 分解 所需的四种算术运算 的总数,以 的形式,其中 是常数。注意,这种形式意味着获得的运算次数可能包括当 时变得相对可忽略的误差。此外,假设计算平方根所需的四种算术运算的次数是常数。


Problem 6

Consider the following decision problems A, B, and C.

A: A problem to determine whether there exist integers such that , for a given sorted array of different integers and a fixed constant .

B: A problem to determine whether there exist integers such that , for a given set of different integers .

C: A problem to determine whether there exist integers such that three points are on the same line, for a given set of different points represented by an orthogonal coordinate system, on the 2-dimensional Euclidean plane.

Answer the following questions.

  1. Show an algorithm that solves decision problem A in time.

  2. Show an algorithm that solves decision problem B in time.

  3. Suppose that three points represented by an orthogonal coordinate system, on the 2-dimensional Euclidean plane, are on the same line, where

  4. and are different real numbers. Express using and .

  5. Prove that there exists no algorithm that solves decision problem C in time under the assumption that there exists no algorithm that solves decision problem B in time.


考虑以下决策问题 ABC

A: 解决一个问题,即是否存在整数 使得 ,对于给定的长度为 的不同整数数组 和一个固定常数

B: 解决一个问题,即是否存在整数 使得 ,对于给定的长度为 的不同整数集合

C: 解决一个问题,即是否存在整数 使得三个点 在同一直线上,对于给定的长度为 的不同点集 由一个正交坐标系表示,在二维欧几里得平面上。

回答以下问题。

  1. 给出一个算法,该算法以 时间解决决策问题 A。

  2. 给出一个算法,该算法以 时间解决决策问题 B。

  3. 假设三个点 由一个正交坐标系表示,在二维欧几里得平面上,在同一直线上,其中 是不同的实数。使用 表示

  4. 在假设不存在算法以 时间解决决策问题 C 的情况下,证明不存在算法以 时间解决决策问题 B。