2022W

Problem 1

For a matrix denoted by , we write for the submatrix formed from the rows through and the columns from through of the matrix. We also denote and by and , respectively. (Note that they are row and column vectors, respectively.)

Assume below that is an nonsingular matrix which can be LU factorized. In addition, assume that a positive integer exists such that all entries in the -th sub- and super-diagonal of are zero if . Namely, if , is zero.

We denote the LU factorization of by , where is a lower triangular matrix with unit diagonal elements, and is an upper triangular matrix.

The following algorithm P computes and from the input in-place in such a way that the strictly lower triangular part and the upper triangular part of will be and , respectively. In other words, will be for , and will be for , when it terminates.

Algorithm P

for (k = 1; k < n; k = k + 1) {
    A[k+1:n,k] <- A[k+1:n,k] * (1 / A[k,k]);
    A[k+1:n,k+1:n] <- A[k+1:n,k+1:n] - A[k+1:n,k] * A[k,k+1:n];
}

Answer the following questions.

  1. Compute the LU factorization of the following matrix.
  1. Prove that and if .

  2. Assume that , , and . We wish to solve a set of linear systems,

where are the constant vectors, and are the unknown vectors. Explain the relative merits of the following methods (I) and (II) with respect to the amount of arithmetic operations.

(I) Compute first, and then compute each as .

(II) Compute the LU factorization of first, and then solve for . Solve lastly.


对于矩阵 ,我们写 表示从矩阵的第 行到第 行以及第 列到第 列构成的子矩阵。我们还将 分别表示为 。(注意它们分别是行向量和列向量。)

假设 是一个 的非奇异矩阵,可以进行 LU 分解。另外,假设存在一个正整数 ,使得当 时, 在第 条下对角线和超对角线上的所有元素都为零。即,如果 ,则 为零。

我们用 来表示 的 LU 分解,其中 是具有单位对角元素的下三角矩阵, 是上三角矩阵。

下面的算法 P 从输入 中就地计算 ,以这样的方式, 的严格下三角部分和上三角部分将分别是 。换句话说,当它终止时, 将为 (当 )和 (当 )。

算法 P

for (k = 1; k < n; k = k + 1) {
    A[k+1:n,k] <- A[k+1:n,k] * (1 / A[k,k]);
    A[k+1:n,k+1:n] <- A[k+1:n,k+1:n] - A[k+1:n,k] * A[k,k+1:n];
}

回答以下问题。

  1. 计算以下矩阵的 LU 分解。
  1. 证明 如果

  2. 假设 ,并且 。我们希望求解一组线性系统,

其中 是常量向量, 是未知向量。解释以下方法 (I) 和 (II) 在算术运算量方面的相对优点。

(I) 首先计算 ,然后将每个 计算为

(II) 首先计算 的 LU 分解,然后解 得到 。最后解


Problem 2

Let be a simple undirected graph with the vertex set and edge set . For an -dimensional vector , define by

Answer the following questions.

  1. For the case where is a complete graph of vertices, compute .
  2. Let and be those given in question (1). Let be the number of edges of . Compute
  1. Let be an arbitrary simple undirected graph. When each takes a value of either or with probability independently, compute the expected value of . You may use the linearity of expectation.
  2. Show that, for any simple undirected graph , there exists some such that

Here, denotes the number of edges of .


为一个简单无向图,其顶点集为 ,边集为 。对于一个 维向量 ,定义

回答以下问题。

  1. 是一个 个顶点的完全图 时,计算
  2. 为问题(1)中给出的。令 的边数。计算
  1. 为任意一个简单无向图。当每个 独立地以 的概率取 时,计算 的期望值。你可以使用期望值的线性性。
  2. 证明对于任意简单无向图 ,存在某个 使得

这里, 表示 的边数。


Problem 3

Let . Answer the following questions.

(1) Give a non-deterministic finite state automaton with 3 states that accepts the following language.

(2) Show the minimal deterministic finite state automaton that accepts the language given in question (1).

(3) Prove that the following language over is not regular. You may use the pumping lemma for regular languages.

Here, denotes the reverse of . For example, .

(4) Is the language in question (3) a context-free language? If it is, construct a context-free grammar that generates . If not, prove that is not a context-free language.


。回答以下问题。

(1) 给出一个具有 3 个状态的非确定性有限状态自动机,该自动机接受以下语言。

(2) 展示接受问题 (1) 中给出的语言的最小确定性有限状态自动机。

(3) 证明以下语言 上不是正则的。你可以使用正则语言的泵引理。

这里, 表示 的反转。例如,

(4) 问题 (3) 中的语言 是上下文无关语言吗?如果是,构造一个生成 的上下文无关文法。如果不是,证明 不是上下文无关语言。


Problem 4

Answer the following questions on digital circuits.

(1) Provide a Boolean expression of the output according to the following truth table. Design and depict a corresponding combinational circuit by using at most six 2-input NAND gates.

Truth table

(2) Depict the internal structure of a D-flip-flop, and explain how the D-flip-flop holds a 1-bit value.

(3) Consider a clock-synchronous sequential circuit with a 1-bit input , a 1-bit input , and a 1-bit output , where the input is used for the clocking. The output is ‘1’ when the number of ‘1’ in the input values in the past three clock cycles (excluding the current clock cycle) is greater than the number of ‘0’. Otherwise, the output is ‘0’. The output may be any value during the initial three clock cycles after the circuit is powered on. Assume that the circuit satisfies the setup-time and hold-time constraints. Design and depict the circuit. You may use at most two D-flip-flops and an arbitrary number of 2-input AND gates, 2-input OR gates, and NOT gates, if necessary.


问题 4

回答以下有关数字电路的问题。

(1) 根据以下真值表提供输出 的布尔表达式。设计并使用最多六个 2 输入 NAND 门绘制相应的组合电路。

真值表

(2) 描述 D 触发器的内部结构,并解释 D 触发器如何保持 1 位值。

(3) 考虑一个时钟同步顺序电路,具有 1 位输入 、1 位输入 和 1 位输出 ,其中输入 用于时钟控制。当过去三个时钟周期内(不包括当前时钟周期)输入 的值中 ‘1’ 的数量多于 ‘0’ 的数量时,输出 为 ‘1’。否则,输出 为 ‘0’。电路上电后的初始三个时钟周期内,输出 可以是任意值。假设电路满足建立时间和保持时间约束。设计并绘制电路。你可以使用最多两个 D 触发器和任意数量的 2 输入 AND 门、2 输入 OR 门和 NOT 门,如果需要的话。