CS6505: Computability & Algorithms
Homework 10.
Due in class on Fri, Apr 6.
1. Consider the following greedy algorithm for nding a maximum matching: Start with an
arbitrary edge as the initial matching. Find another edge that does not have a vertex in
com

CS6505: Computability & Algorithms
Homework 8 Solutions
1. Given a graph G, a vertex cover is a set S of vertices so that every edge in G has at least one
endpoint in S. Consider the following randomized algorithm for nding a small vertex cover:
Start wit

CS6505: Computability & Algorithms
Homework 7 Solution.
1. You are given two n n matrices, with n = 2k for some natural number k, such that each
matrix has the following recursive structure: when divided into four equal-size blocks, the
two diagonal block

CS6505: Computability & Algorithms
Homework 5 Solutions.
1. Let G = (V, E) be a graph with nonnegative edge weights w(u, v) for each edge (u, v) E,
and s, t be a pair of nodes in G. The weight of a path from s to t is dened as the maximum
of the weights o

CS6505: Computability & Algorithms
Homework 4 Solutions.
1. Given a graph G, a matching in G is a set of edges such that no two of them share a vertex.
Let MATCHING = cfw_(G, k) : G has a matching of size k, i.e., the language consisting of
graphs G with

CS6505: Computability & Algorithms
Homework 2 Solution.
1. Describe a Turing machine that accepts all strings of the form 0n 1n , n 0 and rejects all
other strings. That is, the language consists of strings of some nite number of zeroes followed
by the sa

CS6505: Computability & Algorithms
Homework 1 Solutions.
1. Countability.
(a) Since S1 and S2 are countable, there exists a bijection f1 : S1 N and f2 : S2 N .
To prove that S1 S2 is countable, we need to dene a bijection g : N N N .
The bijection N N N i

CS6505: Computability & Algorithms
Homework 9 Solutions
Given two sets A and B of integers, their sum set C is dened to be
C = cfw_a + b : a A, b B.
For each c C, let m(c) denote the number of ways in which c can be obtained, i.e.,
m(c) = cfw_(a, b) : a A

CS6505: Computability & Algorithms
Homework 6 Solutions.
Prove that the following decision problems are NP-complete.
1. Given two graphs G1 , G2 and an integer k, determine whether there exists a graph H with
at least k edges such that H is contained in b