Discrete PPT 11 11 22

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 143

DISCRETE STRUCTURES

SUBJECT CODE: CO205


AFTER MID SEM_11_10_22

Delhi Technological University


RELATION
 Any possible subset of cartesian product
A={1,2} B={a,b,c}
AxB={(1,a)(1,b),(1,c)(2,a)(2,b)(2,c)} // Ordered pair
R={(1,a)(1,b)(2,c)} is a subset of AxB
Max. possible reln=AxB
Min possible reln= ϕ
|A|=m,|B|=n
Total number of reln possible =2^m*n
TYPE OF RELATION
1.Reflexive Relation:
AxA ∀a∈A
(a,a) ∈R
Diagonal elements are allowed
A={(1,1),(2,2)(3,3)}
A set has n elements then 2^(n^2-n) Reflexive Relation are
possible.
2.Irreflexive Relation:
∀a∈A
(a,a) ∉R
Diagonal elements are not allowed
 A={(1,1),(2,1)(3,1)}
not irreflexive relation
3.Symmetric Relation:
∀a,b∈A
If (a,b)∈R then (b,a)∈R
A={(1,2),(1,3)(3,1)(2,1)}//Symmetric reln
A={(1,1),(1,2)(3,1)(1,3)}//Not Symmetric reln
4.AntiSymmetric Relation:
If (a,b)∈R then (b,a) ∉R
But diagonal pairs are allowed
A={(1,1),(1,2)(2,1)}//not AntiSymmetric reln
A={(1,1),(1,2)(2,2)}//Yes AntiSymmetric reln
5.Asymmetric Relation:
If (a,b)∈R then (b,a) ∉R
But diagonal pairs are not allowed
A={(1,1),(1,2)(2,1)}//not Asymmetric reln
A={(1,2)(3,1)}//yes Asymmetric reln
6.Transitive Relation:
∀a,b,c∈A
If (a,b) ∈ R (b,c) ∈ R then (a,c) ∈R
A={(1,2)(2,1)(2,3)(1,3)}// not transitive
EQUIVALENCE RELATIONS
A relation R on a set A is called an equivalence relation if it satisfies following three
properties:
Relation R is Reflexive, i.e. aRa ∀ a∈A.
Relation R is Symmetric, i.e., aRb ⟹ bRa
Relation R is transitive, i.e., aRb and bRc ⟹ aRc.
Example: Let A = {1, 2, 3, 4} and R = {(1, 1), (1, 3), (2, 2), (2, 4), (3, 1), (3, 3), (4,
2), (4, 4)}.
Show that R is an Equivalence Relation.
Solution:
Reflexive: Relation R is reflexive as (1, 1), (2, 2), (3, 3) and (4, 4) ∈ R.
Symmetric: Relation R is symmetric because whenever (a, b) ∈ R, (b, a) also
belongs to R.
Example: (2, 4) ∈ R ⟹ (4, 2) ∈ R.
Transitive: Relation R is transitive because whenever (a, b) and (b, c) belongs to R,
(a, c) also belongs to R.
Example: (3, 1) ∈ R and (1, 3) ∈ R ⟹ (3, 3) ∈ R.
So, as R is reflexive, symmetric and transitive, hence, R is an Equivalence Relation.
Note1: If R1and R2 are equivalence relation then R1∩ R2 is also an equivalence
relation.
 Note2: If R1and R2 are equivalence relation then R1∪
R2 may or may not be an equivalence relation.
 Example: A = {1, 2, 3}
                 R1 = {(1, 1), (2, 2), (3, 3), (1, 2), (2, 1)}
                 R2 = {(1, 1), (2, 2), (3, 3), (2, 3), (3, 2)}
                 R1∪ R2= {(1, 1), (2, 2), (3, 3), (1, 2), (2, 1), (2,
3), (3, 2)}
 Hence, Reflexive or Symmetric are Equivalence Relation
but transitive may or may not be an equivalence relation.
PARTIAL ORDER RELATIONS

Partial Order Relations


A relation R on a set A is called a partial order relation if it satisfies the
following three properties:
Relation R is Reflexive, i.e. aRa ∀ a∈A.
Relation R is Antisymmetric, i.e., aRb and bRa ⟹ a = b.
Relation R is transitive, i.e., aRb and bRc ⟹ aRc.
Example1: Show whether the relation (x, y) ∈ R, if, x ≥ y defined on the set
of +ve integers is a partial order relation.
Solution: Consider the set A = {1, 2, 3, 4} containing four +ve integers. Find
the relation for this set such as R = {(2, 1), (3, 1), (3, 2), (4, 1), (4, 2), (4, 3),
(1, 1), (2, 2), (3, 3), (4, 4)}.
Reflexive: The relation is reflexive as for every a ∈ A. (a, a) ∈ R, i.e. (1, 1),
(2, 2), (3, 3), (4, 4) ∈ R.
Antisymmetric: The relation is antisymmetric as whenever (a, b) and (b, a)
∈ R, we have a = b.
Transitive: The relation is transitive as whenever (a, b) and (b, c) ∈ R, we
have (a, c) ∈ R.
Example: (4, 2) ∈ R and (2, 1) ∈ R, implies (4, 1) ∈ R.
FUNCTION
 A to B is a relation is said to be a function if every element
of A is mapped with exactly one element of B.
SET A (preimage-a,b)SET B(image-1,2)

1
a
2
b
3

Range(1,2) is subset of Codomain(1,2,3)


A function can be one to one or many to one but not one to
many.
 SET A has M elements and Set B has n elements then
total no of function possible from A to B = n^m.
Types of function:
1. One to One /Injective function

1
a
2
b
3
 |A|<=|B|
every element of A has distinct image in B
 f: A ⇢ B is one-one 

 ⇒  a ≠ b ⇒  f(a) ≠ f(b)           for all a, b ∈  A

 ⇒  f(a) = f(b) ⇒ a = b           for all a, b ∈  A


 2. Onto/Surjective function:

a 1

b 2

|A|>=|B|
Codomain=Range
A function f: A -> B is said to be onto (surjective) function if every
element of B is an image of some element of A  i.e. f(A) = B or range of f
is the codomain of f.
A function in which every element of the codomain has one pre-image.
 f: A ⇢ B is onto if for each b∈ B, there exists a∈ A such that f(a) =
b.
INTO FUNCTION:

 A function f: A ⇢ B is said to be an into a function if


there exists an element in B with no pre-image in A.
 A function f: A⇢ B is into function when it is not onto.
BIJECTIVE FUNCTION:

Bijective Function:
|A|=|B|
If function is both one-one and onto then it is called
bijective function.
 f : A ⇢ B is one-one correspondent (bijective) if:
 one-one i.e. f(a) = f(b) ⇒ a = b           for all a, b ∈  A
 onto i.e.  for each b ∈ B, there exists a ∈ A such that f(a) = b.
COMPOSITE FUNCTIONS DEFINITION

 Let f : A → B and g : B → C be two functions. Then the


composition of f and g, denoted by g ∘ f, is defined as
the function g ∘ f : A → C given by
 g ∘ f (x) = g(f (x)), ∀ x ∈ A.
 Symbol: It is also denoted as (g∘f)(x), where ∘ is a
small circle symbol. We cannot replace ∘ with a dot (.),
because it will show as the product of two functions,
such as (g.f)(x).
 Domain: f(g(x)) is read as f of g of x. In the composition
of (f o g) (x) the domain of function f becomes g(x). The
domain is a set of all values which go into the function.
 Example: If f(x) = 3x+1 and g(x) = x2 , then f of g of x,
f(g(x)) = f(x2) = 3x2+1.
 If we reverse the function operation, such as f of f of x,
g(f(x)) = g(3x+1) = (3x+1)2
PROPERTIES OF FUNCTION
COMPOSITIONS

 Associative Property: As per the associative property of


function composition, if there are three functions f, g and
h, then they are said to be associative if and only if;
f ∘ (g ∘ h) = (f ∘ g) ∘ h
 Few more properties are:

 The function composition of one-to-one function is


always one to one.
 The function composition of two onto function is always
onto
 Composition consistently holds associative property but
does not hold commutative property.
MATHEMATICAL FUNCTIONS

 1. Floor Functions: The floor function for any real


number x is defined as f (x) is the greatest integer 1 less
than or equal to x. It is denoted by [x].
 Example: Determine the value of

(i)[3. 5]       (ii)[-2.4]       (iii)[3. 143].

 1) [3 . 5] = 3 (ii) [-2 .4] = -3 (iii) [3. 143] = 3


 Ceiling Functions: The ceiling function for any real
number x is defined as h (x) is the smallest integer greater
than or equal to x. It is denoted by [x].
 Example: Determine the value of

 (i)[3. 5]       (ii) [-2.4]       (iii) [3. 143]


(i) 35 (MOD 7) = 0 (ii) 20 (MOD 3) = 2 (iii) 4 (MOD 9) = 4

 3. Remainder Functions: The integer remainder is


obtained when some a is divided by m. It is denoted by a
(MOD m). We can also define it as, a (MOD m) is the
unique integer t such that a = Mq + t. Here q is quotient
0 ≤ r < M.
Example: Determine the value of the following:
(i) 35 (MOD 7)       (ii) 20 (MOD 3)       (iii) 4 (MOD 9)
 (i) 35 (MOD 7) = 0 (ii) 20 (MOD 3) = 2 (iii) 4 (MOD 9)
=4
 Exponential Functions: Consider two sets A and B. Let
A = B = I+ and also let f: A → B be defined by f (n) = kn.
Here n is a +ve integer. The function f is called the base
k exponential function.
 Example: Determine the value of the following:

 (i) 103       (ii) 51/2       (iii) 3-5

103= 10. 10. 10 = 1000 51/2=2.23607


 5. Logarithmic Functions: Consider two sets A and B.
Let A = B = R (the set of real numbers and also let
f_n:A→B be defined for each positive integer n > 1 as
fn (x)=logn(x)
 Note1: k = logn x and nk are equivalent.
2. For any base n, logn 1=0 as n0=1.
3. For any base n, logn n=1 as n1=n
INVERSE FUNCTION
INVERSE RELATION
 Suppose R is a relation of the form {(x, y): x ∈ A and y
∈ B} such that the inverse relation of R is denoted by R-
1
 and R-1 = {(y, x): y ∈ B and x ∈ A}. If R is from A to
B, then R-1 is from B to A. In other words, if (x, y) ∈ R,
then (y, x) ∈ R-1 and vice versa. Also, we know that
relation in sets is a subset of the Cartesian product of
sets, i.e. R is a subset of A x B, and R-1 is a subset of B x
A.
Find the inverse of a relation R represented by {(-15, -4), (-18, -8),
(-6, 2), (-12.55, 3)} and write the domain and range of the inverse
relation.
Solution:
Given,
R = {(-15, -4), (-18, -8), (-6, 2), (-12.55, 3)}
Domain = {-15, -18, -6, -12.55}
Range = {-4, -8, 2, 3}
Inverse of R = R-1 = {(-4, -15), (-8, -18), (2, -6), (3, -12.55)}
Domain of R-1 = {-4, -8, 2, 3}
Range of R-1 = {-15, -18, -6, -12.55}
COMPLIMENT OF A RELATION
 Compliment of a relation will contain all the pairs where
pair do not belong to relation but belongs to Cartesian
product.
 R(C) = A * B – R

A = { 1, 2} B = { 3, 4} R = { (1, 3) (2, 4) } Then the complement of R


Rc = { (1, 4) (2, 3) }
CLOSURE OF A RELATION
TRANSITIVE CLOSURE
TRANSITIVE CLOSURE USING
WARSHALL’S ALGORITHM
PERMUTATION FUNCTION
 Bijective function A->B(one-one & onto)
 Bijection on same set(A->A or B->B) is called
Permutation function
 Permutation Function is special case of bijection only

 Every Permutation Function is bijection but vice versa


not true
Bijective
Function

PF
 Every PF has unique inverse as PF is bijective only
 Not a pf

 Every identity function is always a PF


 If f o g exists then gof exists in PF as fog and gof on
same set A
fog≠gof(not commutative) but commutative in case of
power f^m o f^n = f^n o f^m
f o f^-1=f^-1 o f= Ia
PF IS EVEN OR ODD
 Cyclic PF = ATMOST ONE CYCLE
 Self loop is not a cycle
 Therefore atmost one cycle exists so it is Cyclic PF
THEORM
Every PF which is not a cycle can be broken into product of 2
ore more disjoint cycles
Note: composition of disjoint cycle can be
commutative(5-6 then 1-4)
Here cycle is converted into PF with help of self loop
OTHER EXAMPLE
EVEN PF

Here transposition are 4 which is even


therefore it is even PF
IDENTITY FUNCTION
 Identity is a cycle PF so cant broke down
 And it is even (0 transposition)
 Every PF has atleast one cycle
 Identity function has no cycle

 Every Identity function is even PF


BOOLEAN PRODUCT OF MATRICES
 NO disjoint in transposition
ODD PF
BINARY AND N-ARY OPERATIONS
 Consider a non-empty set A and α function f: AxA→A is
called a binary operation on A. If * is a binary operation
on A, then it may be written as a*b.
 A binary operation can be denoted by any of the symbols
+,-,*,⨁,△,⊡,∨,∧ etc.
 The value of the binary operation is denoted by placing
the operator between the two operands.
EXAMPLES
1. The operation of addition is a binary operation on the set of
natural numbers.
2. The operation of subtraction is a binary operation on the set of
integers. But, the operation of subtraction is not a binary
operation on the set of natural numbers because the subtraction
of two natural numbers may or may not be a natural number.
3. The operation of multiplication is a binary operation on the set
of natural numbers, set of integers and set of complex
numbers.
4. The operation of the set union is a binary operation on the set
of subsets of a Universal set. Similarly, the operation of set
intersection is a binary operation on the set of subsets of a
universal set.
N-ARY OPERATION:

 A function f: AxAx.............A→A is called an n-ary


operation.
 Tables of Operation:

* a1 a2 a3 an
a1 a1*a1
a2 a2*a2
a3 a3*a3

an an*an
 Consider the set A = {1, 2, 3} and a binary operation *
on the set A defined by a * b = 2a+2b.
 Represent operation * as a table on A.

* 1 2 3
1 4 6 8
2 6 8 10
3 8 10 12
PROPERTIES OF BINARY OPERATIONS
1. Closure Property: Consider a non-empty set A and a binary operation * on A.
Then A is closed under the operation *, if a * b ∈ A, where a and b are elements
of A.
Example1: The operation of addition on the set of integers is a closed operation.
Example2: Consider the set A = {-1, 0, 1}. Determine whether A is closed under
Addition
Multiplication
Solution:
(i)The sum of elements is (-1) + (-1) = -2 and 1+1=2 does not belong to A.
Hence A is not closed under addition.
(ii) The multiplication of every two elements of the set are
              -1 * 0 = 0;         -1 * 1 =-1; -1 * -1 = 1
              0 * -1 = 0;         0 * 1 = 0; 0 * 0 = 0
              1 * -1 = -1;         1 * 0 = 0; 1 * 1 = 1
Since, each multiplication belongs to A hence A is closed under multiplication.
2. Associative Property: Consider a non-empty set A and a binary operation *
on A. Then the operation * on A is associative, if for every a, b, c, ∈ A, we
have (a * b) * c = a* (b*c).
Example: Consider the binary operation * on Q, the set of rational numbers,
defined by a * b = a + b - ab ∀ a, b ∈ Q.
Determine whether * is associative.
Solution: Let us assume some elements a, b, c ∈ Q, then the definition
              (a*b) * c = (a + b- ab) * c = (a + b- ab) + c - (a + b- ab)c
                      = a + b- ab + c - ca -bc + abc = a + b + c - ab - ac -bc + abc.
Similarly, we have
              a * (b * c) = a + b + c - ab - ac -bc + abc
Therefore,         (a * b) * c = a * (b * c)
Hence, * is associative.
3. Commutative Property: Consider a non-empty set A,and a binary operation *
on A. Then the operation * on A is associative, if for every a, b, ∈ A, we have a *
b = b * a.
Example: Consider the binary operation * on Q, the set of rational numbers,
defined by a * b = a2+b2 ∀ a,b∈Q.
Determine whether * is commutative.
Solution: Let us assume some elements a, b, ∈ Q, then definition
              a * b = a2+b2=b * a
Hence, * is commutative.
GROUP THEORY
SEMIGROUP
MONOID
ADDITION AND MULTIPLICATIVE
IDENTITY IN MATRIX
(N,*) IS NOT GROUP
(Z,*) IS NOT GROUP
ABELIAN GROUP
ABELIAN GROUP
EXAMPLES OF ABELIAN GROUP
SUBGROUP
CYCLIC GROUP
UPPER BOUND AND LEAST UPPER
BOUND
PARTIAL ORDER RELATION
POSET
HASSE DIAGRAM
JOIN SEMILATTICE
MEET SEMILATTICE
LATTICE
SUBLATTICE

DIRECT PRODUCT OF LATTICES
LATTICE HOMOMORPHISM
BOUNDED LATTICE
COMPLEMENT LATTICE
DISTRIBUTIVE LATTICE
OTHER METHOD TO CHECK
DISTRIBUTIVE OR NOT
BOOLEAN ALGEBRA OF LATTICES
SIMPLIFICATION OF BOOLEAN
EXPRESSION
NO SUB ALGEBRA WHERE ODD
ELEMENTS
Thank You

You might also like