

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The solutions to problem set 0 of cs 475, a university course offered in the fall of 2005. The problem set includes four mathematical problems covering topics such as induction, rational numbers, graph theory, and set theory. Students are advised not to turn in the solutions and are recommended to read materials from cs 173, cs 273, and hopcroft, motwani and ullman.
Typology: Assignments
1 / 3
This page cannot be seen from the preview
Don't miss anything!


Assigned On: August 30, 2005
Instructions: This problem set tests whether you have the necessary pre-requisites to take this course. Please DO NOT turn in the solutions to this problem set.
Recommended Reading: Material from CS 173, CS 273, and Chapter 0 of Hopcroft, Motwani and Ullman.
Problem 1 Consider the following proof by induction showing “In any set of h horses, all horses have the same color”. For the base case (h = 1), observe that any set containing only one horse clearly satisfies the claim. For the inductive step, let us assume that any set of k horses have the same color. Consider a set H of k + 1 horses. Remove one horse from the set H to get a set H 1 ; by induction hypothesis all horses in H 1 have the same color. Now put the removed horse back in, and remove some other horse from H to obtain set H 2. Once again since H 2 has only k horses, by the inductive hypothesis, all horses in H 2 have the same color. Therefore, all horses in H have the same color. The claim is thus proved by induction. Point out the flaw in this reasoning.
Solution: The base case is clearly correct, so it must be the inductive step which is wrong. Indeed, it is incorrect when k + 1 = 2. In this case, we have a set H of two horses, say {x, y}. Suppose we take out x first, then what remains is H′^ = {y}. Likewise, taking out y leaves H′′^ = {x} behind. Both H′^ and H′′^ are “monochromatic” sets of horses, but it has not been proven that their respective colors are the same. In other words, the inductive step is only correct when the two subsets of horses overlap.
Problem 2 Recall that a number is rational if it can be written as a fraction mn , where m and n are integers. Prove that
2 is not rational.
Solution: For the sake of contradiction, assume that
2 = m/n for integers m, n. Then squaring both sides and rearranging gives 2n^2 = m^2. Since both sides are integers, consider their prime factorization(s). Since n^2 and m^2 are both square numbers, each prime occurs an even number of times in the prime factorization. There is an extra factor of 2 on the left- hand-side (and 2 is prime), so the left-hand-side’s prime factorization has an odd number of factors of 2, while the right-hand-side’s prime factorization has an even number of factors of 2. Since all integers have a unique prime factorization (the fundamental theorem of arithmetic), this is a contradiction. Thus
2 is not rational. Clearly this can also be used to show that for any prime p,
p is irrational.
Problem 3 Recall that a (undirected) graph is 3-regular, if every vertex has degree exactly 3. (We are considering graphs without multiple edges and self loops.) Show that for each even number n ≥ 2, there is a 3-regular graph with n vertices.
Solution: There are probably many constructions, but here is one: For n = 4, the complete graph on 4 vertices is 3-regular (each vertex is connected to the three others). For n ≥ 6, let n = 2k, with k ≥ 3. Let Ck denote the cycle on k vertices, that is, the graph with vertices {v 1 , v 2 , v 3 } and an edges between vi and v(i±1)%k for each i. The graph Ck is clearly 2-regular (we need k ≥ 3 since multiple edges are not allowed). Our 3-regular graph on 2k vertices is simply two copies of Ck with edges between corresponding pairs of vertices from the two cycles. More precisely, Let Ck be the cycle over vertices {a 1 ,... , ak} and let C k′ be the cycle over vertices {b 1 ,... , bk}. We then add the edges {(a 1 , b 1 ),... , (ak, bk)}. This is 3-regular since each vertex has two neighbors in its own cycle, and one neighbor from the opposite cycle.
Problem 4 Let n > 1 be any natural number. Let M be a set of closed intervals. Suppose that the endpoints u, v of each interval [u, v] in M are natural numbers satisfying 1 ≤ u < v ≤ n. In addition, for any two distinct intervals I, I′^ in M , one of the following possibilities occur: either I ∩ I′^ = ∅, or I ⊂ I′ or I′^ ⊂ I; in other words, no two intervals in M partially overlap. Prove that |M | ≤ n − 1, where |M | denotes the number of elements in M.
Solution: We prove the claim by induction on n > 1. When n = 2, the only possible interval is [1, 2], so the claim holds. For the inductive step, consider any set of intervals M as above. M may or may not contain the interval [1, n]. Let M ′^ = M − {[1, n]}. There are several cases:
A = {[u, v] ∈ M ′^ : v < k} B = {[u, v] ∈ M ′^ : u ≥ k}
Clearly A ∪ B ⊆ M ′. Also A ∩ B = ∅, since no interval can have its left endpoint greater than its right endpoint. We would like to show that M ′^ ⊆ A ∪ B, which would imply that A and B partition M ′. Proof of subclaim: Suppose [u, v] ∈ M ′^ is not in A or B. Then v ≥ k and u < k. But then [u, v] must partially intersect with [k, n] ∈ M ′, which is not allowed in our set of intervals. By this contradiction, M ′^ ⊆ A ∪ B. Now all the intervals in A are contained in [1, k − 1], and all the intervals in B are contained in [k, n]. Thus by the inductive hypothesis (translating the intervals in B to be within [1, n − k + 1]), we have |A| ≤ k − 2 and |B| ≤ n − k. This yields |M ′| = |A| + |B| ≤ k − 2 + n − k = n − 2. In both cases |M ′| ≤ n − 2, and since M is equal to M ′^ with perhaps at most one additional interval ([1, n]), |M | ≤ n − 1 as desired.
Problem 5 This problem tests your ability to read and understand definitions. It is not a hard problem.