You are on page 1of 9

Com S 330 Discrete Computational Structures

Fall Semester 2015


Final Exam

Friday, December 18, 2015


Time: 2 hours

Name:

The exam is closed book. No notes or calculators are allowed. Please go over all
the questions in the exam before you start working on it. Attempt the questions that seem
easier first. The exam has a total of 120 points but you will only be scored over 100 points.
This means that you can get a total of 20 extra credit points. If you see yourself getting
stuck on one question, continue on and come back to it later if you have time. Always explain
your answers! Good luck and have a great winter break!
Note: For the combinatorics questions, leaving answers in the form of P (n, r) or C(n, r)
is not acceptable. You may leave your answer in factorial, product (or sum) form, however,
without multiplying (or adding) all the terms out. Show all intermediate steps.
1. Combinatorial Techniques I [16 Points]
You have 6 friends to whom you want to distribute 20 sugar cookies.

(a) [4 Pts] How many ways can you distribute the cookies?

(b) [8 Pts] What if you need to give (i) at least 4 cookies to Joe and at least 5 cookies
to Sam? (ii) at least 4 cookies to Joe and at most 4 cookies to Sam?

(c) [4 Pts] Suppose you want to make sure that at least one friend gets 5 cookies.
Are 20 cookies enough? How many more would you need and why?

1
2. Combinatorial Techniques II [14 Points]
Consider strings of length 12 over the English alphabet.

(a) [6 Pts] How many strings are there with exactly 4 E’s? exactly 3 S’s?

(b) [4 Pts] How many strings are there with exactly 4 E’s and exactly 3 S’s?

(c) [4 Pts] How many strings are there with exactly 4 E’s or exactly 3 S’s?

2
3. Combinatorial Techniques III [16 Points]

(a) [8 Pts] How many ways can 16 students split up into 4 study groups of size 4 (i)
if each group studies a different topic? (ii) if all groups study the same topic?

(b) [4 Pts] How many ways can 6 equivalent prizes be given to a group of 16 students
if Alice and Bob cannot both get prizes?

(c) [4 Pts] How many ways can 1st through 6th prize winners be chosen from a group
of 16 students if Alice and Bob cannot both get prizes?

3
4. Counting Arguments [14 Points]
Prove that P (n, 4)C(n − 4, k − 4) = C(n, k)P (k, 4), where 4 ≤ k ≤ n.

(a) [6 Pts] using an algebraic argument based on the formulae for C(n, k) and P (n, k).

(b) [8 Pts] using a counting or combinatorial argument.


Hint: Describe a problem that can be counted in two ways, and the lhs and rhs of
the equation gives the two different ways.

4
5. Countable and Uncountable Sets [15 Points]

(a) [6 Pts] Prove that if A is countable and A ∪ B is uncountable,then B is uncount-


able.

(b) [9 Pts] Give an example of uncountable sets A and B such that A − B is


(i) finite, (ii) countably infinite, (iii) uncountably infinite.

5
6. Graph Properties [15 Points]

(a) [7 Pts] Suppose G is a graph with n vertices and n − 1 edges. Is G a tree? If


yes, give a short justification. If no, give a counterexample.

(b) [8 Pts] Prove that if G is a tree, then G is acyclic but adding any edge (v, w) 6∈ E
will create a cycle.

6
7. Recursive Definitions and Induction I [14 Points]
Consider this recursive definition of a complete ternary tree (CTT) of height h.

• A complete ternary tree of height 0 is a single vertex.


• A complete ternary tree of height h+1 is a tree whose root node has three children,
and each child is the root of a subtree which is a complete ternary tree of height
h.

(a) [4 Pts] Give a recursive definition of leaves(T ), the number of leaves in tree T ,
where T is a CTT, as defined above. In other words, define leaves(T ) in terms
of leaves(T1 ), leaves(T2 ) and leaves(T3 ), where T1 , T2 and T3 are the subtrees of
T.
If T is the singleton vertex, leaves(T ) = 1. This is the base case of your definition.

(b) [10 Pts] Now prove, by induction on h, that a CTT of height h has 3h leaves.
Use the recursive definitions above. Justify each step.
i. [4 Pts] First, prove the basis step, where h = 0.

ii. [6 Pts] Then, prove the inductive step.

7
8. Recursive Definitions and Induction II [16 Points]
Consider this recursiive definition for S, a set of ordered pairs of natural numbers.

Base Case: (0, 0) ∈ S.


Recursive Step: if (a, b) ∈ S, then (a, b + 2), (a + 1, b + 1), (a + 2, b) ∈ S.

(a) [8 Pts] Prove, by structural induction, that if (a, b) ∈ S then a + b is divisible by


2.

(b) [8 Pts] Show that if x, y ∈ N , and x + y is divisible by 2, then (x, y) ∈ S.


Hint: Note that, if x + y is divisible by 2, (x, y) is of the form (x, x + 2k) or
(y + 2k, y), where k ∈ N . Show the sequence of recursive steps we could take to
get from (0, 0) to (i) (x, x + 2k), and to (ii) (y + 2k, y).

You might also like