Download Final Examination on Discrete Mathematics 1. (3%) How many ways

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Dual graph wikipedia , lookup

Centrality wikipedia , lookup

Signal-flow graph wikipedia , lookup

Transcript
Final Examination on Discrete Mathematics
1. (3%) How many ways are there to arrange the letters a, b, c, and d such that a is
not followed immediately by b?
Sol:
4! − 3! = 18
2. (7%) How many numbers must be selected from the set {1, 2, 3, 4, 5, 6} to guarantee
that at least one pair of these numbers add up to 7?
Sol:
We can apply the pigeonhole principle by grouping the numbers cleverly into pairs
that add up to 7, namely {1, 6}, {2, 5}, {3, 4}. If we select four numbers from the
set {1, 2, 3, 4, 5, 6}, then at least two of them must fall within the same subset, since
there are only three subsets. Two numbers in the same subsets are the desired pair
that add up to 7. We also need to point out that choosing three numbers is not
enough since we could choose {1, 2, 3}, and no pair of them add up to more than 5.
3. (6%) How many permutations of the letters ABCDEF GH contain the strings CAB
and BED?
Sol:
If both CAB and BED are substrings, then CABED has to be a substring. So we
are really just permuting four items: CABED, F, G, and H. Therefore the answer
= 4! = 24.
4. (10%) Give a combinatorial proof that
∑n
k=1
k(nk ) = n2n−1 . [Hint: Count in two
ways the number of ways to select a committee and to then select a leader of the
committee.]
Sol:
We will follow the hint and count the number of ways to choose a committee with
leader from a set of n people. Note that the size of the committee is not specified,
although it clearly needs to have at least one person (its leader). On the other hand,
we can choose the leader first, in any of n ways. We can then choose the rest of the
committee, which can be any set of the remaining n − 1 people; this can be done
in 2n−1 ways since there are this many subsets. Therefore the right-hand side of
the proposed identity counts this. On the other hand, we can organize our count
by the size of the committee. Let k be the number of people who will serve on the
committee. The number of ways to select a committee with k people is clearly (nk ),
and once we have chosen the committee, there are clearly k ways in which to choose
its leader. By the sum rule the left-hand side of the proposed identity therefore also
counts the number of such committees. Since the two sides count the same quantity,
they must be equal.
5. (3%) How many bit strings of length 10 either start with 000 or end with 1111?
Sol:
27 + 26 − 23 = 184
6. (6 %) How many ways are there to assign six different jobs to five different employees
if every employee is assigned at least one job?
Sol:
56 − 46 (51 ) + 36 (52 ) − 26 (53 ) + 16 (54 ) = 1800
7. (11%) A string that contains only 0s, 1s, and 2s is called a ternary string.
(a) Find a recurrence relation for the number of ternary strings that do not contain
two consecutive 0s. (7%)
(b) What are the initial conditions ? (1%)
(c) How many ternary strings of length six contain two consecutive 0s? (3%)
Sol:
(a) Let an be the number of ternary strings of length n that do not contain two
consecutive 0s. In order to construct a bit string of length n of this type, we
could start with a 1 or 2 and follow with a string of length n − 1 not containing
two consecutive 0’s, or we could start with 01 or 02 and follow with a string
of length n − 2 not containing two consecutive 0’s. Consequently, we have the
recurrence relation: an = 2an−1 + 2an−2 .
(b) a0 = 0 (for the empty string), a1 = 3 (all three strings of length 1 fail to contain
two consecutive 0’s).
(c) We could compute a2 through a6 using the recurrence relation:
a2 = 2a1 + 2a0 = 8;
a3 = 2a2 + 2a1 = 22;
a4 = 2a3 + 2a2 = 60;
a5 = 2a4 + 2a3 = 164;
a6 = 2a5 + 2a4 = 448;
And there are total 36 = 729 distinct strings of length-6, so the answer is
729 − 448 = 281.
8. (7%) Consider the nonhomogeneous linear recurrence relation an = 3an−1 + 2n .
Please find the solution with a0 = 1.
Sol:
The corresponding homogeneous relation is an = 3an−1 . From its characteristic
equation r − 3 = 0, we have r = 3. Thus, the general solution of an = 3an−1 is
an = α3n .
It can be checked that −2n+1 is a particular solution of the nonhomogeneous linear
recurrence relation an = 3an−1 + 2n . Thus the general solution of the nonhomogeneous linear recurrence relation can be written as α3n − 2n+1 . By the initial
condition a0 = 1, we have α = 3. Thus, the answer is 3n+1 − 2n+1 .
9. (6%)
(a) What is the generating function for {ak }, where ak is the number of solutions
of x1 + x2 + x3 = k when x1 , x2 , x3 and x4 are integers with x1 ≥ 2, 0 ≤ x2 ≤ 3,
and 2 ≤ x3 ≤ 5? (4%)
(b) Use your answer to part (a) to find a6 (2%)
Sol:
(a) (x2 + x3 + x4 + ...)(1 + x + x2 + x3 )(x2 + x3 + x4 + x5 ). We can use algebra to rewrite
it in closed form as x4 (1 + x + x2 + x3 )2 /(1 − x).
(b) We want the coefficient of x6 in this series, and the answer is 1 + 2 + 3 = 6.
10. (12%) How many vertices and how many edges do each of the following graphs
have? Please also determine which graphs are regular?
(a) The complete graph on 5 vertices, i.e., K5 .
(b) The cycle on 4 vertices, i.e., C4 .
(c) The wheel on 5 vertices, i.e., W5 .
(d) The complete bipartite graph, i.e., K2,5 .
Sol:
(a) K5 has 5 vertices and 10 edges. And it is a regular graph.
(b) C4 has 4 vertices and 4 edges. And it is a regular graph.
(c) W5 has 6 vertices and 10 edges. And it is not a regular graph.
(d) K2,5 has 7 vertices and 10 edges. And it is not a regular graph.
11. (6%) Is the following graph bipartite? Justify your answer.
Sol:
The graph is bipartite. The vertex set can be partitioned into {a, c, e} and {b, d, f }.
12. (5%) Decide wether the graphs G and H are isomorphic. Prove that your answer
is correct.
Sol:
These graphs are not isomorphic, since G contains a subgraph isomorphic to K3 but H does
not. (In fact, H is bipartite.)
13. (6%) Determine whether the given pair of graphs is isomorphic. Exhibit an isomorphism or provide a rigorous argument that none exists.
Sol:
These two graphs are isomorphic. One can see this visually-just imagine “moving′′ vertices u1 and u4 into the inside of the rectangle, thereby obtaining the picture on the
right. Formally, one isomorphism is f (u1 ) = v5 , f (u2 ) = v2 , f (u3 ) = v3 , f (u4 ) =
v6 , f (u5 ) = v4 , f (u6 ) = v1 .
14. (7%) Find the number of paths of length 4 between two different vertices in K4 .
Sol:

0 1 1 1



 1 0 1 1 

A=


1
1
0
1


1 1 1 0
Let the path be denoted 1, x, y, z, 2. If x = 3, then there are 7 choices for y and z.
Similarly if x = 4. If x = 2, then y and z can be any two distinct members of
{1, 3, 4}, and there are P(3, 2) = 6 ways to choose them. Therefore there are 7 +
7 + 6 = 20 possibilities in all.
15. (5%) Can a simple graph exist with 15 vertices each of degree five? Please give
your reason.
Sol:
By Theorem 2 of Sec 9.2 the number of vertices of odd degree must be even. Hence
there cannot be a graph with 15 vertices of odd degree 5.