







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
This is the Exam Key of Discrete Mathematics which includes Standard Deck, Cards Contains, Cards Numbered, Numbered Card Appears, Spades, Hearts, Diamonds, Clubs,, Probability etc. Key important points are: Calendar Months, Included, Reordering, Adventure, Least Two, Fifty Different Books, Five Bookshelves, Same Topic, New Positions, Same Shelf
Typology: Exams
1 / 13
This page cannot be seen from the preview
Don't miss anything!








MACM 201 Spring 2007 Instructor: Robert ˇS´amal April 11, 2007, 8:30 – 11:
each person in a group of 30 does this, how many ways will there be so that there is at least 1 month when none of them will be taking holidays? Let S be the set of all possible assignments of months to people— we can represent this as functions, that is S =
f : { 1 , 2 ,... , 30 } → { 1 , 2 ,... , 12 }
For each i = 1,... , 12 we let ci be property of elements of S: “the i-th months is not assigned to anyone”, that is f satisfies ci iff for every x = 1,... , 30 we have f (x) 6 = i.
We will use the Principle of Inclusion and Exclusion to find the number of elements of S that satisfy at least one of the conditions ci, that is we want to find |S| − N( c 1 c 2... c 12 ). First, N = |S| = 12^30. Further, for any k = 1, 2 ,... , 12 , N(c 1 c 2... ck) = (12 − k)^30 , moreover the same is true for any choice of k conditions among c 1 ,... , c 12. Thus we have Sk =
k
(12 − k)^30. By the Principle of Inclusion and Exclusion we find the answer
k=
k
(12 − k)^30 (−1)k+^.
This is, by the way, about 64% of all 1230 possibilities (however this numerical result was not asked for).
word KAYAK contains YAK but not KYK. Consider all words obtained by reordering the letters of the word ADVENTURE. How many of these words contain
[5] (a) none of the words VAN, AD, TEN, RED? Let S consist of all permutations of the letters of the word ADVENTURE, let a word W satisfy
We will use the Principle of Inclusion and Exclusion to find the number of elements of S that satisfy none of the conditions ci. For this, we will need
Consequently, we obtain the answer
N( c 1 c 2 c 3 c 4 ) = S 0 − S 1 + S 2 − S 3 + S 4 = 9!/ 2 − (7!/2 + 8!/2 + 2 · 7!) + (2 · 5! + 6!).
(The numerical value is 149640: about 82% of all 9!/ 2 possibilities.)
[5] (b) at least two of those words? By the generalized version of the Principle of Inclusion and Exclusion, this is L 2 = S 2 − 2 S 3 + 3S 4 , but as S 3 = S 4 = 0, we have just L 2 = S 2 = 2 · 5! + 6!. (Which is 960.)
generating functions! (You don’t need to find a numerical answer, a simple formula involving factorials, binomial coefficients, etc. is fine.) Let us denote the number of quarters, loonies, and toonies by a, b, and c. We are looking for a, b, and c such that a/4 + b + 2c = 20, or
a + 4b + 8c = 80.
This means, we are interested in the following quantity
[x^80 ](1 + x + · · · )(1 + x^4 + · · · )(1 + x^8 + · · · ) = [x^80 ] 1 1 − x
1 − x^4
1 − x^8 = [x^80 ](1 +^ x^ +^ x
(^2) + · · · + x (^7) )(1 + x (^4) ) (1 − x^8 )^3 = [x^80 ]1 +^ · · ·^ +^ x
(^8) + · · · + x 11 (1 − x^8 )^3 = [x^80 ] (^) (1 −^1 x (^8) ) 3 + [x^72 ] (^) (1 −^1 x (^8) ) 3
=
(We have used the binomial theorem and standard methods to modify a generating function. The numerical answer was optional.)
an+2 − 5 an+1 + 6an = 2n + 1 (n ≥ 0), a 0 = 0, a 1 = 0.
The characteristic equation is t^2 − 5 t + 6 = 0, its roots are t 1 = 2, t 2 = 3. So, the general homogeneous solution is of form a( nh ) = A 2 n^ + B 3 n. We will look for a particular solution in the form a( np )= Cn + D (C, D suitable constants). Plugging in the recurrence relation we obtain
C(n + 2) + D − 5(C(n + 1) + D) + 6(Cn + D) = 2n + 1
A simple (in fact, the only) way how to satify this equation for every n is solving a system of two equations
n(C − 5 C + 6C) = 2n 2 C + D − 5 C − 5 D + 6D = 1
This gives us C = 1, D = 2. We’ve found a( np ) = n + 2. So the general solution is an = a( nh )+ a( np )= A 2 n^ + B 3 n^ + n + 2. To determine A and B we put n = 0 and n = 1:
0 = a 0 = A + B + 2 0 = a 1 = 2A + 3B + 3
this gives A = − 3 and B = 1. Altogether, we found that
an = − 3 · 2 n^ + 3n^ + n + 2 (n ≥ 0).
V = { 0 , 1 }n, and for x, y ∈ V , we have {x, y} ∈ E if and only if x and y differ in exactly one coordinate. For which integers n does Qn have an Euler circuit? Explain!
By a theorem from class it follows, that Qn has an Euler circuit, if and only if n is even.
[5] (b) For which integers n does Qn have a Hamilton cycle? Explain! If n = 1, then Qn ≃ K 2 does not have a Hamilton cycle. If n = 2, then Qn ≃ C 4 does have a Hamilton cycle. By induction we prove that the same is true for every n ≥ 2. We already know it for n = 2, so we only need to show that Qn+1 has a Hamilton cycle, assuming that Qn does. To do so, pick any Hamilton cycle v 1 , v 2 ,... , v 2 n^ in Qn. Now recall that Qn+1 consists of two copies of Qn plus some edges between. In particular, all edges {vi 0 , vi+1 0 } and {vi 1 , vi+1 1 } are present in Qn+1 (these edges form copies of the chosen cycle, with one edge omitted). After adding edges {v 10 , v 11 } and {v 2 n^0 , v 2 n^1 } we obtain a Hamilton cycle in Qn+1.
why not. [2 marks for each graph]
A
B
A
A
B
B The graph is not planar: this is K 3 , 3 , which we discussed in class.
The graph is planar.
the universal address system. 0
(^1 2 )
1.1 (^) 1.2 1.3 3.
1.2.1 1.3.1 (^) 1.3.
3.2 3.
3.3.1 (^) 3.3.2 3.3.
[2] (b) Construct the binary rooted tree for the following arithmetic expression:
(2 + 3 ∗ 4)/(5 ∗ (7 + 3) + 14) /
2 ∗
3 4 5
7
∗
3
14
[2] (c) Use the postorder traversal to write the expression in the postfix notation. 2, 3, 4, ∗, +, 5, 7, 3, +, ∗, 14, +, /
[2] (d) Use the preorder traversal to write the expression in the prefix notation. /,+,2,∗,3,4,+,∗,5,+,7,3,
[5] (b) Apply Kruskal’s algorithm to the following graph. Determine the minimal possible sum of the weights of the edges of a spanning tree and draw an example of a tree that achieves this. Also, label the edges by e 1 ,... , e 9 in the order you analyze them in the algorithm and explain in detail the first three steps of the algorithm.
a
b c
d
e
f
h
g
i
j
1
2
4
3 1 1 2 2 3
3
1
1
5
7
4
2
4
(^44)
1
e 1 e (^3) e 2
e 4
e 5
e 6
e 7
e 8
e 9
The weight of the found tree (or of any other minimal spanning tree) is 18. There are several optimal trees and several labelings of edges. In each of them, however edges e 1 ,
... , e 4 are of weight 1, e 5 , e 6 , e 7 of weight 2, e 8 = hg or ig, e 9 = cd.