Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

Discrete Mathematics

Relations

Relations Discrete Mathematics 1/10


ORDERED PAIR:
An ordered pair (a, b) consists of two elements “a” and “b” in
which “a” is the first element and “b” is the second element. The
ordered pairs (a, b) and (c, d) are equal if, and only if, a= c and
b = d.
Note that (a, b) and (b, a) are not equal unless a = b.

EXERCISE:
Find x and y given (2x, x + y ) = (6, 2).
SOLUTION:
Two ordered pairs are equal if and only if the corresponding
components are equal. Hence, we obtain the equations:

2x = 6 (1)
x +y = 2 (2)

Solving equation (1) we get x = 3 and when substituted value of x


in (2) we get y = -1.
Relations Discrete Mathematics 2/10
ORDERED n-TUPLE:
The ordered n-tuple, (a1 , a2 , . . . , an ) consists of elements
a1 , a2 , . . . , an together with the ordering: first a1 , second a2 , and
so forth up to an . In particular, an ordered 2- tuple is called an
ordered pair, and an ordered 3-tuple is called an ordered triple.
Two ordered n-tuples (a1 , a2 , . . . , an ) and (b1 , b2 , . . . , bn ) are equal
if and only if each corresponding pair of their elements is equal,
i.e., ai = bi , for all i = 1, 2, . . . , n.

CARTESIAN PRODUCT OF TWO SETS:


Let A and B be sets. The Cartesian product of A and B, denoted
A × B (read “A cross B”) is the set of all ordered pairs (a, b),
where a is in A and b is in B.
Symbolically:

A × B = {(a, b) | a ∈ A and b ∈ B}.

NOTE: If set A has m elements and set B has n elements then A


×B has m ×n elements.
Relations Discrete Mathematics 3/10
Example 1
Let A = {1, 2}, B = {a, b, c} then

A × B = {(1, a), (1, b), (1, c), (2, a), (2, b), (2, c)}
B × A = {(a, 1), (a, 2), (b, 1), (b, 2), (c, 1), (c, 2)}
A × A = {(1, 1), (1, 2), (2, 1), (2, 2)}
B × B = {(a, a), (a, b), (a, c), (b, a), (b, b), (b, c), (c, a), (c, b), (c, c)}

Remarks 0.1
1. A × B 6= B × A for non-empty and unequal sets A and B.
2. |A × B| = |A| × |B|

Relations Discrete Mathematics 4/10


CARTESIAN PRODUCT OF MORE THAN TWO SETS
The Cartesian product of sets A1 , A2 , . . . , An , denoted
A1 × A2 × . . . × An , is the set of all ordered n-tuples
(a1 , a2 , . . . , an ) where a1 ∈ A1 , a2 ∈ A2 , . . . , an ∈ An .
Symbolically:

A1 × A2 × . . . × An = {(a1 , a2 , . . . , an ) | ai ∈ Ai , for i=1,2,. . . , n}

Relations Discrete Mathematics 5/10


BINARY RELATION:
Let A and B be sets. A (binary) relation R from A to B is a subset
of A × B. When (a, b) ∈ R, we say a is related to b by R, written
a R b. Otherwise if (a, b) 6∈ R, we write a 6 Rb.

Example 2
Let A = {1, 2} and B = {1, 2, 3}. Then
A × B = {(1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (2, 3)}.
Let
R1 = {(1, 1), (1, 3), (2, 2)}
R2 = {(1, 2), (2, 1), (2, 2), (2, 3)}
R3 = {(1, 1)}
R4 = A × B
R5 = ∅
All being subsets of A × B are relations from A to B.

Relations Discrete Mathematics 6/10


DOMAIN OF A RELATION:
The domain of a relation R from A to B is the set of all first
elements of the ordered pairs which belong to R denoted Dom(R).
Symbolically:

Dom(R) = {a ∈ A | (a, b) ∈ R}

RANGE OF A RELATION:
The range of A relation R from A to B is the set of all second
elements of the ordered pairs which belong to R denoted Ran(R).
Symbolically:
Ran(R) = {b ∈ B | (a, b) ∈ R}

Relations Discrete Mathematics 7/10


Example
Let A = {1, 2}, B = {1, 2, 3},
Define a binary relation R from A to B as follows:

R = {(a, b) ∈ A × B | a < b}

Then
(a) Find the ordered pairs in R.
(b) Find the Domain and Range of R.
(c) Is 1R3, 2R2?
SOLUTION:
Given A = {1, 2}, B = {1, 2, 3},
A × B = {(1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (2, 3)}
(a) R = {(a, b) ∈ A × B | a < b}
R = {(1, 2), (1, 3), (2, 3)}
(b) Dom(R) = {1, 2} and Ran(R) = {2, 3}.
(c) Since (1, 3) ∈ R so 1R3 But (2, 2) 6∈ R so 2 is not related with
2.
Relations Discrete Mathematics 8/10
Example 3
Let A = {eggs, milk, corn} and B = {cows, goats, hens}
Define a relation R from A to B by (a, b) ∈ R iff a is produced by
b.
Then R = {(eggs, hens), (milk, cows), (milk, goats)} Thus,
with respect to this relation eggs R hens , milk R cows, etc.

Relations Discrete Mathematics 9/10


EXERCISE
Find all binary relations from {0, 1} to {1}.
SOLUTION:
Let A = {0, 1}&B = {1}
Then A × B = {(0, 1), (1, 1)}
All binary relations from A to B are in fact all subsets of A × B,
which are:
(1) R1 = ∅
(2) R2 = {(0, 1)}
(3) R3 = {(1, 1)}
(4) R4 = {(0, 1), (1, 1)} = A × B.

REMARK:
If |A| = m and |B| = n Then as we know that the number of
elements in A × B are m × n. Now as we know that the total
number of relations from A to B are 2m×n .

Relations Discrete Mathematics 10/10

You might also like