Lecture 1-2
Lecture 1-2
Discrete Structures
MUHAMMAD UMAR NASIR
LECTURER
FACULTY OF COMPUTING, RIPHAH INTERNATIONAL UNIVERSITY LAHORE
Set Theory
EXAMPLE:
Let A = {1, 3, 5} B = {1, 2, 3, 4, 5} C = {1, 2, 3, 4} D = {3, 1,
5}
Then
A ⊆ B ( Because every element of A is in B )
C ⊆ B ( Because every element of C is also an element of
B)
A ⊆ D ( Because every element of A is also an element of D
and also note that every element of D is in A so D ⊆ A )
A is not subset of C . ( Because there is an element 5 of A
which is not in C )
Proper Subset
For a set ‘S’ a set which contains all possible subsets of ‘S’ is
called power set of S. It is denoted by P(S).
Example: Let S= {a, b, c}
Then P(S) = {∅, {a}, {b}, {c}, {a, b}, {a, c},
{b, c}, {a, b, c}}
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)
and x + y = 2 ……………..(2)
Solving equation (1) we get x = 3 and when substituted in (2) we
get y = -1.
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 = bj, for all i, j = 1, 2, …, n.
Cartesian Product:
The Cartesian Product of two sets ‘A’ and ‘B’ in the order A x B is a
set of all possible 2-tuples where first element of each tuple is from
set ‘A’ and 2nd element of each tuple is from set ‘B’. The notation A2
denote A × A, the Cartesian product of the set A with itself.
Similarly, A3 = A × A × A, A4 = A × A × A × A, and so on.
Example: A= {1, 2}, B= {a, b}
A x B= {(1, a), (1, b), (2, a), (2, b)}
B x A= {(a, 1), (a, 2), (b, 1), (b, 2)}
Venn diagram