Discrete Math Exercises
Discrete Math Exercises
Exercises
1. Construct the truth table for
(p q) (q p).
Based on the truth table of this proposition, discuss how you can use the methods of proof
to prove a biconditional statement.
p
t
t
f
f
q
t
f
t
f
pq
t
f
t
t
qp
t
t
f
t
(p q) (q p)
t
f
f
t
To say that a certain biconditional statement p q holds true, it should first be proven (i.e.
by using methods of proof) that both p q and q p are both true.
2. Show that the set of integers, Z , is a subset of the set of rational numbers Q.
... -4 -3 2 1 0 1 2 3 4 5 6 7 8 9 10 ...
Also there will always be one and only one from those three numbers that will be divisible
by 3 (i.e. when r = 0) regardless of its position (first, second or third), as seen from above.
The integer divisible by 3 can be expressed as the product 3k where k Z.
For this, we will have three possible cases:
Case 1: n = 3k, n + 1 = 3k + 1, and n + 2 = 3k + 2.
Multiplying everything we get: 3k(3k + 1)(3k + 2), which is clearly divisible by 3.
Case 2: n = 3k 1, n + 1 = 3k, and n + 2 = 3k + 1
Multiplying everything we get 3k(3k 1)(3k + 1), which is also clearly divisible by 3.
Case 3: n = 3k 2, n + 1 = 3k 1, and n + 2 = 3k.
Multiplying everything we get: 3k(3k 1)(3k 2), which is again, clearly divisible by 3.
This proves that regardless, n Z, n(n + 1)(n + 2) will always be divisible by 3.
4. Prove that the sum of a rational number and an irrational number is irrational.
Proof. We need to show that for R Q and I
/ Q, R + Q
/ Q. First, we assume the
contrary, i.e. R + I Q.
Suppose that S = R + I.
According to Definition 1, we can express R as xy , and S as another ratio, say m
n , where x, y,
m and n are all integers.
Now we have the following expression.
m
x
= +I
n
y
But solving for I, we shall get the following expression,
I=
m x
n
y
which we know will evaluate to a rational number because the set Q is closed under the
operation subtraction.
This contradicts our assumption that I is irrational.
Therefore, we are left to conclude that the sum of a rational number and an irrational number
is indeed irrational.
Case 1: n is even.
If n is even, it can be expressed as 2k for some k Z+ .
By substitution, we get (2k + 2)(2k + 1).
Note that we can factor out 2 from (2k + 2), and that tells us that the result will not be
in any way prime.
Case 2: n is odd.
If n is odd, it can be expressed as 2k + 1 for some k Z+
Likewise, by substitution, we get (2k + 3)(2k + 2).
Similarly, we could factor out 2 from (2k + 2), and the result will certainly be not a
prime number.
All cases considered, we just proved that n Z+ , n2 + 3n + 2 is definitely not prime.
Exercises
1. Generalized Distributive Property of Sets. Show that for all integers n 2, for all sets
A, B1 , B2 , ..., Bn :
A (B1 B2 ... Bn ) = (A B1 ) (A B2 ) ... (A Bn )
Let X = A (B1 B2 ... Bn ) and x X.
In English, this is simply x is in A and in B1 B2 ... Bn , which also means that x is
in A B1 , or in A B2 , or in ..., or in A Bn .
Translating back to set notation, we get: X {x|x (A B1 ) (A B2 ) ...} which
is basically, the set in the right hand side of the equation.
Let Y = (A B1 ) (A B2 ) ... (A Bn )
In English, this is again simply y is in A and B1 , or in A and B2 , or in ..., or in A and
Bn , which also says that y A and in (B1 , or in B2 , ..., or in Bn .
Translating back to set notation, we get Y {y|y A (B1 B2 ... Bn )}.
We have just proven that X, the set on the left-hand side of the equation, and Y, the set
on the right-hand side of the equation are subsets of each other. Thus, the set equality
A (B1 B2 ... Bn ) = (A B1 ) (A B2 ) ... (A Bn ) holds true for all n 2.
2. Generalized De Morgans Law for Logic Expressions. Show that for all integers n 2,
for all proposition p1 , p2 , ..., pn :
(p1 p2 ... pn ) = p1 p2 ... pn
Let X = (p1 p2 ... pn ) and Y = p1 p2 ... pn
For any theorem A = B, if we can show that A B = 0, and that A B = 1, then
by the complement postulates, M M = 0 and M M = 1, A = B.
X = (p1 p2 ...) by Double Negation.
First we prove that X Y is false.
X Y = (p1 p2 ...pn ) (p1 p2 ...pn ) (P1 p2 ...pn )p1 (P1 p2 ...pn )p2 ... by
Distributive Property. (p1 p1 p1 p2 ...)(p1 p2 p2 p2 ...)... by Distributive Property
again.
3
For all propositions joined by the disjunction symbol, there will always be values similar
to p1 p1 . Those values will always be equal to false no matter what because of the
Negation Law. Thus, X Y indeed has a value of false.
Next we prove that X Y is true.
(p1 p2 ...) (p1 p2 ...) as it is given.
(p1 (p1 p2 ...)) (p2 (p1 p2 ...))... simply because (B A) A = (B A) (C A).
By associativity it can be expressed as: (p1 p1 ) (p2 ...pn )....
All the propositions similar to p1 p1 will always evaluate to true and thus the result
of all the propositions conjuncted with that shall be evaluated to true.
Hence, X Y is true.
We already proved that (p1 p2 ... pn ) (p1 p2 ... pn ) is false, and (p1 p2
... pn ) (p1 p2 ... pn ) is true. Thus, (p1 p2 ... pn ) = p1 p2 ... pn
is indeed true.
Exercises
1. Prove or disprove: If a and b are rational numbers, then ab is rational.
Proof.
Let a = 2 and b = 21 . Both numbers are clearly rational.
1
Then ab = a 2 = 2 which clearly cannot be expressed as a ratio of two integers and which
is thus, irrational.
We have presented a case that have just disproved the claim that if a and b are rational
numbers, then ab is rational.
2. Prove that for all integers n, n is either even or odd but not both.
Proof.
Case 1: n is even
If n is even, then it can be expressed as n = 2k for some integer k.
Adding 1 to both sides, we get: (n + 1) = 2k + 1.
By definition, (n + 1) is odd.
Case 2: n is odd
If n is odd, then it can be expressed as n = 2m + 1 for some integer l.
Adding 1 to both sides we get: (n + 1) = (2m + 2).
From this we can factor out 2 and so were left with: (n + 1) = 2(m + 1), which is clearly
even by definition.
Conclusion
We have just arrived to a contradiction, thus for all integers n, n is either even or odd
but not both is not true.
3. Prove that given a real number x, there exists unique numbers n and , such that x = n ,
n is an integer, and 0 < 1.
Proof.
Case 1: x Z
For all x that satisfies the condition for this case, x can clearly be expressed as x = n
where n = x and = 0.
Case 2: x
/Z
For all x that satisfies the condition for this case, x can be expressed as x = dxe (x
bx rf loor) where by definition, dxe is an integer and 0 (x bx rf loor) < 1.
Conclusion
For all possible cases, it is indeed true that given a real number x, there exists unique
numbers n and , such that x = n , n is an integer, and 0 < 1.
Proof.
i. Base case: n = 6
6! > 2(6)3
720 > 432, thus the base case holds true.
ii. Induction step: Assume true for n = k where k 6:
k! > 2k 3
5