0% found this document useful (0 votes)
20 views

2024 HW1 Sol

This document contains the solutions to homework 1 for a discrete mathematics course due on 2024.3.8. It involves determining the truth values of various conditional statements, whether functions are bijective, using truth tables to show conditional statements are tautologies, and other discrete math problems. The solutions provide concise justifications and explanations for each part of the homework.

Uploaded by

levi74108520963
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

2024 HW1 Sol

This document contains the solutions to homework 1 for a discrete mathematics course due on 2024.3.8. It involves determining the truth values of various conditional statements, whether functions are bijective, using truth tables to show conditional statements are tautologies, and other discrete math problems. The solutions provide concise justifications and explanations for each part of the homework.

Uploaded by

levi74108520963
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Discrete Mathematics: Solutions to Homework 1

Due: 2024.3.8

1. (6%) Determine whether each of these conditional statements is true or false.

(a) If 1 + 1 = 3, then unicorns exist.


(b) If 1 + 1 = 3, then dogs can fly.
(c) If 1 + 1 = 2, then dogs can fly.
(d) If 2 + 2 = 4, then 1 + 2 = 3.

Sol:

(a) This is F → F, which is true.


(b) This is F → F, which is true.
(c) This is T → F, which is false.
(d) This is T → T, which is true.

2. (6%) Determine whether f : Z × Z → Z is onto if

(a) f (m, n) = 2m − n
(b) f (m, n) = m2 − n2
(c) f (m, n) = m + n + 1
(d) f (m, n) = |m| − |n|
(e) f (m, n) = m2 − 4

Sol:

(a) This is clearly onto, since f (0, −n) = n for every integer n.
(b) This is not onto, since, for example, 2 is not in the range. To see this, if
m2 − n2 = (m − n)(m + 2) = 2, then m and n must have the same parity (both
even or both odd). In either case, both m − n and m + n are then even, so this
expression is divisible by 4 and hence cannot equal 2.
(c) This is onto, since f (0, n − 1) = n for every integer n.
(d) This is onto. To achieve negative values we set m = 0, and to achieve nonneg-
ative values we set n = 0.
(e) This is not onto, for the same reason as in part (b).

3. (6%) Consider the proposition “Alice will win the game only if she plays by the
rules.”

(a) Restate this proposition in English in two different equivalent ways.


(b) State the converse of this proposition.
(c) State the contrapositive of this proposition.
(d) Suppose that Alice plays by the rules but loses. Determine with justification
whether the original proposition is true or false.

Sol:

(a) If Alice wins the game she plays by the rules. Playing by the rules in necessary
for Alice to win the game. Winning the game is a sufficient condition for having
played by the rules.
(b) If Alice plays by the rules, then she will win the game.
(c) If Alice doesn’t play by the rules, then she won’t win the game.
(d) It is true,since the hypothesis is false and the conclusion is true.

4. (6%) Determine whether each of these functions is a bijection from R to R.

(a) f (x) = −3x + 4


(b) f (x) = −3x2 + 7
(c) f (x) = (x + 1)/(x + 2)
(d) f (x) = x5 + 1

Sol:

(a) This is a bijection since the inverse function is f −1 (x) = (4 − x)/3.


(b) This is not one-to-one since f (17) = f (−17), for instance. It is also not onto,
since the range is the interval (−∞, 7]. For example, 42548 is not int he range.
(c) This function is a bijection, but not from R to R. To see that the domain and
range are not R, note that x = −2 is not in the domain, and f (x) = 1 is not in
the range. On the other hand, f is a bijection from R−{−2} to R−{1}, since
its inverse is f −1 (x) = (1 − 2x)/(x − 1)
(d) It is clear that this continuous function is increasing throughout its entire do-
main (R) and it takes on both arbitrarily large values and arbitrarily small

(large negative) ones. So it is a bijection. Its inverse is clearly f −1 (x) = 5 x − 1.

5. (8%) Show that each of these conditional statements is tautology by using truth
tables.

(a) [(p → q) ∧ (q → r)] → (p → r)


(b) [(p ∨ q) ∧ (p → r) ∧ (q → r)] → r

Sol:
p q r p→q q→r p→r (p→q)∧(q→r) [(p→q)∧(q→r)]→(p→r)
T T T T T T T T
T T F T F F F T
T F T F T T F T
(a) T F F F T F F T
F T T T T T T T
F T F T F T F T
F F T T T T T T
F F F T T T T T
p q r p∨q p→r q→r (p∨q)∧(p→r)∧(q→r) [(p∨q)∧(p→r)∧(q→r)]→r
T T T T T T T T
T T F T F F F T
T F T T T T T T
(b) T F F T F T F T
F T T T T T T T
F T F T T F F T
F F T F T T F T
F F F F T T F T

6. (8%) Show that each of these conditional statements is a tautology without using
truth tables.
(a) [⇁p ∧ (p ∨ q)] → q
(b) [p ∧ (p → q)] → q

Sol:

(a) aaa
[⇁p ∧ (p ∨ q)] → q

≡ ⇁[⇁p ∧ (p ∨ q)] ∨ q by rule (11)

≡ [p∨(⇁p ∧ ⇁q)] ∨ q by De Morgan’s law

≡ (p ∨ q) ∨ (⇁p ∧ ⇁q) by communicative and associate laws

≡ (p ∨ q) ∨ [⇁(p ∨ q)] by De Morgan’s law

≡T

Hence, this statement is a tautology.


(b) aaa
[p ∧ (p → q)] → q

≡ [p ∧ (⇁p ∨ q)] → q by rule (11)

≡ [(p ∧ ⇁p) ∨ (p ∧ q))] → q by distributed law

≡ [F ∨ (p ∧ q)] → q

≡ (p ∧ q) → q

≡ ⇁(p ∧ q) ∨ q by rule (11)

≡ (⇁p ∨ ⇁q) ∨ q by De Morgan’s law

≡ ⇁p ∨ (⇁q ∨ q)

≡ ⇁p ∨ T

≡T

Hence, this statement is a tautology.

7. (8%) Show that the polynomial function Z+ ×Z+ →Z+ with f (m, n) = (m + n −
2)(m + n − 1)/2 + m is one-to-one and onto.
Sol: f (1, 1) = 1 f (2, 1) = 3 f (3, 1) = 6 f (4, 1) = 10 f (5, 1) = 15
f (6, 1) = 21
f (1, 2) = 2 f (2, 2) = 5 f (3, 2) = 9 f (4, 2) = 14 f (5, 2) = 20 f (6, 2) = 27
f (1, 3) = 4 f (2, 3) = 8 f (3, 3) = 13 f (4, 3) = 19 f (5, 3) = 26
f (1, 4) = 7 f (2, 4) = 12 f (3, 4) = 18 f (4, 4) = 25
f (1, 5) = 11 f (2, 5) = 17 f (3, 5) = 24
f (1, 6) = 16 f (2, 6) = 23
f (1, 7) = 22
We see by looking at the diagonals of this table that the function takes on suc-
cessive values as m + n increases. When m + n = 2, f (m, n) = 1. When m + n = 3,
f (m, n) takes on the values 2 and 3. When m + n = 4, f (m, n) takes on the values
4, 5, and 6. And so on. It is clear from the formula that the range of values the
(x−2)(x−1)
function takes on for a fixed value of m + n, say m + n = x, is 2
+ 1 through
(x−2)(x−1)
2
+ (x − 1), since m can assume the values 1,2,3,..., (x − 1) under these
conditions, and the first term in the formula is a fixed positive integer when m + n
is fixed. To show that this function is one-to-one and onto, we merely need to show
that the range of values for x + 1 picks up precisely where the range of values for x
left off, i.e., that f (x − 1, 1) + 1 = f (1, x). We compute:

(x − 2)(x − 1) x2 − x + 2 (x − 1)x
f (x − 1, 1) + 1 = + (x − 1) + 1 = = + 1 = f (1, x)
2 2 2

8. (10%) Determine the truth value of each of these statements if the domain consists
of all real numbers.

(a) (3%) ∃x(x2 = 2)


(b) (2%) ∃x(x2 = −1)
(c) (3%) ∀x(x2 + 2 ≥ 1)
(d) (2%) ∀x(x2 ̸= x)

Sol:
√ 2
(a) T. Since 2 = 2.
(b) F. The two roots are complex.
(c) T. Since x2 + 2 ⩾ 0 + 2 ⩾ 1 for ∀x ∈ R.
(d) F. Counterexample: x = 0 or x = 1.

9. (8%) Show that the set Z+ ×Z+ is countable.


Sol: Z+ is countable
Z+ × Z+ is the Cartesian product of Z+ and Z+
We can list the tuples in the following array as below

(1,1) (1,2)-(1,3) (1,4)-· · ·


| / / / /
(2,1) (2,2) (2,3)· · ·
/ /
(3,1) (3,2)· · ·
| /
(4,1)· · ·
..
.
Then we can trace the array with diagonal zigzag to generate a sequence as below.
(1,1),(2,1),(1,2),(1,3),(2,2),(3,1),(4,1),(3,2),(2,3),(1,4),· · ·
Since all the tuples are listed once, we have shown that Z+ × Z+ is countable.

10. (8%) Determine the truth value of each of these statements if the domain consists
of all real numbers.

(a) ∀x∃y(x2 = y)
(b) ∀x∃y(x = y 2 )
(c) ∃x∀y(xy = 0)
(d) ∃x∃y(x + y ̸= y + x)
(e) ∀x(x ̸= 0 → ∃y(xy = 1))
(f) ∃x∀y(xy = 1)
(g) ∀x∃y(x + y = 1)
(h) ∃x∃y(x + 2y = 2 ∧ 2x + 4y = 5)
(i) ∀x∃y(x + y = 2 ∧ 2x − y = 1)
(j) ∀x∀y∃z(z = (x + y)/2)

Sol:

(a) T. (let y = x2 )
(b) F. (no such y exists if x is negative)
(c) T. (let x = 0)
(d) F. (the commutative law for addition always holds)
(e) T. (let y = 1/x)
(f) F. (the reciprocal of y depends on y - there is not one x that works for all y)
(g) T. (let y = 1 − x)
(h) F. (this system of equations is inconsistent)
(i) F. (this system has only one solution; if x = 0, for example then no y satisfies
y = 2 ∧ −y = 1)
(j) T. (let z = (x + y)/2)

11. (8%) Let P (x, y) be a propositional function. Show that ∃x∀yP (x, y)→∀y∃xP (x, y)
is a tautology.
Sol: Let us assume the hypothesis. This means that there is some x0 such that
P (x0 , y) holds for all y. Then it is certainly true for all y there exists an x such that
P (x, y) is true, since in each case we can take x = x0 .

12. (8%) Are these system specifications consistent? “The router can send packets to the
edge system only if it supports the new address space. For the router to support the
new address space, it is necessary that the latest software release be installed. The
router can send packets to the edge system if the latest software release is installed.
The router does not support the new address space.”
Sol:
Let s be “The router can send packets to the edge system"; let a be “The router
supports the new address space”; let r be “The latest software release is installed."
Then we are told s → a, a → r, r → s, and ¬ a. Since a is false, the first
conditional statement tells us that s must be false. From that we deduce from the
third conditional statement that r must be false. If indeed all three propositions are
false, then all four specifications are true, so they are consistent.
13. (10%) Determine which of the following compound propositions are logically equiv-
alent. P,Q,P(X), and Q(X) are propositions or propositional functions.

(a) (3%) (⇁Q → ⇁P) and (⇁P ∨ Q)


(b) (2%) ⇁∃xP (X) and ∀x⇁P (X)
(c) (3%) ∀x∃y(P(x)∨Q(y)) and ∃y∀x(P(x) ∨ Q(y))
(d) (2%) ⇁(P ↔ Q) and P ↔ ⇁Q

Sol:

(a) T
(b) T
(c) F
(d) T

Extra Exercises:

1. Construct a truth table for each of these compound propositions.

(a) p ⊕ ⇁p
(b) ⇁p ⊕ ⇁q
(c) (p ⊕ q) ∧ (p ⊕ ⇁q)

Sol:
p ⇁p p⊕⇁p
(a) T F T
F T T
p ⇁p q ⇁q ⇁p⊕⇁q
T F T F F
(b) T F F T T
F T T F T
F T F T F
p q ⇁q p⊕q p⊕⇁q (p⊕q) ∧ (p⊕⇁q)
T T F F T F
(c) T F T T F F
F T F T F F
F F T F T F

2. Determine whether these statements are true or false.

(a) ϕ ∈ {ϕ}
(b) ϕ ∈ {ϕ, {ϕ}}
(c) {ϕ} ∈ {ϕ}
(d) {ϕ} ∈ {{ϕ}}
(e) {ϕ} ⊂ {ϕ, {ϕ}}
(f) {{ϕ}} ⊂ {ϕ, {ϕ}}
(g) {{ϕ}} ⊂ {{ϕ}, {ϕ}}

Sol:

(a) true.
(b) true.
(c) false- see part (a).
(d) true.
(e) true- the one element in the set on the left is an element of the set on the right,
and the sets are not equal.
(f) true- similar to part (e).
(g) false- the two sets are equal.

3. Show that if A and B are sets, A is uncountable, and A ⊆ B, then B is uncountable.

Sol: Suppose that B were countable, say with elements b1 , b2 , .... Then since A ⊆ B,
we can list the elements of A using the order in which they appear in this listing of
B. Therefore A is countable, contradicting the hypothesis. Thus B is not countable.
4. Determine whether each of these functions from Z to Z is one-to-one.

(a) f (n) = n − 1
(b) f (n) = n2 + 1
(c) f (n) = n3
(d) f (n) = ⌈n/2⌉

Sol:

(a) This is one-to-one, since if n1 − 1 = n2 − 1, then n1 = n2 .


(b) This is not one-to-one, since, for example, f (3) = f (−3) = 10.
(c) This is one-to-one, since if n31 = n32 , then n1 = n2 (take the cube root of each
side).
(d) This is not one-to-one, since, for example, f (3) = f (4) = 2.

5. Prove the first De Morgan law by showing that if A and B are sets, A ∪ B = A ∩ B.
Sol: A ∪ B = {x|x ∈
/ A ∪ B}
= {x|¬(x ∈ (A ∪ B))}
= {x|¬(x ∈ A ∨ x ∈ B)}
= {x|¬(x ∈ A) ∧ ¬(x ∈ B)}
= {x|x ∈
/ A∧x∈
/ B}
= {x|x ∈ A ∧ x ∈ B}
= {x|x ∈ A ∩ B} = A ∩ B

6. Find f ◦g and g ◦f , where f (x) = x2 +1 and g(x) = x+2, are functions from R to R.

Sol: We have (f ◦ g)(x) = f (g(x)) = f (x + 2) = (x + 2)2 + 1 = x2 + 4x + 5, whereas


(g ◦ f )(x) = g(f (x)) = g(x2 + 1) = x2 + 1 + 2 = x2 + 3. Note that they are not
equal.

7. Let p, q, and r be the propositions


p : You get an A on the final exam.
q : You do every exercise in this book.
r : You get an A in this class.
Write these propositions using p, q, and r and logical connectives (including nega-
tions).

(a) (1%) You get an A in this class, but you do not do every exercise in this book.
(b) (1%) You get an A on the final, you do every exercise in this book, and you get
an A in this class.
(c) (2%) To get an A in this class, it is necessary for you to get an A on the final.
(d) (2%) You get an A on the final, but you don’t do every exercise in this book;
nevertheless, you get an A in this class.
(e) (2%) Getting an A on the final and doing every exercise in this book is sufficient
for getting an A in this class.
(f) (2%) You will get an A in this class if and only if you either do every exercise
in this book or you get an A on the final.

Sol:

(a) r ∧ ¬q
(b) p ∧ q ∧ r
(c) p ⇒ r
(d) p ∧ ¬q ∧ r
This sentence is a triple conjunction. The nevertheless in this sentence can be
thought of as another ’and’.
(e) (p ∧ q) ⇒ r
(f) r ⇐⇒ (p ∨ q)
Pn
8. (a) Show that j=1 (aj − aj−1 ) = an − a0 , where a0 , a1 , · · · , an is a sequence of real
numbers. This type of sum is called telescoping.
Pn
(b) Use the identity 1/(k(k+1)) = 1/k−1/(k+1) and (a) to compute k=1 1/(k(k+
1)).
Sol:
(a) We can write out this summation as:
(a1 − a0 ) + (a2 − a1 ) + (a3 − a2 ) + · · · + (an−1 − an−2 ) + (an − an−1 )
Notice what we can cancel out a1 and −a1 , a2 and −a2 all the way up to an−1
and −an−1 . This leaves us with −a0 and an , which is an − a0 .
(b) Assume that,
1/(k(k + 1)) = 1/k − 1/(k + 1) · · · · · · (1)
Pn
j=1 (aj − aj−1 ) = an − a0 = (aj )j=n − (aj−1 )j=1 · · · · · · (2)
Consider,
Pn Pn
k=1 1/(k(k + 1)) = k=1 (1/k − 1/(k + 1)) · · · · · · From(1)
Pn
= k=1 −(1/(k + 1) − 1/k)
= − nk=1 (1/(k + 1) − 1/k)
P

= −(1/(n + 1) − 1/1) · · · · · · From(2)


= −1/(n + 1) + 1
= 1 − 1/(n + 1)
= ((n + 1) − 1)/(n + 1)
= n/(n + 1)

9. Show that the set of real numbers that are solutions of quadratic equations ax2 +
bx + c = 0, where a, b, and c are integers, is countable.
Sol: There are at most two real solutions of each quadratic equation, so the number
of solutions is countable as long as the number of triples (a, b, c), with a, b, and
c integers, is countable. But this follows from 2.5 Exercise 27 in the following
way. There are a countable number of pairs (b, c), since for each b (and there are
countably many b’s) there are only a countable number of pairs with that b as its
first coordinate. Now for each a (and there are countably many a’s) there are only a
countable number of triples with that a as its first coordinate (since we just showed
that there are only a countable number of pairs (b, c)). Thus again by 2.5 Exercise
27 there are only countably many triples.
Exercise 27 Sol: Since empty sets do not contribute any elements to unions, we can
assume that none of the sets in our given countable collection of countable sets is
the empty set. If there are no sets in the collection, then the union is empty and
therefore countable. Otherwise let the countable sets be A1 , A2 , . . .. (If there are
only a finite number k of them, then we can still assume that they form an infinite
sequence by taking Ak+1 = Ak+2 = . . . = A1 .) Since each set Ai is countable and
nonempty, we can list its elements in a sequence as ai1 , ai2 , . . .; again, if the set
is finite we can list its elements and then list ai1 repeatedly to assure an infinite
sequence. Now we just need a systematic way to put all the elements aij into a
sequence. We do this by listing first all the elements aij in which i + j = 2 (there is
only one such pair, (1, 1)), then all the elements in which i + j = 3 (there are only
two such pairs, (1, 2) and (2, 1)), and so on; except that we do not list any element
that we have already listed. So, assuming that these elements are distinct, our list
starts a11 , a12 , a21 , a13 , a22 , a31 , a14 , . . . (If any of these terms duplicates a previous
term, then it is simply omitted.) The result of this process will be either an infinite
sequence or a finite sequence containing all the elements of the union of the sets Ai .
Thus that union is countable.

You might also like