Unit 1 Basic Discrete Structures
Unit 1 Basic Discrete Structures
Sets
A set in discrete structure is an unordered collection of distinct objects
The objects in a set are called its elements
Sets are often denoted by capital letters, such as A, B, and C
The elements of a set can be anything, including numbers, letters, symbols, or even other
sets
There are many different types of sets, but some of the most common include:
Finite sets: Sets with a finite number of elements. For example, the set of all even
numbers between 1 and 10 is a finite set
Infinite sets: Sets with an infinite number of elements. For example, the set of all
natural numbers is an infinite set
Power sets: The set of all subsets of a given set. For example, the power set of the set
{1, 2, 3} is the set of all sets that can be formed by choosing zero or more elements
from {1, 2, 3}
Empty set: The set that contains no elements. The empty set is often denoted by the
symbol {}
Sets (contd)
Sets can be manipulated using a variety of operations, such as union, intersection,
difference, and complement
These operations are used to combine sets, compare sets, and find the difference between
sets
Sets are a fundamental concept in discrete mathematics, and they are used in many
different areas of mathematics, including computer science, logic, and probability
Here are some examples of sets in discrete structure:
The set of all even numbers between 1 and 10: {2, 4, 6, 8, 10}
The set of all natural numbers: {0, 1, 2, 3, ...}
The power set of the set {1, 2, 3}: {{}, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}}
The empty set: {}
Set Identities
Name Identity
Identity Law A∪∅=A A∩U=A
Domination Law A∪U=U A∩ ∅=∅
Idempotent Law A∪A=A A∩A=A
Complementation Law A’’ = A
Commutative Law A∪B=B∪A A∩B=B∩A
A ∪ (B ∪ C) = (A ∪ B) ∪ C
Associative Law
A ∩ (B ∩ C) = (A ∩ B) ∩ C
A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C)
Distributive Law
A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C)
De Morgan’s law (A ∩ B)’ = A’ ∪ B’ (A ∪ B)’ = A’ ∩ B’
Absorption Law A ∪ (A ∩ B) = A A ∩ (A ∪ B) = A
Complement Law A ∩ A’ = ∅ A ∪ A’ = U
Inclusion-Exclusion Principle
Computer representation of sets
Functions
A function in discrete mathematics is a rule that assigns each element of a set, called the
domain, to exactly one element of a second set, called the co-domain
The function is often denoted by f: X → Y, where X is the domain, Y is the co-domain, and
f is the name of the function
For example, the function f(x) = x^2 assigns each real number x to its square
The domain of this function is the set of all real numbers, and the co-domain is the set of
all real numbers
Functions are an important part of discrete mathematics, and they are used in many
different areas, including computer science, algorithms, and combinatorics.
Functions (contd.)
F(Ram) = A+
Injective Function
A function f is called onto, or a surjection, if every element y in the range is f(x) for some x
in the domain
Each element of y is mapped with at least one element of x. So, |x| >= |y|
|x| = |y|
Injections
Definition: A function f is said to be one-to-one , or
injective, if and only if f(a) = f(b) implies that a = b for
all a and b in the domain of f. A function is said to be
an injection if it is one-to-one.
Surjections
Definition: A function f from A to B is called onto or
surjective, if and only if for every element there is an
element with. A function f is called a surjection if it is
onto.
Bijections
Definition: A function f is a one-to-one correspondence, or
a bijection, if it is both one-to-one and onto (surjective and
injective).
Inverse Function
Composite Function
The Graphs of Functions
We can associate a set of pairs in A × B to each function from A to B. This set of pairs is called
the graph of the function and is often displayed pictorially to aid in understanding the behavior
of the function.
Let f be a function from the set A to the set B. The graph of the function f is the set of
ordered pairs {(a, b) | a ∈ A and f (a) = b}.
Check weather surjective or not?
a/2
The Graphs of Functions
Smallest
Highest
Boolean Function
Exponential Function
Types of Relation
Empty Relation: A relation R on a set A is called Empty if the set A is empty set.
Full Relation: A binary relation R on a set A and B is called full if AXB.
Reflexive Relation: A relation R on a set A is called reflexive if (a,a) € R holds for every
element a € A .i.e. if set A = {a,b} then R = {(a,a), (b,b)} is reflexive relation.
Irreflexive relation : A relation R on a set A is called reflexive if no (a,a) € R holds for
every element a € A.i.e. if set A = {a,b} then R = {(a,b), (b,a)} is irreflexive relation.
Symmetric Relation: A relation R on a set A is called symmetric if (b,a) € R holds when
(a,b) € R.i.e. The relation R={(4,5),(5,4),(6,5),(5,6)} on set A={4,5,6} is symmetric.
Types of Relations (contd.)
Let a = 1 and d = 2:
String
Definition: A string is a finite sequence of characters from a finite set (an alphabet).
Sequences of characters or bits are important in computer science.
The empty string is represented by λ.
The string abcde has length 5.
Recurrence Relations
A recurrence relation for the sequence {an} is an equation that expresses an in terms of one
or more of the previous terms of the sequence, namely, a0, a1, …, an-1, for all integers n
with n ≥ n0, where n0 is a nonnegative integer.
A sequence is called a solution of a recurrence relation if its terms satisfy the recurrence
relation.
The initial conditions for a sequence specify the terms that precede the first term where the
recurrence relation takes effect.
Recurrence Relations (contd.)
Let {an} be a sequence that satisfies the recurrence relation an = an-1 + 3 for n = 1,2,3,4,….
and suppose that a0 = 2. What are a1 , a2 and a3?
[Here a0 = 2 is the initial condition.]
Let {an} be a sequence that satisfies the recurrence relation an = an-1 – an-2 for n = 2,3,4,….
and suppose that a0 = 3 and a1 = 5. What are a2 and a3?
[Here the initial conditions are a0 = 3 and a1 = 5. ]
Answer:
f2 = f1 + f0 = 1 + 0 = 1,
f3 = f2 + f1 = 1 + 1 = 2,
f4 = f3 + f2 = 2 + 1 = 3,
f5 = f4 + f3 = 3 + 2 = 5,
f6 = f5 + f4 = 5 + 3 = 8.
Useful Sequences
Summations
Sum of the terms from the sequence
The notation:
represents
The variable j is called the index of summation. It runs through all the
integers starting with its lower limit m and ending with its upper limit n.
Summations (contd.)
Example:
Product Notation
represents
Geometric Series
Sums of terms of geometric progressions
∴
if r ≠1
if r = 1
Useful Sequences