Professional Documents
Culture Documents
OF
DISCRETE MATHEMATICS
By
Narinder Singh
Lovely Professional University
Phagwara
2022
Contents
1 Propositional Logic 1
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Proposition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2.1 Method of producing new propositions from given propositions . . . . 3
1.2.2 Conditional Statements . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.2.3 Truth Tables of Compound Propositions . . . . . . . . . . . . . . . . 15
1.2.4 Precedence of Logical Operators . . . . . . . . . . . . . . . . . . . . . 16
1.3 Application of Propositional Logic: . . . . . . . . . . . . . . . . . . . . . . . 16
1.3.1 Translating English Sentences . . . . . . . . . . . . . . . . . . . . . . 17
1.3.2 System Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.3.3 Logic Puzzles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.4 Logical Equivalences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.4.1 Classification of Compound propositions according to their truth value 22
1.5 Predicates and Quantifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
1.5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
1.5.2 Predicates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
1.5.3 Quantifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
1.5.4 Qunatifiers with Restricted Domains . . . . . . . . . . . . . . . . . . 35
1.6 Introduction to Proof . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
1.6.1 Direct Proof . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
1.6.2 Proof by Contraposition . . . . . . . . . . . . . . . . . . . . . . . . . 40
1.6.3 Vacuous and Trivial Proofs . . . . . . . . . . . . . . . . . . . . . . . . 42
1.6.4 Proofs by Contradiction . . . . . . . . . . . . . . . . . . . . . . . . . 43
1.7 Mistakes in Proofs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
1.8 Some Basic selected Exercise Problems . . . . . . . . . . . . . . . . . . . . . 47
2 Reccurence relations 51
2.1 Reccurrence Relation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
2.2 Modeling with Recurrence Relations: . . . . . . . . . . . . . . . . . . . . . . 52
2.2.1 The colony of Bacteria . . . . . . . . . . . . . . . . . . . . . . . . . . 52
2.2.2 Compound Interest: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
2.2.3 The Tower of Hanoi . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
2.3 Linear Homogeneous Recurrence Relations . . . . . . . . . . . . . . . . . . . 58
2.3.1 Shifting and Difference Operator . . . . . . . . . . . . . . . . . . . . 59
i
2.3.2 Solving Linear Homogeneous Recurrence relations with constant coef-
ficients of Degree 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
2.3.3 Exercise Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Propositional Logic
1.1 Introduction
1
1.2. Proposition 2
1.2 Proposition
Definition 1.2.1
A proposition is a declarative sentence(that is, a sentence that
declares a fact) that is either true of false, but not both.
Definition 1.2.3
Let p and q be propositions. The conjuction of p and q,
denoted by p ∧ q, is the proposition “p and q.” The conjuction
p ∧ q is true when both p and q are true and is false otherwise.
p q p∧q
T T T
T F F
F T F
F F F
This table has a row for each of the four possible combinations of
truth values of p and q. The four rows correspond to the pairs of the
truth values TT, TF, FT and FF, where first truth value in the pair
is truth value of p and second truth value is truth value of q.
Definition 1.2.4
Let p and q be propositions. The disjunction of p and q,
denoted by p ∨ q, is the proposition “p or q” The disjunction
p ∨ q is false when both p and q are false and is true otherwise.
Definition 1.2.5
Let p and q be propositions. The exclusive or of p and q,
denoted by p ⊕ q, is the proposition that is true when exactly
one of p and q is true and is false otherwise.
L
p q p q
T T F
T F T
F T T
F F F
L
Table 1.3: Truth Table of p and q (p q)
Definition 1.2.6
Let p and q be propositions. The conditional statement p → q
is the proposition “if p, then q.” The conditional statement
p → q is false when p is true and q is false, and true otherwise.
In the conditional statement p → q, p is called the hypothe-
sis(or antecedent or premise) and q is called the conclusion
(or consequence).
p q p→q
T T T
T F F
F T T
F F T
9 Narinder Singh 1. Propositional Logic
Note that the statement p → q is true when both p and q are true
and when p is false (no matter what truth value q has).
Because conditional statements play such an essential role in math-
ematical reasoning, a variety of terminology is used to express p → q.
You will encounter most if not all of the following ways to express
this conditional statement:
“if p then q” “if p, q”
“p is sufficient for q” “q if p”
“If you get 100% marks on the final, then you will get an A.”
If you manage to get a 100% on the final, then you would expect
to receive an A. If you do not get 100% you may or may not receive
A depending on other factors. However, if you do get 100%, but
professor does not give you an A, you will feel cheated. ????
We illustrate the translation between conditional statements and
English statements in Example 1.2.7.
Example 1.2.7. Let p be the statement “Maria learns discrete
mathematics” and q is the statement “Maria will find a good job.”
Express the statement p → q as a statement in English.
Solution: From the definition of conditional statements, we see that
when p is the statement “Maria learns discrete mathematics” and q
is the statement “Maria will find a good job,” p → q represents the
statement
“If Maria learns discrete mathematics, then she will find a good job.”
There are many other ways to express this conditional statement
in English. Among the most natural of these are
“Maria will find a good job when she will learns discrete mathematics.”
indeed sunny, but we do not go to the beach. On the other hand the
statement
“If Juan has a smartphone, then 2 + 3 = 6”
is true if Juan does not have a smartphone, even though 2+3=6
is false. We would not use these last two conditional statements
in natural language (except perhaps in sarcasm), because there is
no relationship between the hypothesis and the conclusion in either
statement. In mathematical reasoning, we consider conditional state-
ments of more general sort than we use in English. The mathematical
concept of a conditional statement is independent of a cause and ef-
fect relationship between hypothesis and conclusion. Our definition
of conditional statement specifies its truth values; it is not based on
English usage. Propositional language is an artificial language; we
only parallel English usage to make it easy to use and remember.
The if-then construction used in programming languages is differ-
ent from that used in logic. Most programming languages contain
statements such as if p then S, where p is a proposition and S is
a program segment (one or more statements to be executed). Then
execution of a program encounters such a statement, S is executed if
p is true, but S is not executed if p is false, as illustrated in Example
below:
Example 1.2.8. What is the value of the variable x after the state-
ment
if 2 + 2 = 4 then x := x + 1
Definition 1.2.7
Let p and q be propositions. The biconditional statement
p ↔ q is the proposition “p if and only if q.” The bicon-
ditional statement p ↔ q is true when p and q have the same
truth values, and is false otherwise. Biconditional statements
are also called bi-implications.
p q p↔q
T T T
T F F
F T F
F F T
p q ¬q p ∨ ¬q p∧q (p ∨ ¬q) → (p ∧ q)
T T F T T T
T F T T F F
F T F F F T
F F T T F F
a → (c ∨ ¬f ).
q → ¬p.
p= A is knight
q= B is knight. Therefore
¬p = A is knave
¬q = B is knave
21 Narinder Singh 1. Propositional Logic
Definition 1.4.1
A compound proposition that is always true, no matter what
the truth values of the proposition variables that occur in it, is
called tautology.
A compound proposition that is always false is called a con-
tradiction.
A compound proposition that is neither a tautology nor a con-
tradiction is called a contingency.
p ¬p p ∨ ¬p p ∧ ¬p
T F T F
F T T F
Definition 1.4.2
The compound propositions p and q are called logical equiv-
alent if p ↔ q is a tautology. The notation p ≡ q denotes that
p and q are logically equivalent. Somtime symbol ⇐⇒ is used
instead of ≡ .
De Morgan’s Laws
¬(p ∧ q) ≡ ¬p ∨ ¬q
¬(p ∨ q) ≡ ¬p ∧ ¬q
Example 1.4.2. Show that ¬(p ∧ q) ≡ ¬p ∨ ¬q.
Solution: This is clear from the truth table of these propositions.
p q ¬p ¬q ¬p ∨ ¬q (p ∧ q) ¬(p ∧ q)
T T F F F T F
T F F T T F T
F T T F T F T
F F T T T F T
Logical Equivalences.
Equivalence Name
p∧T ≡p Identity Laws
p∨F ≡p
p∨T ≡T Domination Laws
p∧F ≡F
p∨p≡p Idempotent Laws
p∧p≡p
¬(¬p) ≡ p Double negation law
p∨q ≡q∨p Commutative laws
p∧q ≡q∧p
p∨q ≡q∨p Associative laws
p∧q ≡q∧p
p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r) Distributive laws
p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r)
¬(p ∨ q) ≡ ¬p ∧ ¬q De Morgan’s laws
¬(p ∧ q) ≡ ¬p ∨ ¬q
p ∨ (p ∧ q) ≡ p Absorption laws
p ∧ (p ∨ q) ≡ p
p ∨ ¬p ≡ T Negation Laws
p ∧ ¬p ≡ F
Table 1.8
25 Narinder Singh 1. Propositional Logic
Exercise
Prove the following logical equivalences involving conditional state-
ments:
• p → q ≡ ¬p ∨ q.
• p → q ≡ ¬q → ¬p.
• p ∨ q ≡ ¬p → q
• p ∧ q ≡ ¬(p → ¬q)
• ¬(p → q) ≡ p ∧ ¬q
• (p → q) ∧ (q → r) ≡ p → (q ∧ r)
• (p → r) ∧ (q → r) ≡ (p ∨ q) → r
• (p → q) ∨ (p → q) ≡ p → (q ∨ r)
• (p → q) ≡ (p ∧ q) → r
• p ↔ q ≡ (p → q) ∧ (q → p)
• p ↔ q ≡ ¬p ↔ ¬q
• p ↔ q ≡ (p ∧ q) ∨ (¬p ∧ ¬q)
• ¬(p ↔ q) ≡ p ↔ ¬q
1.5. Predicates and Quantifiers 26
1.5.1 Introduction
1.5.2 Predicates
The statement “x is greater than 3” has two parts. The first part,
the variable x, is the subject of the statement. The second part-the
predicate, “is greater than 3”-refers to a property that the subject
of the statement can have. We denote the statement “x is greater
than 3” by P (x), where P denotes the predicate “is greater than 3”
and x is a variable. The statement P (x) is also said to be the value of
propositional function P at x. Once a value has been assigned
to the variable x, the statement P (x) becomes a proposition and has
a truth value. Consider the following examples:
Example 1.5.1. Let P (x) denotes the statement “x > 3.” What
are the truth values of P (4) and P (2)?
1.5. Predicates and Quantifiers 28
indicate which of these statements are true and which are false.
1.5.3 Quantifiers
Quantifiers
Statement When True? When False?
∀ x P (x) P (x) is true for every x. There is an x for which P (x) is false.
∃ x P (x) There is an x for which P (x) is true. P (x) is false for every x.
Example 1.5.7. Let Q(x) be the statement “x < 2.” What is the
truth value of the quantification ∀ x Q(x), where the domain consists
of all real numbers?
Solution: Q(x) is not true for every real number x, because, for
instance, Q(3) is false. That is x = 3 is a counterexample for the
statement ∀ x Q(x). Thus ∀ x Q(x) is false.
Example 1.5.8. Suppose that P (x) is “x2 > 0.” To show that the
statement ∀ x P (x) is false where the universe of discouse (domain)
consists of all integers, we give a counterexample. We see that x = 0
is a counterexample because x2 = 0 when x = 0, so that x2 is not
greater than 0 when x = 0.
When all the elements of the domain can be listed-say x1, x2, . . . , xn
-it follows that the universal quantification ∀ x P (x) is same as the
conjuction.
Definition 1.5.3
The existential quantification of P (x) is the proposition
“There exists an element x in the domain such that P (x).”
We use the notation ∃ x P (x) for the existential quantification
of P (x). Here ∃ is called the existential quantifier.
¬∃xQ(x) ≡ ∀x¬Q(x).
Types of Proofs
Proof by contraposition
Vaccous Proof
Proof by Contradiction
39 Narinder Singh 1. Propositional Logic
n = 2k
We find that
3n + 2 = 3(2k) + 2 = 2(3k + 1)
= 2k ′
Here k ′ = 3k + 1. This tells us that 3n + 2 is even and therefore
not odd. Therefore if n is not odd then 3n + 2 is not odd. This is
equivalent to if 3n + 2 is odd, then n is odd.
1.6. Introduction to Proof 42
Solution: Note that P (0) is “If 0 > 1, then 02 > 0.” We can
show P (0) using a vacous proof. Indeed, the hypothesis 0 > 1 is
false. This tells us that P (0) is automatically true.
We know that p → q is true if q is true. Therefore if we prove q
is true, then p → q will be true. Such prove which use the fact that
q is true is called a trivial proof.
Example 1.6.6. Let P (n) be “If a and b are positive integers with
a ≥ b, then an ≥ bn,” where the domain consists of all nonnegative
integers. Show that P (0) is true.
Solution: The proposition P (0) is “if a ≥ b, then a0 ≥ b0” is true.
Because a0 = b0 = 1, the conclusion of the conditional statement “If
a ≥ b, then a0 ≥ b0” is true. Hence, this conditional statement,
which is P (0), is true. This is an example of the trivial proof.
Solution: Let p = “At least four of 22 chosen days fall on the same
day of the week.”
Suppose that not p is true.
This means that at most three of 22 days fall on the same day of the
week. Because there are seven days of the week, this implies that
atmost 21 days could have been chosen, as for each of the days of the
week, at most three of the chosen days could fall on that day. This
contradicts the premise that we have 22 days under consideration.
That is, if r is the statement that 22 days are chosen, then we have
shown that ¬p → (r ∧ ¬r). Consequently, we know that p is true.
We have proved that atleast four of 22 days fall on the same day of
the week.
√
Example 1.6.8. Prove that 2 is irrational by giving a proof by
contradiction.
√
Solution:
√ Let p = “ 2 is irrational”.
√ Suppose not p is true. i.e.
2 is not irrational. This means 2 is rational. Therefore there
eixst integers a and b such that
√ a
2 = , where b ̸= 0, gcd(a, b) = 1.
b
Squaring both sides we have,
a2
2 = 2.
b
Hence 2b = a2.
2
b2 = 2c2.
By the definition of even, this means that b2 is even. Using the fact
that if square of an integer is even, then the integer itself must be
even, we conclude that b must be even as well. This means both a, b
are both even, that is, 2 divides both a, b. However, gcd(a, b) = 1.
So we This is a contradiction. Therefore ¬p must be false. Hence
√
2 is irrational.
1. Which of the following are propositions? What are truth values of those propositions?
2. Identify Truth Tables? What should be there in place of question marks in following
tables
1.8. Some Basic selected Exercise Problems 48
p q ? p q ? p q ?
T T T p ? T T T T T F
T F F T F T F T T F T
F T F F T F T T F T T
F F F Table 2 F F F F F F
Table 1 Table 3 Table 4
3. Let
p = “The election is decided”
q = “The votes have been counted”
(a) ¬p
(b) p ∨ q
(c) ¬p ∧ q
(d) ¬q → ¬p
01 1011 0110
11 0001 1101
(Here 0 represents false and 1 represents true) Following are the options:
p : It is below freezing
q : It is snowing.
9. State the converse, contra-positive, and inverse of each of these conditional statements.
(a) if x + 2 = 3 then x := x + 1.
(b) if (x + 1 = 3) OR (2x + 2 = 3)then x := x + 1.
(c) if x < 2 then x := x + 1.
10. Use the truth table to verify the associative law (p ∧ q) ∧ r ≡ p ∧ (q ∧ r). What will be
number of rows in that table?
12. Let P (x) = “x > 3.” What are the truth values of P (4) and P (2)?
13. Translate each of the following into logical expression using predicates, quantifiers, and
logical connectives. First, domain consist of the students in your class.
Solution to (13a): Let P (x) be “x is perfect”, let F (x) be “x is perfect”. First, domain
is students in your class. (1) ∀x¬P (x).
⋆⋆⋆
Chapter 2
Reccurence relations
Therefore
a3 = −3, a2 = 2.
51
2.2. Modeling with Recurrence Relations: 52
an = 2an−1
P1 = 1.11P0
P2 = 1.11P1 = (1.11)2P0
P3 = 1.11P2 = (1.11)2P1 = (1.11)3P0
...
Pn = (1.11)nP0 = (1.11)n10, 000.
2.2. Modeling with Recurrence Relations: 54
Figure 2.1
55 Narinder Singh 2. Reccurence relations
The rules of the puzzle allow disks to be moved one at a time from
one peg to another as long as a disk is never placed on the top of a
smaller disk.
Hn = number of moves needed to solve the tower of Hanoi puzzle
with n disk. Then
Hn = 2Hn−1 + 1.
Figure 2.2
Figure 2.3
Then we will move largest disk to peg C and it will take 1 move.
So total moves used till now are Hn−1 + 1.
Figure 2.4
Figure 2.5
Hn = 2Hn−1 + 1
= 2(2Hn−2 + 1) + 1 = 22Hn−2 + 2 + 1
= 22(2Hn−3 + 1) + 2 + 1 = 23Hn−3 + 22 + 2 + 1
...
= 2n−1H1 + 2n−2 + · · · + 22 + 2 + 1
= 2n−1 + 2n−2 + · · · + 22 + 2 + 1 (H1 = 1)
= 2n − 1.
2.3. Linear Homogeneous Recurrence Relations 58
Definition 2.3.1
A linear homogeneous recurrence relation of degree k
with constant coefficients is a recurrence relation of the form
an = c1an−1 + c2an−2 + · · · + ck an−k ,
where c1, c2, . . . , ck are real numbers, and ck ̸= 0.
Definition 2.3.2
The shifting operator E is an operator which acts on an as
follows
Ean = an+1.
Definition 2.3.3
The difference operator ∆ is an operator which acts on an as
follows
∆an = an+1 − an.
2.3. Linear Homogeneous Recurrence Relations 60
E 2 an = E 2(an−1) + E 2(2an−2)
an+2 = an+1 + 2an
an+2 − an+1 − 2an =0
(E 2 − E − 2)an = 0.
r2 − r − 2 = 0
an = c12n + c2(−1)n.
a0 = c120 + c2(−1)0
2 = c1 + c2 (1)
7 = 2c1 − c2 (2)
Now we will solve (1) and (2) to find the value of c1, c2. Adding (1)
and (2), we obtain
9 = 3c1
c1 = 3
c2 = −1
Therefore
an = 3(2)n − 1(−1)n.
Example 2.3.4. Solve the recurrence relation yk+2 − 6yk+1 + 8yk =
0, y0 = 3, y1 = 2. Also find y5.
Solution: The degree of given recurrence relation is 2. The given
equation may be written as
(E 2 − 6E + 8)yk = 0
2.3. Linear Homogeneous Recurrence Relations 62
r2 − 6r + 8 = 0.
r = 2, 4
yk = c1(2)k + c2(4)k
Now we will use the given initial conditions, first using y0 = 3, we
have
y0 = c1 + c2
3 = c1 + c2 (2.1)
Using y1 = 2, we have
y1 = 2c1 + 4c2
2 = 2c1 + 4c2 (2.2)
Now let us solve (2.1) and (2.2). Multiplying (2.1) by 2 and sub-
tracting from eqn (2.2)
4 = −2c2
c2 = −2.
c1 = 5.
Therefore,
yk = 5.2k − 2.4k .
y5 = 5.25 − 2.45 = 25(5 − 64) = −32(59) = −1888.
63 Narinder Singh 2. Reccurence relations
Theorem 2.3.2
Let c1 and c2 be real numbers with c2 ̸= 0. Suppose that
r2 − c1r − c2 = 0 has only one root r0 (when both roots
are same). Then an is soltution of the recurrence relation
an = c1an−1 + c2an−2 if and only if an = α1r0n + α2nr0n. Here
α1, α2 are constants.
r2 − 6r + 9 = 0.
r = 3, 3
an = (α1 + nα2)3k .
r2 − 2r + 5 = 0
√
2 ± 4 − 20
r=
2
2 ± 4i
r= = 1 ± 2i
2
Therefore the complimentary solution/function is
√
r = 5. θ = tan −1
2
√
(1 + 2i)k = ( 5(cos θ + i sin θ))k
Applying De Moiver’s Theorem Simillarly
(1 + 2i)k = 5k/2(cos kθ + i sin kθ) (1−2i)k = 5k/2(cos kθ−i sin kθ).
Hint Problem 2: fn = √ − √
5 2 5 2
Hint Problem 3: yk = 1 + 3k
k
3
n
Hint Problem 4: an = 2 cos + sin
nπ nπ
2
4 4 .
2.3. Linear Homogeneous Recurrence Relations 66
Chapter 3
67
3.2. The Pigeonhole Principle 68
Example 3.3.3. (a) How many cards must be selected from a stan-
dard deck of 52 cards to guarantee that at least three cards of the
same suit are chosen?
(b) How many must be selected to guarantee that at least three
hearts are selected?
Solution: (a) Suppose there are four boxes, one for each suit, and
as cards are selected they are placed in the box reserved for cards of
that suit using the generalized pigeonhole principle, we see that if N
cards are selected, there is at least one box containing at least [N/4]
cards. consequently, we know that at least three cards of one suit are
selected if [N/4] ≥ 3. The smallest integer N such that [N/4] ≥ 3 is
N = 2.4 + 1 = 9, so nine cards are suffice. Note that if 8 cards are
selected, it is possible to have two cards of each suit, so more than
eight cards are needed.
(b) We do not use the generalized pigeonhole principle to answer
this question, because we want to make sure that there are three
hearts, not just three cards of one suit. Note that in the worst case,
we can select all the clubs, diamonds, and spades, 39 cards in all
before we select a single heart. The next three cards will be all
hearts, so we may need to select 42 cards to get three hearts.
Example 3.3.4. What is the least number of area codes needed
to guarantee that the 25 million phones in a state can be assigned
distinct 10-digit telephone numbers? (Assume that telephone num-
ber are of the form NXX-NXX-XXXX, where the first three digits
form the area code, N represents a digit from 2 to 9 inclusive, and X
represents any digit.)
Solution: There are eight million different phone numbers of the
form NXX-XXXX. Hence, by generalized pigeonhole principle, among
25 million telephones, at least [25, 000, 000/8, 000, 000] = 4 of them
71 Narinder Singh 3. Counting principles and relations
must have identical phone numbers. Hence, at least four area codes
are required to ensure that all 10-digit numbers are differnt.
Definition 3.4.1
Let A, B be two non-empty sets. Then we defined cartesian
product of set A and B is denoted by A × B and is given by
A × B = {(a, b) : a ∈ A and b ∈ B}.
A × B = {(1, a), (1, b), (2, a), (2, b), (3, a), (3, b)}
Example 3.4.5. Let A be the set {1, 2, 3, 4}. Which ordered pairs
are in the relation R = {(a, b)| a divides b}?
Solution: Because (a, b) is in R if and only if a divides b and
a, b ∈ {1, 2, 3, 4}, we see that
{(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 4), (3, 3), (4, 4)}.
This relation is shown below in table and graph?? also:
73 Narinder Singh 3. Counting principles and relations
R 1 2 3 4
1 X X X X
2 X X
3 X
4 X
Table 3.1: Displaying the Ordered Pairs in the Relation R from Example 4
Definition 3.5.1
A relation R on a set A is called reflexive if (a, a) ∈ R for
every element a ∈ A.
3.5. Properties of Relations 74
1. R1 = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 4), (4, 1), (4, 4)},
2. R2 = {, (1, 1), (1, 2), (1, 4), (2, 1), (2, 2), (3, 3), (4, 1), (4, 4)},
6. R6 = {(3, 4)}.
Definition 3.5.2
A relation R on a set A is called symmetric if (b, a) ∈ R
whenever (a, b) ∈ R, for all a, b ∈ A.
A relation R on a set A such that for all a, b ∈ A, if (a, b) ∈ R
and (b, a) ∈ R, then a = b is called antisymmetric.
75 Narinder Singh 3. Counting principles and relations
Definition 3.5.3
A relation R on a set A is called transitive if whenever (a, b) ∈
R and (b, c) ∈ R, then (a, c) ∈ R, for all a, b, c ∈ A.
all ordered pairs (a, b), where a is a student who has taken course b,
and R2 consists of all ordered pairs (a, b), where a is a student who
requires course b to graduate. What are the relations R1 ∪ R2, R1 ∩
R2, R1 R2, R2 − R1, and R2 − R1?
L
Example 3.6.2. Let R1 be the “less than” relation on the set of real
numbers and let R2 be the “greater than” relation on the set of real
numbers, that is, R1 = {(x, y) : x < y} and R2 = {(x, y) : x > y}.
What are R1 ∪ R2, R1 ∩ R2, R1 − R2, R2 − R1, and R1 R2?
L
Definition 3.6.1
Let R be a relation from a set A to a set B and S a relation
from B to a set C. The composite of R and S is the relation
consisting of ordered pairs (a, c), where a ∈ A, c ∈ C, and for
which there exists an element b ∈ B such that (a, b) ∈ R and
(b, c) ∈ S. We denote the composite of R and S by SoR.
SoR = {(1, 0), (1, 1), (2, 1), (2, 2), (3, 0), (3, 1)}.
Definition 3.6.2
Let R be a relation on the set A. The powers Rm, n = 1, 2, 3, . . .
are defined recursively by R1 = R and Rn+1 = RnoR.
Example 3.6.5. Let R = {(1, 1), (2, 1), (3, 2), (4, 3)}. Find the
powers Rn, n = 1, 2, 3, . . . ,
Solution: R2 = RoR = {(1, 1), (2, 1), (3, 1), (4, 2)}.
R3 = R2oR = {(1, 1), (2, 1), (3, 1), (4, 1)}
R4 = R3oR = {(1, 1), (2, 1), (3, 1), (4, 1)}
...
0 if (ai, bj ) ̸∈ R
Solution: Beccause R = {(2, 1), (3, 1), (3, 2)}, the matrix for R is
0 0
MR = 1 0
1 1
The 1s in MR show that the pairs (2, 1), (3, 1), and (3, 2) belong to
R. The 0s show that no other pairs belong to R.
Example 3.7.2. Let A = {a1, a2, a3} and B = {b1, b2, b3, b4, b5}.
Which ordered pairs are in the relation R represented by the matrix.
0 1 0 0 0
MR = 1 0 1 1 0?
1 0 1 0 1
1 0 1
MR1∩R2 = MR1 ∧ MR2 = 0 0 0
0 0 0
83 Narinder Singh 3. Counting principles and relations
Definition 3.8.1
A relation R on a set S is called a partial ordering or partial
order if it is reflexive, antisymmetric, and transitive. A set S
together with the partial ordering R is called a partially ordered
set, or poset, and is denoted by (S, R). Members of S are called
elements of the poset.
Example 3.8.5. In the poset (Z+, |), are the integers 3 and 9 com-
parable? Are 5 and 7 comparable?
85 Narinder Singh 3. Counting principles and relations
Definition 3.8.3
If (S, ⪯) is a poset and every two elements of S are comparable,
S is called a totally ordered or linearly ordered set, and
⪯ is called a total order or a linear order. A totally ordered set
is also called a chain.
Definition 3.9.1
A directed graph, or a digraph, consist of a set V of vertices
(or nodes) together with a set E of ordered pairs of elements
of V called edges(or arcs). The vertex a is called the initial
vertex of the edge (a, b), and the vertex b is called the terminal
vertex of this edge.