2021W

Problem 1

Ordered binary trees are trees in which each node has at most two ordered children. Below, denotes the set of all the ordered binary trees with leaves. Let denote the depth of node in an ordered binary tree , i.e., the number of edges on the path from the root to .

For a sequence of positive real numbers, we define and by:

For an ordered binary tree , we define by:

where is the -th leaf from left in .

Answer the following questions.

  1. Give the tree that has the smallest value of in case .

  2. Show that holds for any ordered binary tree with leaves .

  3. Assume that range over the set of positive real numbers so that . Show that is maximized when for any sequence of positive real numbers.

  4. Show that any ordered binary tree satisfies for any sequence of positive real numbers.


有序二叉树是指每个节点最多有两个有序子节点的树。下面, 表示具有 叶节点的所有有序二叉树的集合。设 表示有序二叉树 中节点 的深度,即从根到 的路径上的边数。

对于一个由 个正实数组成的序列 ,我们定义 如下:

对于一个有序二叉树 ,我们定义 如下:

其中 中从左数的第 个叶节点。

回答以下问题。

  1. 给出在 情况下 最小的树

  2. 证明对于任何有叶节点 的有序二叉树 成立。 ·

  3. 假设 在正实数范围内变化,并且满足 。证明对于任何由 个正实数组成的序列 ,当 时, 取得最大值。

  4. 证明对于任何有序二叉树 ,对于任何由 个正实数组成的序列


Problem 2

Answer the following questions on digital circuits.

  1. Design and depict a circuit equivalent to XOR (exclusive OR) gate by using at most five 2-input NAND gates.

  2. Design and depict a 1-bit full-adder by using only two 2-input XOR gates and three 2-input NAND gates.

  3. Design and depict a 4-bit adder circuit by using four 1-bit full-adders. You may use 2-input NAND gates, 2-input NOR gates, and NOT gates, if necessary. Indicate also the critical path of the 4-bit adder circuit.

  4. Consider a 4-bit clock-synchronous up-down binary counter circuit. The circuit has a 1-bit input CLK for the clocking. The circuit also has a 1-bit input X and a 4-bit output Y. The circuit counts a number from 0 to 15, and outputs the counter value to the output Y. When the input X is ‘1’, the counter value is incremented by one for each positive clock edge. Otherwise, the counter value is decremented by one for each positive clock edge. The circuit allows overflows, i.e. the next counter value is 0 when the current counter value is 15 and the input X is ‘1’, and the next counter value is 15 when the current counter value is 0 and the input X is ‘0’. Assume that the circuit satisfies the setup-time and hold-time constraints. Design and depict the 4-bit clock-synchronous up-down binary counter circuit. You may use 1-bit full-adders, D-flip-flops, 2-input NAND gates, 2-input NOR gates, and NOT gates, if necessary.


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

  1. 设计并描绘一个等效于 XOR(异或)门的电路,最多使用五个 2 输入 NAND 门。

  2. 设计并描绘一个 1 位全加器,仅使用两个 2 输入 XOR 门和三个 2 输入 NAND 门。

  3. 设计并描绘一个 4 位加法器电路,使用四个 1 位全加器。可以使用 2 输入 NAND 门、2 输入 NOR 门和 NOT 门(如有必要)。同时标明 4 位加法器电路的关键路径。

  4. 考虑一个 4 位时钟同步上下计数二进制计数器电路。电路有一个用于时钟的 1 位输入 CLK。电路还有一个 1 位输入 X 和一个 4 位输出 Y。电路计数从 0 到 15,并将计数值输出到输出 Y。当输入 X 为 ‘1’ 时,计数值在每个正时钟边沿递增 1。否则,计数值在每个正时钟边沿递减 1。电路允许溢出,即当当前计数值为 15 且输入 X 为 ‘1’ 时,下一个计数值为 0,当当前计数值为 0 且输入 X 为 ‘0’ 时,下一个计数值为 15。假设电路满足设置时间和保持时间约束。设计并描绘这个 4 位时钟同步上下计数二进制计数器电路。可以使用 1 位全加器、D 触发器、2 输入 NAND 门、2 输入 NOR 门和 NOT 门(如有必要)。


Problem 3

Let be the set of letters. Given two languages , we define by:

For example, if and , then

For a finite automaton , we write for the language accepted by .

Answer the following questions.

  1. Let and . Give the set .

  2. Let and be the languages expressed by the regular expressions and , respectively. Express by using a regular expression.

  3. Let and be deterministic finite automata. Here, and are the set of states, the transition function, the initial state, and the set of final states of (), respectively. Assume that the transition functions () are total. Give a non-deterministic finite automaton that accepts , with a brief explanation. You may use -transitions.

  4. Answer whether the following statement is true:

“For every context-free language and regular language , is a regular language.”

Also, give a proof sketch if the answer is yes, and give a counterexample if the answer is no.


为字母集合 。给定两个语言 ,我们定义 如下:

例如,如果 ,则

对于一个有限自动机 ,我们用 表示 接受的语言。回答以下问题。

  1. 。给出集合

  2. 分别由正则表达式 表示。用正则表达式表示

  3. 为确定性有限自动机。这里, 的状态集合、转换函数、初态和终态集合()。假设转换函数 )是全函数。给出一个非确定性有限自动机,该自动机接受 ,并简要解释。你可以使用 -转换。

  4. 回答以下陈述是否正确:

“对于每个上下文无关语言 和正则语言 是正则语言。”

如果答案是肯定的,请给出证明草图;如果答案是否定的,请给出反例。


Problem 4

Let and () be natural numbers and be the set of real numbers. Denote by the transposition operator of a vector and a matrix. Define the inner product of two column vectors as . Let be a -dimensional column vector, an matrix where is invertible, and an -dimensional column vector. Consider solving the following optimization problem by using the Lagrange multipliers method:

where . The Lagrange function is given by

where is the Lagrange multipliers.

Let be positive real values. The sets of column vectors and form an orthonormal basis of and , respectively; that is, they are all unit vectors and orthogonal to each other. Suppose that the singular value decomposition of is

where is an matrix, is an matrix, and is a matrix given by

Moreover, define

Answer the following questions. Describe not only an answer but also the derivation process.

  1. Express using only .

  2. Express using only and ().

  3. Suppose we wish to express the stationary points of in the form of and . Express the matrices and using only .

  4. Express in question (3) using only .


() 为自然数, 为实数集。记 为向量和矩阵的转置算子。定义两个列向量 的内积为 。设 为一个 维列向量, 是一个 矩阵,其中 可逆, 是一个 维列向量。考虑使用拉格朗日乘子法求解以下优化问题:

其中 。拉格朗日函数为

其中 是拉格朗日乘子。

为正实数。列向量集合 分别构成 的正交基;即它们都是单位向量且彼此正交。假设 的奇异值分解为

其中 是一个 矩阵, 是一个 矩阵, 是一个 矩阵,给出如下

此外,定义

回答以下问题。描述答案的同时也要给出推导过程。

  1. 使用仅 表示

  2. 使用仅 () 表示

  3. 假设我们希望用 表示 的驻点。使用仅 表示矩阵

  4. 使用仅 表示问题 (3) 中的