Calendar Months - Discrete Mathematics - Exam Key, Exams of Discrete Mathematics

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

2012/2013

Uploaded on 02/21/2013

radhatanaya
radhatanaya 🇮🇳

5

(1)

39 documents

1 / 13

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
SIMON FRASER UNIVERSITY
DEPARTMENT OF MATHEMATICS
Final Exam Solutions
MACM 201 Spring 2007
Instructor: Robert ˇ
amal
April 11, 2007, 8:30 11:30
[10] 1. Suppose everyone can choose one of the 12 calendar months to take their holidays. If
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 Sbe 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 cibe property of elements of S: “the i-th months is not assigned to
anyone”, that is
fsatisfies ciiff 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 Sthat satisfy
at least one of the conditions ci, that is we want to find |S| N(c1c2. . . c12 ).
First, N=|S|= 1230. Further, for any k= 1,2,...,12,N(c1c2. . . ck) = (12 k)30, moreover
the same is true for any choice of kconditions among c1,..., c12 . Thus we have Sk=12
k(12k)30.
By the Principle of Inclusion and Exclusion we find the answer
S1S2+S3 · · · +S11 S12 =
12
X
k=1 12
k(12 k)30(1)k+1 .
This is, by the way, about 64% of all 1230 possibilities (however this numerical result was not asked
for).
pf3
pf4
pf5
pf8
pf9
pfa
pfd

Partial preview of the text

Download Calendar Months - Discrete Mathematics - Exam Key and more Exams Discrete Mathematics in PDF only on Docsity!

SIMON FRASER UNIVERSITY

DEPARTMENT OF MATHEMATICS

Final Exam – Solutions

MACM 201 Spring 2007 Instructor: Robert ˇS´amal April 11, 2007, 8:30 – 11:

[10] 1. Suppose everyone can choose one of the 12 calendar months to take their holidays. If

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

S 1 − S 2 + S 3 − · · · + S 11 − S 12 =

∑^12

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

2. We say a word W contains a word W ′^ if W ′^ is included in W without gaps: e.g., the

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

  • c 1 iff W contains VAN,
  • c 2 iff W contains AD,
  • c 3 iff W contains TEN, and
  • c 4 iff W contains RED.

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

  • S 0 = N = |S| = 9!/ 2 (permutations with repetitions)
  • To find all words containing VAN, we permute one ‘object’ VAN, 2 letters E and 4 more (pairwise distinct) letters. So, N(c 1 ) = (1 + 2 + 4)!/2 = 7!/ 2
  • By similar argument, N(c 2 ) = 8!/ 2 , and N(c 3 ) = N(c 4 ) = 7!.
  • Thus, S 1 = N(c 1 ) + N(c 2 ) + N(c 3 ) + N(c 4 ) = 7!/2 + 8!/2 + 2 · 7!.
  • No word contains both VAN and AD (there are not enough A’s). Hence N(c 1 c 2 ) = 0, similarly N(c 1 c 3 ) = N(c 2 c 4 ) = 0. For counting N(c 1 c 4 ) we permute two ‘objects’ VAN and RED, and 3 more letters (T, U, and E), thus N(c 1 c 4 ) = 5!. Similarly, N(c 2 c 3 ) = 6!, and N(c 3 c 4 ) = 5!.
  • So, S 2 = N(c 1 c 2 )+N(c 1 c 3 )+N(c 1 c 4 )+N(c 2 c 3 )+N(c 2 c 4 )+N(c 3 c 4 ) = 0 +0 +5!+6!+0 +5!.
  • No word satisfies more then two of the conditions, hence S 3 = S 4 = 0 (as N(c 1 c 2 ) = N(c 1 c 3 ) = N(c 2 c 4 ) = 0).

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

[10] 4. How many ways are there to pay 20 dollars in 25-cent, 1-dollar, and 2-dollar coins? Use

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

[10] 5. Solve the following recurrence relation

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

[5] 7. (a) Recall that for n ≥ 1 the n-dimensional hypercube is the graph Qn = (V, E), where

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!

  • Every vertex of Qn has degree n: A vertex v = (v 1 , v 2 ,... , vn) is connected to the following vertices: vi^ = (v 1 , v 2 ,... , vi− 1 , 1 − vi, vi+1,... , vn) (for every i = 1, 2 ,... , n).
  • Each of the graphs Qn is connected: every vertex is connected to (0, 0 ,... , 0) by a path of length at most n (we change the nonzero coordinates to 0, one at a time).

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.

[10] 8. Are the following graphs planar? If yes, draw the graph without crossing, if not, explain

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.

[4] 9. (a) For the rooted tree on the figure, determine the labels of the vertices according to

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

  1. Pick as e 1 any of the edges of the minimum weight (weight 1), e.g. e 1 = bi.
  2. Pick as e 2 any of the remaining edges of the minimum weight, e.g. e 2 = cj (and make sure we are not creating a cycle).
  3. Pick as e 3 any of the remaining of the minimum weight, e.g. e 3 = ci.

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.