2018
Question 7
Let be a positive integer. Let and denote functions that represent computation time for solving a problem of size . To provide asymptotic upper and lower bounds on , we define the following sets of functions, and , respectively:
Answer the following questions.
- Let . Prove whether is in , and whether is in .
- Let . Prove whether is in , and whether is in .
- Let be the largest integer that is equal to or smaller than real number . Suppose that satisfies that and for . Prove whether is in , and whether is in .
设 为正整数。令 和 表示解决大小为 的问题的计算时间函数。为了提供 的渐近上界和下界,我们分别定义了以下函数集 和 :
回答下列问题。
- 令 。证明 是否在 中,以及 是否在 中。
- 令 。证明 是否在 中,以及 是否在 中。
- 设 为等于或小于实数 的最大整数。假设 满足 且 对于 。证明 是否在 中,以及 是否在 中。
Question 8
Let be an real matrix with positive rank . Such a matrix has a singular value decomposition , where and are , real matrices, respectively, and satisfy , (: unit matrix, : transpose of matrix ). is an real diagonal matrix whose diagonal elements () satisfy .
- Describe all the positive eigenvalues and associated normalized eigenvectors of matrix .
- Let be a linear mapping defined by . Describe the conditions on such that is surjective. Also, describe the conditions on such that is injective.
- The pseudoinverse of is defined by . Let and define linear mapping by . Show that image is linearly isomorphic to kernel (: dimensional zero vector).
- Show that (, ) is an orthogonal decomposition.
- For a given , let . Show that minimizes . (Hint: )
设 为一个 的实矩阵,且正秩为 。这样的矩阵有一个奇异值分解 ,其中 和 分别是 、 的实矩阵,并且满足 ,(: 单位矩阵,:矩阵 的转置)。 是一个 的实对角矩阵,其对角元素 ()满足 。
- 描述矩阵 的所有正特征值和相关的归一化特征向量。
- 令 为由 定义的线性映射。描述 的条件,使得 是满射。同时,描述 的条件,使得 是单射。
- 的伪逆定义为 。令 并定义线性映射 由 。证明 在线性上同构于 (: 维零向量)。
- 证明 (,)是一个正交分解。
- 对于给定的 ,令 。证明 最小化 。 (提示:)
Question 9
A binary heap tree is a binary tree with integer labels such that the value of a parent node is no less than the value of any child node. We denote the height of a tree by .
- Choose all binary heap trees from the following.
- (A)
graph TD
A[4]
- (B)
graph TD
A[5] --> B[5]
- (C)
graph TD
A[3] --> B[1]
A[3] --> C[4]
- (D)
graph TD
A[9] --> B[1]
A[9] --> C[5]
C[5] --> D[3]
C[5] --> E[2]
-
Suppose we have a binary tree of height 2. Show an algorithm that makes a binary heap tree by exchanging the labels of a node and its child at most once.
-
Suppose we have two binary heap trees and . A tree has a root node concatenated with and ; the root nodes of and become the two children of . Show an algorithm that creates a binary heap tree from a tree in worst-case time complexity .
-
Suppose we have a binary tree . Show an algorithm that makes a binary heap tree by iteratively exchanging the labels of a node and its child in worst-case time complexity .
-
Show an algorithm that sorts in descending order an array of integers using the operations you showed in (4). Show the worst-case time complexity of the algorithm with regard to the number of elements in the array.
二叉堆树是一种二叉树,其整数标签的值满足父节点的值不小于任何子节点的值。我们用 表示树 的高度。
- 从以下选项中选择所有二叉堆树。
- (A)
graph TD
A[4]
- (B)
graph TD
A[5] --> B[5]
- (C)
graph TD
A[3] --> B[1]
A[3] --> C[4]
- (D)
graph TD
A[9] --> B[1]
A[9] --> C[5]
C[5] --> D[3]
C[5] --> E[2]
-
假设我们有一个高度为 2 的二叉树 。展示一个算法,通过至多一次交换一个节点和其子节点的标签使 成为一个二叉堆树。
-
假设我们有两个二叉堆树 和 。一个树 有一个根节点 ,连接了 和 ; 和 的根节点成为 的两个子节点。展示一个算法,使得从树 创建一个二叉堆树 的最坏时间复杂度为 。
-
假设我们有一个二叉树 。展示一个算法,通过迭代交换一个节点和其子节点的标签使 成为一个二叉堆树,其最坏时间复杂度为 。
-
展示一个算法,使用你在 (4) 中展示的操作按降序排列整数数组。展示该算法相对于数组中元素数量的最坏时间复杂度。
Question 10
Answer the following questions regarding graphs.
- Prove that the sum of the vertex degrees of an undirected graph is equal to the number of edges times two.
- Prove the following proposition: If a graph with vertex set and edge set is a tree, .
- Given an undirected graph and a set of edges , the graph is called a spanning tree, if is a tree. Among all spanning trees of a weighted graph, those with the minimum sum of weights are called minimum spanning trees. Show a minimum spanning tree of the following graph.
graph TD;
A(( )) ---|5| B(( ));
A(( )) ---|2| C(( ));
B(( )) ---|7| C(( ));
B(( )) ---|4| D(( ));
B(( )) ---|8| E(( ));
C(( )) ---|9| E(( ));
D(( )) ---|4| E(( ));
- Assume that and are different spanning trees of graph . Prove the following proposition: For any edge , there is an edge such that forms a spanning tree.
回答以下关于图的问题。
- 证明无向图的顶点度数之和等于边数的两倍。
- 证明以下命题:如果图 的顶点集 和边集 是一棵树,那么 。
- 给定一个无向图 和一组边 ,如果 是一棵树,则图 称为生成树。在所有加权图的生成树中,权重和最小的称为最小生成树。展示下图的最小生成树。
graph TD;
A(( )) ---|5| B(( ));
A(( )) ---|2| C(( ));
B(( )) ---|7| C(( ));
B(( )) ---|4| D(( ));
B(( )) ---|8| E(( ));
C(( )) ---|9| E(( ));
D(( )) ---|4| E(( ));
- 假设图 的生成树 和 不同。证明以下命题:对于 中的任何边 ,存在 中的边 使得 形成一棵生成树。
Question 11
Assume that the distributions of real-valued mutually independent random variables are identical and denoted as .
Denote by the random variables obtained by arranging in ascending order. Answer the following questions.
- Find the distribution function of .
- Find the distribution function of .
- Find the distribution function of for any .
- Find the expectation of when is the uniform distribution over .
假设实值相互独立随机变量 的分布是相同的,并记为 。
记 为将 按升序排列后得到的随机变量。回答以下问题。
- 找到 的分布函数。
- 找到 的分布函数。
- 找到任意 的 的分布函数。
- 当 为 上的均匀分布时,找到 的期望。
Question 12
For two strings and of lengths and (), we define the set of common subsequences as
Here, represents the length of common subsequence . Let denote the length of the longest common subsequences. If , we define .
-
Let and denote the length- prefix and suffix of string , respectively. We define and for . Describe a recurrence for computing from , , and when . Also, describe a recurrence for computing from , , and when .
-
Compute matrices and for and .
-
Suppose matrix is given. Write a pseudocode for obtaining one of the longest common subsequences.
-
Suppose matrices and are given. Write a pseudocode for computing the maximal length of common subsequences that contain the -th position of ().
对于长度为 和 的两个字符串 和 (),我们定义公共子序列集为
这里, 表示公共子序列 的长度。令 表示最长公共子序列的长度。如果 ,我们定义 。
-
令 和 分别表示字符串 的长度为 的前缀和后缀。我们定义 和 对于 。描述从 ,,和 计算 的递推关系,当 。同时,描述从 ,,和 计算 的递推关系,当 。
-
计算 和 的矩阵 和 。
-
假设给定矩阵 。编写伪代码以获取一个最长的公共子序列。
-
假设给定矩阵 和 。编写伪代码以计算包含 的第 个位置的最大长度的公共子序列 ()。