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.

  1. Let . Prove whether is in , and whether is in .
  2. Let . Prove whether is in , and whether is in .
  3. 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 .

为正整数。令 表示解决大小为 的问题的计算时间函数。为了提供 的渐近上界和下界,我们分别定义了以下函数集

回答下列问题。

  1. 。证明 是否在 中,以及 是否在 中。
  2. 。证明 是否在 中,以及 是否在 中。
  3. 为等于或小于实数 的最大整数。假设 满足 对于 。证明 是否在 中,以及 是否在 中。

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 .

  1. Describe all the positive eigenvalues and associated normalized eigenvectors of matrix .
  2. Let be a linear mapping defined by . Describe the conditions on such that is surjective. Also, describe the conditions on such that is injective.
  3. The pseudoinverse of is defined by . Let and define linear mapping by . Show that image is linearly isomorphic to kernel (: dimensional zero vector).
  4. Show that (, ) is an orthogonal decomposition.
  5. For a given , let . Show that minimizes . (Hint: )

为一个 的实矩阵,且正秩为 。这样的矩阵有一个奇异值分解 ,其中 分别是 的实矩阵,并且满足 单位矩阵,:矩阵 的转置)。 是一个 的实对角矩阵,其对角元素 )满足

  1. 描述矩阵 的所有正特征值和相关的归一化特征向量。
  2. 为由 定义的线性映射。描述 的条件,使得 是满射。同时,描述 的条件,使得 是单射。
  3. 的伪逆定义为 。令 并定义线性映射 。证明 在线性上同构于 维零向量)。
  4. 证明 )是一个正交分解。
  5. 对于给定的 ,令 。证明 最小化 。 (提示:

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 .

  1. 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]
  1. 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.

  2. 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 .

  3. 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 .

  4. 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.


二叉堆树是一种二叉树,其整数标签的值满足父节点的值不小于任何子节点的值。我们用 表示树 的高度。

  1. 从以下选项中选择所有二叉堆树。
    • (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]
  1. 假设我们有一个高度为 2 的二叉树 。展示一个算法,通过至多一次交换一个节点和其子节点的标签使 成为一个二叉堆树。

  2. 假设我们有两个二叉堆树 。一个树 有一个根节点 ,连接了 的根节点成为 的两个子节点。展示一个算法,使得从树 创建一个二叉堆树 的最坏时间复杂度为

  3. 假设我们有一个二叉树 。展示一个算法,通过迭代交换一个节点和其子节点的标签使 成为一个二叉堆树,其最坏时间复杂度为

  4. 展示一个算法,使用你在 (4) 中展示的操作按降序排列整数数组。展示该算法相对于数组中元素数量的最坏时间复杂度。


Question 10

Answer the following questions regarding graphs.

  1. Prove that the sum of the vertex degrees of an undirected graph is equal to the number of edges times two.
  2. Prove the following proposition: If a graph with vertex set and edge set is a tree, .
  3. 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(( ));
  1. 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.

回答以下关于图的问题。

  1. 证明无向图的顶点度数之和等于边数的两倍。
  2. 证明以下命题:如果图 的顶点集 和边集 是一棵树,那么
  3. 给定一个无向图 和一组边 ,如果 是一棵树,则图 称为生成树。在所有加权图的生成树中,权重和最小的称为最小生成树。展示下图的最小生成树。
graph TD;
    A(( )) ---|5| B(( ));
    A(( )) ---|2| C(( ));
    B(( )) ---|7| C(( ));
    B(( )) ---|4| D(( ));
    B(( )) ---|8| E(( ));
    C(( )) ---|9| E(( ));
    D(( )) ---|4| E(( ));
  1. 假设图 的生成树 不同。证明以下命题:对于 中的任何边 ,存在 中的边 使得 形成一棵生成树。

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.

  1. Find the distribution function of .
  2. Find the distribution function of .
  3. Find the distribution function of for any .
  4. Find the expectation of when is the uniform distribution over .

假设实值相互独立随机变量 的分布是相同的,并记为

为将 按升序排列后得到的随机变量。回答以下问题。

  1. 找到 的分布函数。
  2. 找到 的分布函数。
  3. 找到任意 的分布函数。
  4. 上的均匀分布时,找到 的期望。

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 .

  1. 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 .

  2. Compute matrices and for and .

  3. Suppose matrix is given. Write a pseudocode for obtaining one of the longest common subsequences.

  4. Suppose matrices and are given. Write a pseudocode for computing the maximal length of common subsequences that contain the -th position of ().


对于长度为 的两个字符串 (),我们定义公共子序列集为

这里, 表示公共子序列 的长度。令 表示最长公共子序列的长度。如果 ,我们定义

  1. 分别表示字符串 的长度为 的前缀和后缀。我们定义 对于 。描述从 ,和 计算 的递推关系,当 。同时,描述从 ,和 计算 的递推关系,当

  2. 计算 的矩阵

  3. 假设给定矩阵 。编写伪代码以获取一个最长的公共子序列。

  4. 假设给定矩阵 。编写伪代码以计算包含 的第 个位置的最大长度的公共子序列 ()。