Lecture Notes in Discrete Mathematics - Part 5
Lecture Notes in Discrete Mathematics - Part 5
Marcel B. Finan
Arkansas Tech University
All
c Rights Reserved
4 PROPOSITIONS AND QUANTIFIERS 35
Example 4.6
Let P (x) denote the statement ”x > 3.” What is the truth value of the
proposition ∃x ∈ IR, P (x).
Solution.
Since 4 ∈ IR and 4 > 3, the given proposition is true
Example 4.7
Rewrite the proposition ”if a real number is an integer then it is a rational
number” as a universal conditional proposition.
Solution.
∀x ∈ IR, if x is an interger then x is a rational number
Example 4.8
a. What is the negation of the proposition ∀x ∈ D, P (x)?
b. What is the negation of the proposition ∃x ∈ D, P (x)?
c. What is the negation of the proposition ∀x ∈ D, P (x) → Q(x)?
Solution.
a. ∃x ∈ D, ∼ P (x).
b. ∀x ∈ D, ∼ P (x).
c. Since P (x) → Q(x) ≡ (∼ P (x)) ∨ Q(x) then ∼ (∀x ∈ D, P (x) → Q(x)) ≡
∃x ∈ D, P (x) and ∼ Q(x)
Example 4.9
Consider the universal conditional proposition
Solution.
a. ∀x ∈ D, if ∼ Q(x) then ∼ P (x).
b. ∀x ∈ D, if Q(x) then P (x).
c. ∀x ∈ D, if ∼ P (x) then ∼ Q(x)
Example 4.10
Write the negation of each of the following propositions:
Solution.
a. ∃x ∈ IR, x > 3 and x2 ≤ 9.
b. There exists a polynomial that is not continuous everywhere.
c. For any triangle, the sum of the angles is less than or equal to 180◦
Example 4.11
a. Let P (x, y) denote the statement ”x + y = y + x.” What is the truth value
of the proposition (∀x ∈ IR)(∀y ∈ IR), P (x, y)?
b. Let Q(x, y) denote the statement ”x + y = 0.” What is the truth value of
the proposition (∃y ∈ IR)(∀x ∈ IR), Q(x, y)?
Solution.
a. The given proposition is always true.
b. The proposition is false. For otherwise, one can choose x 6= −y to obtain
0 6= x + y = 0 which is impossible
Example 4.12
Find the negation of the following propositions:
a. ∀x∃y, P (x, y).
b. ∃x∀y, P (x, y).
4 PROPOSITIONS AND QUANTIFIERS 37
Solution.
a. ∃x∀y, ∼ P (x, y).
b. ∀x∃y, ∼ P (x, y)
Example 4.13
The symbol ∃! stands for the phrase ”there exists a unique”. Which of the
following statements are true and which are false.
Solution.
a. True. Let x = 1.
b. False since 1 and −1 are both integers with integer reciprocals
38 FUNDAMENTALS OF MATHEMATICAL LOGIC
Review Problems
Problem 4.1
By finding a counterexample, show that the proposition:” For all positive
integers n and m, m.n ≥ m + n” is false.
Problem 4.2
Consider the statement
∃x ∈ IR such that x2 = 2.
Problem 4.3
Rewrite the following propositions informally in at least two different ways
without using the symbols ∃ and ∀ :
a. ∀ squares x, x is a rectangle.
b. ∃ a set A such that A has 16 subsets.
Problem 4.4
Rewrite each of the following statements in the form ”∃ x such that ”:
Problem 4.5
Rewrite each of the following statements in the form ”∀ , if then .”:
Problem 4.6
Which of the following is a negation for ”Every polynomial function is con-
tinuous”?
Problem 4.12
Given the proposition: ∀x ∈ IR, ∃ a real number y such that x + y = 0.
a. Rewrite this proposition in English without the use of the quantifiers.
b. Find the negation of the given proposition.
Problem 4.13
Given the proposition: ∃x ∈ IR, ∀y ∈ IR, x + y = 0.
a. Rewrite this proposition in English without the use of the quantifiers.
b. Find the negation of the given proposition.
Problem 4.14
Consider the proposition ”Somebody is older than everybody.” Rewrite this
proposition in the form ”∃ a person x such that ∀ .”
Problem 4.15
Given the proposition: There exists a program that gives the correct answer
to every question that is posed to it.”
a. Rewrite this proposition using quantifiers and variables.
b. Find a negation for the given proposition.
Problem 4.16
Given the proposition: ∀x ∈ IR, ∃y ∈ IR such that x < y.
a. Write a proposition by interchanging the symbols ∀ and ∃.
b. State which is true: the given proposition, the one in part (a), neither, or
both.
Problem 4.17
Find the contrapositive, converse, and inverse of the proposition ”∀x ∈ IR, if
x(x + 1) > 0 then x > 0 or x < −1.”
Problem 4.18
Rewrite the following proposition in if-then form :” Earning a grade of C −
in this course is a sufficient condition for it to count toward graduation.”
Problem 4.19
Rewrite the following proposition in if-then form :” Being on time each day
is a necessary condition for keeping this job.”
Problem 4.20
Rewrite the following proposition without using the words ”necessary” or ”
sufficient” : ”Divisibility by 4 is not a necessary condition for divisibility by
2.”
5 ARGUMENTS WITH QUANTIFIED PREMISES 41
Example 5.1
Use universal instantiation to fill in valid conclusion for the following argu-
ment.
Solution.
All positive integers are greater than or equal to 1
3 is a positive integer
..˙ 3 ≥ 1
Example 5.2
Use the rule of the universal modus ponens to fill in valid conclusion for the
following argument.
Solution.
∀n ∈ IN, if n = 2k for some k ∈ IN then n is even.
42 FUNDAMENTALS OF MATHEMATICAL LOGIC
0 = 2.0
..0
˙ is even
Example 5.3
Use the rule of the universal modus tonens to fill in valid conclusion for the
following argument.
Solution.
All healthy people eat an apple a day.
Harry does not eat an apple a day.
..˙ Harry is not healthy
Example 5.4
What kind of error does the following invalid argument exhibit?
Solution.
This invalid argument exhibits the converse error
5 ARGUMENTS WITH QUANTIFIED PREMISES 43
Example 5.5
What kind of error does the following invalid argument exhibit?
Solution.
This invalid argument exhibits the inverse error
44 FUNDAMENTALS OF MATHEMATICAL LOGIC
Review Problems
Problem 5.1
Use the rule of universal modus ponens to fill in valid conclusion for the ar-
gument.
Problem 6.1
Construct the truth tables of the gates discussed in this section.
If you are given a set of input signals for a circuit, you can find its output
by tracing through the circuit gate by gate.
Problem 6.2
Give the output signal S for the following circuit, given that P = 0, Q = 1,
and R = 0 :
Problem 6.3
Write the input/output table for the circuit of the previous problem.
Problem 6.4
Find the Boolean expression that corresponds to the circuit of Problem 6.1.
Problem 6.5
Construct the circuit corresponding to the Boolean expression: (P ∧ Q)∨ ∼
R.
Problem 6.6
For the following input/output table, construct (a) the corresponding Boolean
expression and (b) the corresponding circuit:
P Q R S
1 1 1 0
1 1 0 1
1 0 1 0
1 0 0 0
0 1 1 1
0 1 0 0
0 0 1 0
0 0 0 0
Two digital logic circuits are equivalent if, and only if, their corresponding
Boolean expressions are logically equivalent.
Problem 6.7
Show that the following two circuits are equivalent:
Problem 6.8
Consider the following circuit
48 FUNDAMENTALS OF MATHEMATICAL LOGIC
Let P and Q be single binary digits and P + Q = RS. Complete the fol-
lowing table
P Q R S
1 1
1 0
0 1
0 0
The given circuit is called a half-adder. It computes the sum of two single
binary digits.
Several methods have been used for expressing negative numbers in the com-
puter. The most obvious way is to convert the number to binary and stick
on another bit to indicate sign, 0 for positive and 1 for negative. Suppose
that integers are stored using this signed-magnitude technique in 8 bits so
that the leftmost bit holds the sign while the remaining bits represent the
magnitude. Thus, +4110 = 00101001 and −4110 = 10101001.
The above procedure has a gap. How one would represent the bit 0? Well,
there are two ways for storing 0. One way is 00000000 which represents
+0 and a second way 10000000 represents −0. A method for representing
numbers that avoid this problem is called the two’s complement. Con-
sidering −4110 again, first, convert the absolute value to binary obtaining
4110 = 00101001. Then take the complement of each bit obtaining 11010110.
This is called the one complement of 41. To complete the procedure, in-
crement by 1 the one’s complement to obtain −4110 = 11010111.
Conversion of +4110 to two’s complement consists merely of expressing the
number in binary, i.e. +4110 = 00101001.
6 PROJECT I: DIGITAL LOGIC DESIGN 49
Problem 6.9
Express the numbers 104 and −104 in two’s complement representation with
8 bits.
Problem 6.10
What is the decimal representation for the integer with two’s complement
10101001?
50 FUNDAMENTALS OF MATHEMATICAL LOGIC
For example,
n = bk bk−1 · · · b1 b0 ,
where bi is either 0 or 1.
Problem 7.1
Find the decimal value of the following binary numbers:
a. 11001012
b. 1101102
7 PROJECT II: NUMBER SYSTEMS 51
n10 = rk rk−1 · · · r1 r0 .
Problem 7.2
Represent the following decimal integers in binary notation:
a. 129710
b. 45810
Problem 7.3
Evaluate the following sums:
a. 110111012 + 10010110102
b. 1011012 + 111012
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
where A, B, C, D, E, F stand for 10, 11, 12, 13, 14, and 15 respectively.
The conversion of a number from base 16 to base 10 is similar to the conver-
sion of numbers from base 2 to base 10. The conversion of a number from
base 10 to base 16 is similar to the conversion of a decimal number to base
2.
Problem 7.4
Convert the number A2BC16 to base 10.
Problem 7.5
Convert the number B53DF 816 to base 2.
Problem 7.6
Convert the number 1011011110001012 to base 16.
Fundamentals of Mathematical
Proofs
In this chapter we discuss some common methods of proof and the standard
terminology that accompanies them.
Example 8.1
The Euclidean geometry furnishes an example of mathematical system:
• points and lines are examples of undefined terms.
• An example of a definition: Two angles are supplementary if the sum of
their measures is 180◦ .
• An example of an axiom: Given two distinct points, there is exactly one
line that contains them.
• An example of a theorem: If two sides of a triangle are equal, then the
angles opposite them are equal.
• An example of a corollary: If a triangle is equilateral, then it is equiangular.
53
54 FUNDAMENTALS OF MATHEMATICAL PROOFS
First we discuss methods for proving a theorem of the form ”∃x such that
P (x).” This theorem guarantees the existence of at least one x for which the
predicate P (x) is true. The proof of such a theorem is constructive: that
is, the proof is either by finding a particular x that makes P (x) true or by
exhibiting an algorithm for finding x.
Example 8.2
Show that there exists a positive integer which can be written as the sum of
the squares of two numbers.
Solution.
Indeed, one example is 52 = 32 + 42
Example 8.3
Show that there exists an integer x such that x2 = 15, 129.
Solution.
Applying the well-known algorithm of extracting the square root we find that
x = 123
Theorems are often of the form ”∀x ∈ D if P (x) then Q(x).” We call P (x)
the hypothesis and Q(x) the conclusion.
Example 8.4
Show that for each integer 1 ≤ n ≤ 10, n2 − n + 11 is a prime number.
Solution.
The given proposition can be written in the form ”∀n ∈ IN, if 1 ≤ n ≤ 10
8 METHODS OF DIRECT PROOF I 55
The most powerful technique for proving a universal proposition is one that
works regardless of the size of the domain over which the proposition is
quantified. It is called the method of generalizing from the generic
particular.
The method consists of picking an arbitrary element x of the domain (known
as a generic element) for which the hypothesis P (x) is satisfied, and then
using definitions, previously established results, and the rules of inference to
conclude that Q(x) is also true.
By a direct method of proof we mean a method that consists of showing
that if P (x) is true for x ∈ D then Q(x) is also true.
Theorem 8.1
For all n, m ∈ Z , if m and n are even then so is m + n.
Proof.
Let m and n be two even integers. Then there exist integers k1 and k2 such
that n = 2k1 and m = 2k2 . We must show that m + n is even, that is, an
integer multiple of 2. Indeed,
m + n = 2k1 + 2k2
= 2(k1 + k2 )
= 2k
Example 8.5
Prove the following theorem.
Solution.
n
Proof. Let n be an arbitrary integer. Then n = 1
. By the definition of
rational numbers, n is rational
Theorem 8.2
If a, b ∈ Q
I then a + b ∈ Q.
I
Proof.
Let a and b be two rational numbers. Then there exist integers a1 , a2 , b1 6= 0,
and b2 6= 0 such that a = ab11 and b = ab22 . By the property of addition of two
fractions we have
a + b = ab11 + ab22
= a1 bb21+a
b2
2 b1
Proof.
Let a = b in the previous theorem we see that 2a = a + a = a + b ∈ Q
I
Next, we point out of some common mistakes that must be avoided in prov-
ing theorems.
• Using the same letters to mean two different things. For example, sup-
pose that m and n are any two given even integers. Then by writing m = 2k
and n = 2k this would imply that m = n which is inconsistent with the
statement that m and n are arbitrary.
conclusion.
• Begging the question. By that we mean that the author of a proof uses in
his argument a fact that he is supposed to prove.
Example 8.6
Disprove the proposition ∀a, b ∈ IR, if a < b then a2 < b2 .
Solution.
A counterexample is the following. Let a = −2 and b = −1. Then a < b but
a2 > b 2
58 FUNDAMENTALS OF MATHEMATICAL PROOFS
Review Problems
A real number r is called rational if there exist two integers a and b 6= 0
such that r = ab . A real number that is not rational is called irrational.
Problem 8.1
Show that the number r = 6.321521521... is a rational number.
Problem 8.2
Prove the following theorem.
Problem 8.3
Use the previous exercise to prove the following.
Problem 8.4
Use the method of constructive proof to show that if r and s are two real
numbers then there exists a real number x such that r < x < s.
Problem 8.5
The following Pascal program segment does not find the minimum value in
a data set of N integers. Find a counterexample.
MINN := 0;
FOR I := 1 TO N DO
BEGIN
READLN (A);
If A < MINN THEN MINN := A
END
9 MORE METHODS OF PROOF 59
Example 9.1
Use the method of vacuous proof to show that if x ∈ ∅ then David is playing
pool.
Solution.
Since the proposition x ∈ ∅ is always false, the given proposition is vacuously
true
Example 9.2
Use the method of trivial proof to show that if n is an even integer then n is
divisible by 1.
Solution.
Since the proposition n is divisible by 1 is always true, the given implication
is trivially true
Example 9.3
Show that if n is a positive integer then n3 + n is even.
Solution.
We use the method of proof by cases.
Example 9.4
Use the proof by cases to prove the triangle inequality: |x + y| ≤ |x| + |y|.
Solution.
Case 1. x ≥ 0 and y ≥ 0. Then x + y ≥ 0 and so |x + y| = x + y = |x| + |y|.
Case 2. x ≥ 0 and y < 0. Then x + y < x + 0 < |x| ≤ |x| + |y|. On the
other hand, −(x + y) = −x + (−y) ≤ 0 + (−y) = |y| ≤ |x| + |y|. Thus,
if |x + y| = x + y then |x + y| < |x| + |y| and if |x + y| = −(x + y) then
|x + y| ≤ |x| + |y|.
Case 3. The case x < 0 and y ≥ 0 is similar to case 2.
Case 4. Suppose x < 0 and y < 0. Then x + y < 0 and therefore |x + y| =
−(x + y) = (−x) + (−y) = |x| + |y|.
So in all four cases |x + y| ≤ |x| + |y|.
Now, given a real number x. The largest integer n such that n ≤ x < n + 1
is called the floor of x and is denoted by bxc. The smallest integer n such
that n − 1 < x ≤ n is called the ceiling of x and is denoted by dxe.
Example 9.5
Compute bxc and dxe of the following values of x :
a. 37.999 b. − 57
2
c. −14.001
Solution.
a. b37.999c = 37, d37.999e = 38.
b. b− 57
2
c = −29, d− 57
2
e = −28.
c. b−14.001c = −15, d−14.001e = −14.
Example 9.6
Use the proof by a counterexample to show that the proposition ”∀x, y ∈
IR, bx + yc = bxc + byc” is false.
Solution.
Let x = y = 0.5. Then bx + yc = 1 and bxc + byc = 0
Proof.
Let n be any integer. Then we consider the following two cases.
n n−1
b c=k= .
2 2
Case 2. Suppose n is even. Then there is an integer k such that n = 2k.
Hence, b n2 c = bkc = k = n2 .
62 FUNDAMENTALS OF MATHEMATICAL PROOFS
Review Problems
Problem 9.1
Prove that for any integer n the product n(n + 1) is even.
Problem 9.2
Prove that the square of any integer has the form 4k or 4k + 1 for some
integer k
Problem 9.3
Prove that for any integer n, n(n2 − 1)(n + 2) is divisible by 4.
Theorem 9.2
Given any nonnegative integer n and a positive integer d there exist integers
q and r such that n = dq + r and 0 ≤ r < d. The number q is called the
quotient of the division of n by d and we write q = n div d. The number r
is called the remainder and we write r = n mod d or n ≡ r(mod d).
Proof.
The proof uses the fact that any nonempty subset of IN has a smallest ele-
ment. So let S = {n − d · k ∈ IN : k ∈ Z }. This set is nonempty. Indeed, if
n ∈ IN then n = n−0·d ≥ 0 and if n < 0 then n−d·n = n·(1−d) ≥ 0. Thus,
S is a nonempty subset of IN so it has a smallest elements, called r. That is,
there is an integer q such that n − d · q = r or n = d · q + r. It remains to show
that r < d. Suppose the contrary, i.e. r ≥ d. Then n − d · (q + 1) = r − d ≥ 0
so that n − d · (q + 1) ∈ S. Hence, r ≤ n − d · (q + 1) = r − d, a contradiction.
Hence, r < d
dq ≤ n < dq + d.
Problem 9.4
State a necessary and sufficient condition for the floor function of a real
number to equal that number
Problem 9.5
Prove that if n is an even integer then b n2 c = n2 .
Problem 9.6
Show that the equality bx − yc = bxc − byc is not valid for all real numbers
x and y.
Problem 9.7
Show that the equality dx + ye = dxe + dye is not valid for all real numbers
x and y.
Problem 9.8
Prove that for all real numbers x and all integers m, dx + me = dxe + m.
Problem 9.9
Show that if n is an odd integer then d n2 e = n+1
2
.
64 FUNDAMENTALS OF MATHEMATICAL PROOFS
Theorem 10.1
If n2 is an even integer so is n.
Proof.
Suppose the contrary. That is suppose that n is odd. Then there is an integer
k such that n = 2k + 1. In this case, n2 = 2(2k 2 + 2k) + 1 is odd and this
contradicts the assumption that n2 is even. Hence, n must be even
Theorem 10.2
√
The number 2 is irrational.
Proof. √
Suppose not. That is, suppose that 2 is rational. Then √ there exist two
integers m and n with no common divisors such that 2 = m n
. Squaring
2 2 2
both sides of this equality we find that 2n = m . Thus, m is even. By
Theorem 10.1, m is even. That is, 2 divides m. But then m = 2k for some
integer k. Taking the square we find that 2n2 = m2 = 4k 2 , that is n2 = 2k 2 .
This says that n2 is even and by Theorem 10.1, n is even. We conclude that
2 divides both m and n and this contradcits
√ our assumption that m and n
have no common divisors. Hence, 2 must be irrational
Theorem 10.3
The set of prime numbers is infinite.
10 METHODS OF INDIRECT PROOFS: CONTRADICTION AND CONTRAPOSITION65
Proof.
Suppose not. That is, suppose that the set of prime numbers is finite. Then
these prime numbers can be listed, say, p1 , p2 , · · · , pn . Now, consider the inte-
ger N = p1 p2 · · · pn +1. By the Unique Factorization Theorem, ( See Exercise
??) N can be factored into primes. Thus, there is a prime number pi such
that pi |N. But since pi |p1 p2 · · · pn then pi |(N − p1 p2 · · · pn ) = 1, a contradic-
tion since pi > 1.
Theorem 10.4
If n is an integer such that n2 is odd then n is also odd.
Proof.
Suppose that n is an integer that is even. Then there exists an integer k such
that n = 2k. But then n2 = 2(2k 2 ) which is even.
66 FUNDAMENTALS OF MATHEMATICAL PROOFS
Review Problems
Problem 10.1
Use the proof by contradiction to prove the proposition ”There is no greatest
even integer.”
Problem 10.2
Prove by contradiction that the difference of any rational number and any
irrational number is irrational.
Problem 10.3
Use the proof by contraposition to show that if a product of two positive real
numbers is greater than 100, then at least one of the numbers is greater than
10.
Problem 10.4
Use the proof by contradiction to show that the product of any nonzero
rational number and any irrational number is irrational.
11 METHOD OF PROOF BY INDUCTION 67
F OR I := 1 T O N DO
If you want to verify that the loop does something regardless of the particular
integral value of N, you need mathematical induction.
Also, sums of the form
n
X n(n + 1)
k=
k=1
2
are very useful in analysis of algorithms and a proof of this formula is math-
ematical induction.
Next we examine this method. We want to prove that some predicate P (n)
is true for any nonnegative integer n ≥ n0 . The steps of mathematical induc-
tion are as follows:
Example 11.1
Use the technique of mathematical induction to show that
n(n + 1)
1 + 2 + 3 + ··· + n = , n ≥ 1.
2
Solution.
Let S(n) = 1 + 2 + · · · + n. Then
(i) (Basis of induction) S(1) = 1 = 1(1+1)
2
. That is, S(1)is true.
n(n+1)
(ii) (Induction hypothesis) Assume S(n) is true. That is, S(n) = 2
.
68 FUNDAMENTALS OF MATHEMATICAL PROOFS
(n+1)(n+2)
(iii) (Induction step) We must show that S(n + 1) = 2
. Indeed,
S(n + 1) = 1 + 2 + · · · + n + (n + 1)
= S(n) + (n + 1)
n(n+1)
= 2
+ (n + 1)
(n+1)(n+2)
= 2
Solution.
a. We use the method of proof by mathematical induction.
(i) (Basis of induction) S(0) = a = 0k=0 ark . That is, S(1)is true.P
P
(ii) (Induction hypothesis) Assume S(n) is true. That is, S(n) = nk=0 ark .
n+2 )
(iii) (Induction step) We must show that S(n + 1) = a(1−r1−r
. Indeed,
Pn+1 k
S(n + 1) = k=0 ar
= S(n) + arn+1
n+1
= a 1−r
1−r
1−r
+ arn+1 1−r
n+1 n+1 −r n+2
= a 1−r +r 1−r
n+2
= a 1−r
1−r
.
b. By a. we have
1−( 12 )n
1 + 12 + 1
22
+ ··· + 1
2n−1
= 1− 12
= 2(1 − ( 12 )n )
1
= 2 − 2n−1
≤ 2.
Solution.
We use the method of proof by mathematical induction.
11 METHOD OF PROOF BY INDUCTION 69
(i) (Basis of induction) S(1) = a = 12 [2a + (1 − 1)r]. That is, S(1)is true.
(ii) (Induction hypothesis) Assume S(n) is true. That is, S(n) = n2 [2a + (n −
1)r].
(iii) (Induction step) We must show that S(n + 1) = (n+1) 2
[2a + nr]. Indeed,
Pn+1
S(n + 1) = k=1 (a + (k − 1)r)
= S(n) + a + (n + 1 − 1)r
n
= 2
[2a + (n − 1)r] + a + nr
2an+n2 r−nr+2a+2nr
= 2
2a(n+1)+n(n+1)r
= 2
n+1
= 2
[2a + nr].
Theorem 11.1
For all integers n ≥ 1, 22n − 1 is divisible by 3.
Proof.
Let P (n) : 22n − 1 is divisible by 3. Then
(i) (Basis of induction) P (1) is true since 3 is divisible by 3.
(ii) (Induction hypothesis) Assume P (n) is true. That is, 22n − 1 is divisible
by 3.
(iii) (Induction step) We must show that 22n+2 − 1 is divisible by 3. Indeed,
= 22n · 3 + P (n)
Since 3|(22n − 1) and 3|(22n · 3) we have 3|(22n · 3 + 22n − 1). This ends a proof
of the theorem
Example 11.4
a. Use induction to prove that n < 2n for all non-negative integers n.
b. Use induction to prove that 2n < n! for all non-negative integers n ≥ 4.
Solution.
a. Let S(n) = 2n − n, n ≥ 0. We want to show that S(n) > 0 is valid for all
70 FUNDAMENTALS OF MATHEMATICAL PROOFS
S(n + 1) = 2n+1 − (n + 1)
= 2n .2 − n − 1
n
= 2 (1 + 1) − n − 1
= 2n − n + 2n − 1
= (2n − 1) + S(n)
> 2n − 1
≥ 0
(1 + nh) ≤ (1 + h)n , n ≥ 0.
Solution.
Let S(n) = (1 + h)n − (1 + nh). We want to show that S(n) ≥ 0 for all n ≥ 0.
We use mathematical induction as follows.
(i) (Basis of induction) S(0) = (1 + h)0 − (1 + 0h) = 0. That is, S(0)is true.
(ii) (Induction hypothesis) Assume S(n) is true. That is, S(n) ≥ 0, n ≥ 0.
11 METHOD OF PROOF BY INDUCTION 71
Example 11.6
Define the following sequence of numbers: a1 = 2 and for n ≥ 2, an = 5an−1 .
Find a formula for an and then prove its validity by mathematical induction.
Solution.
Listing the first few terms we find, a1 = 2, a2 = 10, a3 = 50, a4 = 250. Thus,
an = 2.5n−1 . We will show that this formula is valid for all n ≥ 1 by the
method of mathematical induction.
(i) (Basis of induction) a1 = 2 = 2.51−1 . That is, a1 is true.
(ii) (Induction hypothesis) Assume an is true. That is, an = 2.5n−1
(iii) (Induction step) We must show that an+1 = 2.5n . Indeed,
an+1 = 5an
= 5(2.5n−1 )
= 2.5n .
72 FUNDAMENTALS OF MATHEMATICAL PROOFS
Review Problems
Problem 11.1
Use the method of induction to show that
2 + 4 + 6 + · · · + 2n = n2 + n
Problem 11.2
Use mathematical induction to prove that
1 + 2 + 22 + · · · + 2n = 2n+1 − 1
Problem 11.3
Use mathematical induction to show that
n(n + 1)(2n + 1)
12 + 22 + · · · + n2 =
6
for all integers n ≥ 1.
Problem 11.4
Use mathematical induction to show that
2
3 3 3 n(n + 1)
1 + 2 + ··· + n =
2
Problem 11.5
Use mathematical induction to show that
1 1 1 n
+ + ··· + =
1·2 2·3 n(n + 1) n+1
Problem 11.6
Use the formula
n(n + 1)
1 + 2 + ··· + n =
2
to find the value of the sum
3 + 4 + · · · + 1, 000.
Problem 11.7
Find the value of the geometric sum
1 1 1
1 + + 2 + ··· + n.
2 2 2
Problem 11.8
Let S(n) = nk=1 (k+1)!
k
P
. Evaluate S(1), S(2), S(3), S(4), and S(5). Make a
conjecture about a formula for this sum for general n, and prove your con-
jecture by mathematical induction.
Problem 11.9
For each positive integer n let P (n) be the proposition 4n −1 is divisible by 3.
Problem 12.1
Let m and n be two integers.
a. Is 6m + 8n an even integer?
b. Is 6m + 4n2 + 3 odd?
Problem 12.2
Prove the following theorem.
Theorem 12.1
Let a 6= 0, b 6= 0, and c be integers.
(i) If a|b and a|c then a|(b ± c).
(ii) If a|b then a|bc.
(iii) If a|b and b|c then a|c.
A positive integer p > 1 is called prime if 1 and p are the only divisors of p.
A number which is not prime is called a composite number. For example,
3 is prime whereas 10 is composite.
Problem 12.3
Let m and n be positive integers with m > n. Is m2 − n2 composite?
Problem 12.4
Write the first 7 prime numbers.
12 PROJECT III: ELEMENTARY NUMBER THEORY AND MATHEMATICAL PROOFS75
Problem 12.5
If a positive number p is composite then one can always write p as the product
of primes, where the prime factors are written in increasing order. This result
is known as the Fundamental Theorem of Arithmetic or the Unique
Factorization Theorem. Write the prime factorization of 180.
Theorem 12.2
If
√ n is a composite integer, then n has a prime divisor less than or equal to
n.
Proof.
Since n is composite,
√ there√is a divisor a of n√such
√ that 1 < a < n. Write
n = ab. If a > n √ and b > n√ then n = ab > n n = n, a false conclusion.
Thus, either a ≤ n√or b ≤ n. Hence, n has a positive divisor which is
less than or equal to n. This divisor is either prime or, by the Fundamental
Theorem of Arithmetic has √ a prime divisor. In either case, n has a prime
divisor less than or equal to n
Problem 12.6
Use the previous theorem to show that the number 101 is prime.
76 FUNDAMENTALS OF MATHEMATICAL PROOFS
r1 = r2 q2 + r3 , where 0 ≤ r3 < r2 .
Problem 13.4
a. Use the Euclidean algorithm to find gcd(414, 662).
b. Use the Euclidean algorithm to find gcd(287, 91).
78 FUNDAMENTALS OF MATHEMATICAL PROOFS
Two matrices are said to be equal if they have the same size and their cor-
responding entries are all equal. If the matrix A is not equal to the matrix
B we write A 6= B.
Problem 14.1
Find x1 , x2 and x3 such that
x1 + x2 + 2x3 0 1 9 0 1
2 3 2x1 + 4x2 − 3x3 = 2 3 1
4 3x1 + 6x2 − 5x3 5 4 0 5
14 PROJECT V: INDUCTION AND THE ALGEBRA OF MATRICES 79
Problem 14.2
Solve the following matrix equation for a, b, c, and d
a−b b+c 8 1
=
3d + c 2a − 4d 7 6
Problem 14.3
Consider the matrices
2 1 2 1 2 1 0
A= ,B = ,C =
3 4 3 5 3 4 0
Problem 14.4
Consider the matrices
2 3 4 0 2 7
A= ,B =
1 2 1 1 −3 5
Compute A − 3B.
Problem 14.5
Let A be an m × n matrix. The transpose of A, denote by AT , is the n × m
whose columns are the rows of A. Find the transpose of the matrix
2 3 4
A= ,
1 2 1
80 FUNDAMENTALS OF MATHEMATICAL PROOFS
Problem 14.6
Consider the matrices
4 1 4 3
1 2 4
A= , B = 0 −1 3 1
2 6 0
2 7 5 2
Problem 14.7
Prove by induction on n ≥ 1 that
n n
2 1 2 n2n−1
= .
0 2 0 2n
Fundamentals of Set Theory
Set is the most basic term in mathematics and computer science. Hardly
any discussion in either subject can proceed without set or some synonym
such as class or collection. In this chapter we introduce the concept of sets
and its various operations and then study the properties of these operations.
15 Basic Definitions
We first consider the following known as the barber puzzle:” The army
captain orders his company barber to shave all members of the company
provided they do not shave themselves. The barber is so busy at first that
his own beard begins to be unsightly. Just as he lathers up, the impossibility
of his position strikes him: If he shaves himself, he disobeys the captain’s or-
der. If he does not shave himself, then by the captain’s order he is supposed
to shave himself.”
A situation like this is known as a paradox. To resolve the problem one has
to take the barber out of the company. Another well known paradox is
81
82 FUNDAMENTALS OF SET THEORY
Example 15.1
List the elements of the following sets.
a. {x|x is a real number such that x2 = 1}.
b. {x|x is an integer such that x2 − 3 = 0}.
Solution.
a. {−1, 1}.
b. ∅
Example 15.2
Use a property to give a description of each of the following sets.
a. {a, e, i, o, u}.
b. {1, 3, 5, 7, 9}.
Solution.
a. {x|x is a vowel}.
b. {n ∈ IN∗ |n is odd and less than 10}
∅ ⊆ A ⇔ ∀x, x ∈ ∅ implies x ∈ A
15 BASIC DEFINITIONS 83
Example 15.3
Suppose that A = {2, 4, 6}, B = {2, 6}, and C = {4, 6}. Determine which of
these sets are subsets of which other of these sets.
Solution.
B ⊆ A and C ⊆ A
Example 15.4
Represent A ⊆ B using Venn diagram.
Solution.
Example 15.5
Determine whether each of the following pairs of sets are equal.
(a) {1, 3, 5} and {5, 3, 1}.
(b) {{1}} and {1, {1}}.
Solution.
(a) {1, 3, 5} = {5, 3, 1}.
(b) {{1}} = 6 {1, {1}} since 1 6∈ {{1}}
84 FUNDAMENTALS OF SET THEORY
Example 15.6
I IN using ⊂
Order the sets of numbers: Z , IR, Q,
Solution.
IN ⊂ Z ⊂ Q
I ⊂ IR
Example 15.7
Determine whether each of the following statements is true or false.
(a) x ∈ {x} (b) {x} ⊆ {x} (c) {x} ∈ {x}
(d) {x} ∈ {{x}} (e) ∅ ⊆ {x} (f) ∅ ∈ {x}
Solution.
(a) True (b) True (c) False (d) True (e) True (f) False
Ac = {x ∈ U |x 6∈ A}.
B − A = {x ∈ U |x ∈ B and x 6∈ A}.
Example 15.8
Let U = IR. Consider the sets A = {x ∈ IR|x < −1 or x > 1} and
B = {x ∈ IR|x ≤ 0}. Find
a. Ac .
b. B − A.
Solution.
a. Ac = [−1, 1].
15 BASIC DEFINITIONS 85
b. B − A = [−1, 0]
A ∪ B = {x|x ∈ A or x ∈ B}.
where the ’or’ is inclusive. This defenition can be extended to more than two
sets. More precisely, if A1 , A2 , · · · , are sets then
∪∞
n=1 An = {x|x ∈ Ai f or some i}.
If A∩B = ∅ we say that A and B are disjoint sets. Given the sets A1 , A2 , · · · ,
we define
∩∞n=1 An = {x|x ∈ Ai f or all i}.
Example 15.9
Let A = {a, b, c}, B = {b, c, d}, and C = {b, c, e}.
Solution.
a. A ∪ (B ∩ C) = A, (A ∪ B) ∩ C = {b, c}, (A ∪ B) ∩ (A ∪ C) = {b, c} =
(A ∪ B) ∩ C.
b. A ∩ (B ∪ C) = {b, c}, (A ∩ B) ∪ C = C, (A ∩ B) ∪ (A ∩ C) = {b, c} =
(A ∩ B) ∪ C.
c. A − (B − C) = A and (A − B) − C = {a} = 6 A − (B − C).
Example 15.10
For each n ≥ 1, let An = {x ∈ IR : x < 1 + n1 }. Show that
∩∞
n=1 An = {x ∈ IR : x ≤ 1}.
86 FUNDAMENTALS OF SET THEORY
Solution.
The proof is by double inclusions method. Let y ∈ {x ∈ IR : x ≤ 1}. Then
for all positive integer n we have y ≤ 1 < 1 + n1 . That is, y ∈ ∩∞ n=1 An . This
shows that {x ∈ IR : x ≤ 1} ⊆ ∩∞ A
n=1 n .
Conversely, let y ∈ ∩∞ n=1 A n . Then y < 1 + n1 for all n ≥ 1. Now take the limit
of both sides as n → ∞ to obtain y ≤ 1. That is, y ∈ {x ∈ IR : x ≤ 1}. This
shows that ∩∞ n=1 An ⊆ {x ∈ IR : x ≤ 1}.
Example 15.11
The symmetric difference of A and B, denoted by A∆B, is the set contain-
ing those elements in either A or B but not both. Find A∆B if A = {1, 3, 5}
and B = {1, 2, 3}.
Solution.
A∆B = {2, 5}
A1 × A2 × · · · × An = {(a1 , a2 , · · · , an ) : a1 ∈ A1 , a2 ∈ A2 , · · · , an ∈ An }
Example 15.12
Let A = {x, y}, B = {1, 2, 3}, and C = {a, b}. Find
a. A × B × C.
b. (A × B) × C.
Solution.
a.
A × B × C = {(x, 1, a), (x, 2, a), (x, 3, a), (y, 1, a), (y, 2, a),
(y, 3, a), (x, 1, b), (x, 2, b), (x, 3, b), (y, 1, b)
(y, 2, b), (y, 3, b)}
b.
(A × B) × C = {((x, 1), a), ((x, 2), a), ((x, 3), a), ((y, 1), a), ((y, 2), a),
((y, 3), a), ((x, 1), b), ((x, 2), b), ((x, 3), b), ((y, 1), b)
((y, 2), b), ((y, 3), b)}
15 BASIC DEFINITIONS 87
Example 15.13
Let Σ = {a, b}. List all the elements of the set
A = {w ∈ Σ∗ : |w| = 2}.
Solution.
Review Problems
Problem 15.1
Which of the following sets are equal?
a. {a, b, c, d}
b. {d, e, a, c}
c. {d, b, a, c}
d. {a, a, d, e, c, e}
Problem 15.2
Let A = {c, d, f, g}, B = {f, j}, and C = {d, g}. Answer each of the following
questions. Give reasons for your answers.
a. Is B ⊆ A?
b. Is C ⊆ A?
c. Is C ⊆ C?
d. Is C is a proper subset of A?
Problem 15.3
a. Is 3 ∈ {1, 2, 3}?
b. Is 1 ⊆ {1}?
c. Is {2} ∈ {1, 2}?
d. Is {3} ∈ {1, {2}, {3}}?
e. Is 1 ∈ {1}?
f. Is {2} ⊆ {1, {2}, {3}}?
g. Is {1} ⊆ {1, 2}?
h. Is 1 ∈ {{1}, 2}?
i. Is {1} ⊆ {1, {2}}?
j. Is {1} ⊆ {1}?
Problem 15.4
Let A = {b, c, d, f, g} and B = {a, b, c}. Find each of the following:
a. A ∪ B.
b. A ∩ B.
c. A − B.
d. B − A.
Problem 15.5
Indicate which of the following relationships are true and which are false:
a. Z + ⊆ Q.
I
15 BASIC DEFINITIONS 89
b. IR− ⊂ Q.
I
I ⊂ Z.
c. Q
d. Z + ∪ Z − = Z .
I ∩ IR = Q.
e. Q I
I ∪ Z = Z.
f. Q
g. Z + ∩ IR = Z +
h. Z ∪ QI = Q.
I
Problem 15.6
Let A = {x, y, z, w} and B = {a, b}. List the elements of each of the following
sets:
a. A × B
b. B × A
c. A × A
d. B × B.
Problem 15.7
Let Σ = {x, y} be an alphabet.
a. Let L1 be the language consisting of all strings over Σ that are palindromes
and have length ≤ 4. List the elements L1 .
b. Let L2 be the language consisting of all strings over Σ that begins with x
and have length ≤ 3. List the elements L2 .
c. Let L3 be the language consisting of all strings over Σ with length ≤ 3
and for which all the x0 s appear to the left of all the y 0 s. List the elements
L3 .
d. List the elements of Σ4 , the set of all strings of length 4 over Σ.
e. Let A = Σ3 ∪ Σ4 . Describe A, B, and A ∪ B in words.
90 FUNDAMENTALS OF SET THEORY
16 Properties of Sets
The following exercise shows that the operation ⊆ is reflexive and transitive,
concepts that will be discussed in the next chapter.
Example 16.1
a. Suppose that A, B, C are sets such that A ⊆ B and B ⊆ C. Show that
A ⊆ C.
b. Find two sets A and B such that A ∈ B and A ⊆ B.
c. Show that A ⊆ A.
Solution.
a. We need to show that every element of A is an element of C. Let x ∈ A.
Since A ⊆ B then x ∈ B. But B ⊆ C so that x ∈ C.
b. A = {x} and B = {x, {x}}.
c. The proposition if x ∈ A then x ∈ A is always true. Thus, A ⊆ A
Theorem 16.1
Let A and B be two sets. Then
a. A ∩ B ⊆ A and A ∩ B ⊆ B.
b. A ⊆ A ∪ B and B ⊆ A ∪ B.
Proof.
a. If x ∈ A ∩ B then x ∈ A and x ∈ B. This still imply that x ∈ A. Hence,
A ∩ B ⊆ A. A similar argument holds for A ∩ B ⊆ B.
b. The proposition ”if x ∈ A then x ∈ A ∪ B” is always true. Hence,
A ⊆ A ∪ B. A similar argument holds for B ⊆ A ∪ B
Theorem 16.2
Let A be a subset of a universal set U. Then
a. ∅c = U.
b. U c = ∅.
c. (Ac )c = A.
d. A ∪ Ac = U.
e. A ∩ Ac = ∅.
Proof.
a. If x ∈ U then x ∈ U and x 6∈ ∅. Thus, U ⊆ ∅c . Conversely, suppose that
x ∈ ∅c . Then x ∈ U and x 6∈ ∅. This implies that x ∈ U. Hence, ∅c ⊆ U.