You are on page 1of 4

NAME and NIA: 1 2 3 4 5 6 7 8 9 TOTAL

Discrete Mathematics
FINAL EXAM 2017–2018

Write your answers filling in the blanks. If for some reason (for example, if after you
have written the solution you realize that there is some mistake that you would like to
correct) you can attach an extra sheet to your exam. In this case, indicate clearly, that
the solution can be found in the extra sheet. Also, you may use other sheets to perform
your calculations. You can use the results we have seen in theory sessions without providing
a proof, unless it is requested.

Problem 1 1 point
Prove the sequent: Determine if each of the following statements is true or false
where the universe of discourse consists of all real numbers.
p ∨ ¬q ` ¬p → ¬q Justify your answer.

Solution: (a) ∀x∃y(x + y = 2 ∧ 2x − y = 1) Solution: This statement


is false. In order to show this will be sufficient to find a
1. p ∨ ¬q premise counter-example. Supose, e.g., that x = 0. Then, the
2. p assumption first equality says us that y = 2 and the second one
3. ¬p assumption says us that y = −1. This is not possible. Then, for
x = 0 there’nt exist any real number y satisfying the
4. ⊥ ¬e 2, 3 two given equations simultaneously. It is interesting to
5. ¬q ⊥e 4 observe that the sentence ∃x∃y(x + y = 2 ∧ 2x − y = 1)
6. ¬p → ¬q →i 3 − 5 is true, due to the fact that the equations x + y = 2
and 2x − y = 1 are satisfied by the values x = 1 and
7. ¬q assumption
y = 1.
8. ¬p assumption
9. ¬q copy of 7 (b) ∀x∀y∃z(x − y + 2z = 0) Solution: This statement is
10. ¬p → ¬q →i 8 − 9 true. In order to show that, given two arbitrary real
y−x
11. ¬p → ¬q ∨e 1, 2 − 6, 7 − 10 numbers x and y, we prove that the number z =
2
satisfies the given equality. Indeed,
An alternative solution:
y−x
1. p ∨ ¬q premise x − y + 2z = x − y + 2 · = x − y + y − x = 0.
2
2. ¬p assumption
y−x
3. p assumption Observe that the number is also a real number,
2
4. ⊥ ¬e 2, 3 and that it is well defined.
5. ¬q ⊥e 4
6. ¬q assumption Typical mistakes:
7. ¬q copy of 6 • To show that an universal statement about a con-
8. ¬q ∨e 1, 3 − 5, 6 − 7 crete kind of objects is false it is sufficient to give a
counter-example, that is, an object non satisfying
9. ¬p → ¬q →i 2 − 8 the statement.
Typical mistake: • To show that a statement about a concrete kind
of objects is true it is not sufficient two give some
• To use different rules that the ones included in the
examples satisfying the statement. It is necessary
basic deductive calculus. These derived rules are also
to give a general proof of the statement.
allowed: modus tollens (MT), reductio ad absurdum
(RAA), and the law of the excluded middle (LEM).
But laws as, for instance, the De Morgan laws, are not
allowed. Problem 3 1 point
Consider the following (dubious) theorem.
Theorem?. Suppose that m is a even integer and n is an
Problem 2 1 point odd integer. Then n2 − m2 = n + m.
(a) What’s wrong with the following proof of the theorem? Let f (n) = n2 − 7n + 12. Prove, using induction, that
Proof: Since m is even, we can choose some integer k f (n) ≥ 0 for every n ≥ 3.
such that m = 2k. Similarly, since n is odd we have
n = 2k + 1. Therefore Solution: Base case. We have that f (3) = 32 − 7 · 3 + 12 = 0
is nonnegative.
n2 − m2 = (2k + 1)2 − (2k)2 = 4k 2 + 4k + 1 − 4k 2 Inductive case. Let k ≥ 0. We can assume by inductive
= 4k + 1 = (2k + 1) + (2k) = m + n hypothesis that f (k) ≥ 0. We shall prove that f (k + 1) ≥ 0.
We have
(b) Is the theorem correct? Justify your answer with eit- f (k + 1) = (k + 1)2 − 7(k + 1) + 12
her a proof or a counterexample.
= k 2 + 2k + 1 − 7k − 7 + 12
Solution: = k 2 − 7k + 12 + 2k − 6 = f (k) + 2k − 6

(a) The alleged proof is incorrect. For, both m and n de- By induction hypotehsis we know that f (k) ≥ 0. Further-
pend on the same arbitrary integer variable k (in fact, in the more, if k ≥ 3 then 2k ≥ 6 and, hence, 2k − 6 ≥ 0. Since the
proof, m and n are consecutive integers). Instead, two dif- sum of two nonnegative numbers is nonnegative it follows
ferent arbitrary integer variables k, and k 0 should have been that f (k + 1) ≥ 0.
considered.

(b) The ”theorem” is false. Consider the assignments Typical mistakes:


n := 3 and m := 0. It follows that n2 − m2 = 32 − 02 = 9
and n + m = 3 + 0 = 0. Hence, the aforementioned theorem • The proof although has captured the main idea has
is false. failed to explained it correctly. Very often the proof
contains formulas without any explanation forcing the
Typical mistakes: In (a), some students have not explai- reader to guess what the author has in mind.
ned why the proof is incorrect. Instead, they have provided • The proof (of one of its parts) generalizes from a few
a counterexample. examples. For example, it proves than f (3) ≥ 0,
f (4) ≥ 0 and concludes that the same must be true
Problem 4 1 point for the rest of numbers.

Prove that there is a unique set A such that for every set B, • The proof, although it might have the shape of an in-
A ∪ B = B. duction proof, does not really use induction. Usually,
the student finds the roots f (n) and reasons from there
Solution: Let us prove the following proposition: like in calculus.

∃!A ∀B A ∪ B = B (?) Problem 6 1 point


Let X be the set of integers defined recursively in the fo-
Proof : llowing way:

(a) Existence: Consider A := ∅. By the Identity law • Base case: 4, 7 ∈ X


the above equation is satisfied (see Section 1.7 Rosen
• Recursive case: If a, b ∈ X then ab ∈ X.
(Fifth edition)).
Prove that for every element x ∈ X, x ≡ 1 (mod 3).
(b) Uniqueness: Let A0 be another set satisfying (?), i.e.
the Identity law. It follows that:
Solution: Let us prove it by structural induction.
A0 = ∅ ∪ A0 (?) applied to ∅ Base case. Since 3 = 3 + 1 and 7 = 2 · 3 + 1 it follows
= A0 ∪ ∅ by commutativity that 4 and 7 are congruent with 1 modulo 3.
= ∅ (?) applied to A0 Inductive case. Let x be any element in X and assume
that it has obtained by multiplying a and b where a and b
Whence A0 = ∅. This proves the uniqueness. were elements that were added previously to X. By ind-
cutive hypothesis we can assume that a ≡ 1 (mod 3) and
Typical mistakes: b ≡ 1 (mod 3). Then ab ≡ 1 · 1 (mod 3).
• In general, students have rightly considered the empty
set as solution of (?), but they have not understood Typical mistakes:
what means proving the uniqueness of the set A in the
proposition (?). • The proof although has captured the main idea has
failed to explained it correctly. Very often the proof
• In general, almost no student has invoked the Identity contains formulas without any explanation forcing the
law for the empty set. Remark: it was not necessary reader to guess what the author has in mind.
to provide a proof of the Identity law.
• The proof shows that the property is satisfied by just
a few elements from X (usually 4, 7, and 28).

• The student has not understood well the notion of


Problem 5 1 point structural induction.
Problem 7 2 points • Refer to the ” length of the graph”, rather than
Determine, for each one of the following conditions, whether to the length of the cycle.
there exists a graph that satisfies it. If such graph exists, • Require that the ”graph is even”, rather than re-
describe it. If not, prove that it cannot exist. quiring an even number of nodes.
(a) A digraph with exactly 5 nodes, where each node has • Refer to ”separated nodes”, rather than to subsets
outdegree at least 3, which is weakly connected but of nodes.
not strongly connected.
F
(b) A forest with exactly 9 nodes, 8 edges, and two con-
nected components.
D G
(c) A bipartite graph with exactly 9 nodes that has a ha-
miltonian cycle.
B E I
(d) A rooted ordered binary tree such that that when
we visit its nodes in inorder we obtain the se-
quence A, B, C, D, E, F, G, H, I, J and when we vi- (d) A C H J
sit them in postorder we obtain the sequence
A, C, B, E, D, H, J, I, G, F .
A repeated mistake:
Solution:
• Do not specify whether I is the left/right child of
(a) Yes, for instance: G.
v0

v1 v4 Problem 8 1 point:
For every n ≥ 3 let Gn be the graph with nodes
v2 v3
{c, v0 , v1 , . . . , vn−1 } that contains

• for every i, j ∈ {0, . . . , n − 1} such that j ≡ i +


Typical mistakes: 1 (mod n) or i ≡ j + 1 (mod n) the edge {vi , vj },
and
• Do not distinguish between directed and undirec-
ted graph, leaving out the concept of outdegree. • for every i ∈ {0, . . . , n − 1}, the edge {c, vi }.
• Provide a solution without specifying the directi-
on of the edges. (a) Draw G3 and G4 .
• Use the handshaking lemma for undirected Solution:
graphs.
• Do not distinguish between weak and strong con- The graph G3 is: The graph G4 is:
nectivity. v0
v0 v3

(b) By definition, a forest is a graph where each connected


component is a tree. A tree with n nodes has n − 1 c c
edges. A graph composed of 9 nodes and 8 edges is
a tree by definition, i.e., it has only one connected
v1 v2 v1 v2
commponent. Therefore, such graph cannot exist.

Typical mistakes:

• The concept of connected component is exchan- (b) Indicate, for every n ≥ 3, which is the chromatic num-
ged with the concept of node/vertex or a graph. ber of Gn . Justify your answer.
• Assume that the 2 connected components are con-
(Note that in order to solve this problem you must unders-
nected with one another (thus, ignoring the fact
tand well the definition of graph Gn )
that the graph is a forest), and draw a tree as a
Solution:
solution.
For every n ≥ 3, if n is odd, then the cromatic number
(c) A cycle x0 , x1 , · · · , xk , x0 of a graph G is hamiltoni- of Gn is K = 4.
an if it contains all the vertices of G. Let x0 , · · · , x8 Otherwise, if n is even, then the cromatic number of Gn
denote the vertices of the bipartite graph, and let is K = 3.
x0 , x1 , · · · , x8 , x0 , be a hamiltonian cycle in G. No-
te that the cycle is of length 9. However, a bipartite
graph has by definition no cycles of odd length. The- Problem 9 1.5 points
refore, we conclude that such graph cannot exist. (Note: In this exercise, it is not necessary to compute the
result. Instead you can just give an arithmetic expression
Typical mistakes: such as for example 23! + 45!
12! )
9 9! 9!

(a) A company has 38 mathematicians, and 23 econo- number: 3,2,2,1,1 = 3!2!2!1!1! = 24 .
mists, and 17 computer scientists. How many ways
are there to select 12 members to serve on a committee Typical mistake:
if 3 must be mathematicians, 4 must be economists,
and the rest must be computer scientists. • To use permutation (9!) instead of multinomial
Solution: Since the order in which we take the peo- numbers, which menas that the fact that some
ple is not relevant and a person can not serve twice letters are repeated is not take into account.
as a member (no repetition), the problem is solved
through combination. The result is obtained by mul- (c) How many different words can be obtained from the
tiplying 38

3 (which corresponds to the ways to choose letters in AARKDBARK, using all the letters, if all
3 mathematicians out of 38), 23

4 (which corresponds the As must appear consecutively?
to the ways to choose 4 economists out of 23), and 17

5
Solution: Since all the As must appear consecutively,
(which corresponds to the ways  23to
 choose 5 computer the solution is equal to the total number of ordering
scientists out of 17). So: 38 17 38!23!17!

3 · 4 · 5 = 3!35!4!19!5!12! .
the block AAA and the rest of the letters. This is:
using AAA once as a unique symbol, R and K twice,
Typical mistakes: and D and B also once. This equals to the number
of different permutations of 7 objects, where there is
• To use a wrong formula for the combinations. one AAA, 2 indistinguishable Rs and Ks, a D, and
• To sum de three individual elements instead of a B, computed by the following multinomial number:
7 7! 7!

multiplying them. 1,2,2,1,1 = 1!2!2!1!1! = 4 .

Typical mistakes:
(b) How many different words can be obtained from the
letters in AARKDBARK, using all the letters? • To use permutation (7!) instead of multinomial
Solution: The solution is equal to ordering the letters numbers, which menas that the fact that some
ARKDB by using A three times, R and K twice, letters are repeated is not take into account.
and D and B once. That is, the number of different • To use 9 positions instead of 7. Since AAA acts
permutations of 9 objects, where there are 3 indis- now as a single block, it is like having 7 symbols
tinguishable As, 2 indistinguishable Rs and Ks, a D (AAA, R, K, D, B, R, K) instead of 9.
and a B. This results in the following multinomial

You might also like