0% found this document useful (0 votes)
73 views

Monograph PDF

The document defines key concepts related to sets including: - A set is a collection of distinct elements that can be written explicitly or using set builder notation. - Sets can be represented using a roster form by listing elements or a set builder notation specifying a common property. - The cardinality of a set is the number of elements it contains, which can be finite or infinite. - Types of sets include finite, infinite, subset, proper subset, universal, empty, singleton, equal, equivalent, overlapping, and disjoint sets. - Set operations like union, intersection, difference, and complement are defined along with properties like De Morgan's laws, associative laws, and distributive laws.

Uploaded by

Ālok Kr
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
73 views

Monograph PDF

The document defines key concepts related to sets including: - A set is a collection of distinct elements that can be written explicitly or using set builder notation. - Sets can be represented using a roster form by listing elements or a set builder notation specifying a common property. - The cardinality of a set is the number of elements it contains, which can be finite or infinite. - Types of sets include finite, infinite, subset, proper subset, universal, empty, singleton, equal, equivalent, overlapping, and disjoint sets. - Set operations like union, intersection, difference, and complement are defined along with properties like De Morgan's laws, associative laws, and distributive laws.

Uploaded by

Ālok Kr
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 49

UNIVERSITY INSTITUTE OF ENGINEERING

Academic unit-1 BE :CSE(All IT branches)


Sub:DISCRETE MATHEMATICS Sub Code-SMT-174
UNIT-1
SET
Definition:-A set is a collection of well defined and different elements. A set can be written
explicitly by listing its elements using curly bracket. If the order of the elements is changed or
any element of a set is repeated, it does not make any changes in the set.

Representation of a Set:-
Sets can be represented in two ways:

(i) Roster or Tabular Form


(ii) Set Builder Notation

Roster or Tabular Form:-The set is represented by listing all the elements comprising it. The
elements are enclosed within braces and separated by commas.

Example 1: Set of vowels in English alphabet, A = {a,e,i,o,u}

Example 2: Set of odd numbers less than 10, B = {1,3,5,7,9}

Set Builder Notation:-The set is defined by specifying a property that elements of the set
have in common. The set is described as A = {x: p(x)}

Example 1: The set {a,e,i,o,u} is written as:

A = {x : x is a vowel in English alphabet}

Example 2: The set {1,3,5,7,9} is written as: B ={x : 1≤x<10 and (x%2) ≠ 0}
If an element x is a member of any set S, it is denoted by x∈ S and if an element y is not a
member of set S, it is denoted by y ∉ S.

Example: If S = {1, 1.2,1.7,2}, 1∈ S but 1.5 ∉S

Cardinality of a Set: - Cardinality of a set S, denoted by |S|, is the number of elements of


the set. The number is also referred as the cardinal number. If a set has an infinite number of
elements, its cardinality is ∞.

Example: |{1, 4, 3,5}| = 4, |{1, 2, 3,4,5,…}| = ∞

Types of Sets: - Sets can be classified into many types. Some of which are finite, infinite,
subset, universal, proper, singleton set, etc.

Finite Set:-A set which contains a definite number of elements is called a finite set.
Example: S = {x | x∈N and 70 > x > 50}

Infinite Set: - A set which contains infinite number of elements is called an infinite set.
Example: S = {x | x∈N and x > 10}

Subset: - A set X is a subset of set Y (Written as X ⊆ Y) if every element of X is an element of


set Y.

Example 1: Let, X = {1, 2, 3, 4, 5, 6 } and Y = { 1, 2 }. Here set Y is a subset ofset X as all the
elements of set Y is in set X. Hence, we can write Y ⊆ X.

Example 2: Let, X = {1, 2, 3} and Y = {1, 2, 3}. Here set Y is a subset (Not a propersubset) of
set X as all the elements of set Y is in set X. Hence, we can write Y ⊆ X.

Proper Subset: - The term “proper subset” can be defined as “subset of but not equal to”. A
Set X is aproper subset of set Y (Written as X ⊂ Y) if every element of X is an element of set Y
and |X| < |Y|.

Example: Let, X = {1, 2, 3, 4, 5, 6} and Y = {1, 2}. Here set Y⊂X since all elementsin Y are
contained in X too and X has at least one element is more than set Y.

Universal Set:-It is a collection of all elements in a particular context or application. All the
sets in that context or application are essentially subsets of this universal set. Universal sets are
represented as U.

Example: We may define U as the set of all animals on earth. In this case, set of allmammals
is a subset of U, set of all fishes is a subset of U, set of all insects is a subset of U, and so on.
Empty Set or Null Set:-An empty set contains no elements. It is denoted by ∅. As the
number of elements in an empty set is finite, empty set is a finite set. The cardinality of empty
set or null set is zero.

Example: S = {x | x∈N and 7 < x < 8} =∅

Singleton Set or Unit Set:-Singleton set or unit set contains only one element. A singleton
set is denoted by {s}.

Example: S = {x | x∈N, 7 < x < 9} = { 8 }

Equal Set:-If two sets contain the same elements they are said to be equal.
Example: If A = {1, 2, 6} and B = {6, 1, 2}, they are equal as every element of setA is an
element of set B and every element of set B is an element of set A.

Equivalent Set:-If the cardinalities of two sets are same, they are called equivalent sets.
Example: If A = {1, 2, 6} and B = {16, 17, 22}, they are equivalent as cardinality of Ais equal to
the cardinality of B. i.e. |A|=|B|=3

Overlapping Set:-Two sets that have at least one common element are called overlapping
sets.In case of overlapping sets:

1. n(A ∪ B) = n(A) + n(B) - n(A ∩ B)


2. n(A ∪ B) = n(A - B) + n(B - A) + n(A ∩ B)

3. n(A) = n(A - B) + n(A ∩ B)

4. n(B) = n(B - A) + n(A ∩ B)

Example: Let, A = {1, 2, 6} and B = {6, 12, 42}.There is a common element ‘6’,hencethese sets
are overlapping sets.

Disjoint Set:-Two sets A and B are called disjoint sets if they do not have even one element in
common.Therefore, disjoint sets have the following properties:

1. n(A ∩ B) = ∅
2. n(A ∪ B) = n(A) + n(B)

Example: Let, A = {1, 2, 6} and B = {7, 9, 14}; there is not a single common element,hence these
sets are overlapping sets.

Venn Diagrams:-Venn diagram, invented in1880 by John Venn, is a schematic diagram that
shows all possible logical relations between different mathematical sets.

Examples

Set Operations:-Set Operations include Set Union, Set Intersection, Set Difference,
Complement of Set, and Cartesian Product.

Set Union:-The union of sets A and B (denoted by A ∪ B) is the set of elements which are in A,
in B, or in both A and B. Hence, A∪B = {x | x ∈A OR x ∈B}.

Example: If A = {10, 11, 12, 13} and B = {13, 14, 15}, then A∪B = {10, 11, 12, 13,14, 15}. (The
common element occurs only once)

A B

Figure: Venn diagram of A∪B


Set Intersection:-The intersection of sets A and B (denoted by A ∩ B) is the set of elements
which are in both A and B. Hence, A∩B = {x | x ∈A AND x ∈B}.

Example: If A = {11, 12, 13} and B = {13, 14, 15}, then A∩B = {13}.

Figure: Venn Diagram of A∩B

Set Difference/ Relative Complement:-The set difference of sets A and B (denoted by A–


B) is the set of elements which are only in A but not in B. Hence, A−B = {x | x ∈A and x ∉B}.

Example: If A = {10, 11, 12, 13} and B = {13, 14, 15}, then (A−B) = {10, 11, 12} and(B−A) =
{14,15}. Here, we can see (A−B) ≠ (B−A)

A A

B B

Figure: Venn Diagram of A–B and B–A

Complement of a Set:-The complement of a set A (denoted by A’) is the set of elements


which are not in set A.Hence, A' = {x | x ∉A}.
More specifically, A'= (U–A) where U is a universal set which contains all objects.

Example: If A ={x | x belongs to set of odd integers} then A' ={y | y does not belongto set of
odd integers}

Figure: Venn Diagram of A'

# State and Prove De-Morgan’s laws


(i)(AB)C=(ACBC)
PROOF x(AB)C = x (AB) = xAC and  BC = xAC and BC = x ACBC

So (AB)C is a subset of (ACBC)

Similarly (ACBC) is a subset of (AB)C

Therefore (AB)C=(ACBC)

(ii)(A B)C=ACBC
PROOF
x (A B)C =x (A B)= x A or x B = x AC or x BC = x ACBC

So (A B)Cis a subset of ACBC

Similarly ACBCis a subset of (A B)C

Therefore (A B)C=ACBC

Associative law

1. (A U B) U C = AU (BUC)
2. (AՌ B) Ռ 𝐂 = A Ռ (BՌ 𝐂)

1. (A U B) U C = A U (BUC)
Let x be any arbitrary element of (A U B). then
 X ∈(AUB) U C = X ∈(AUB) OR X ∈ C
 X ∈ 𝐴 OR X∈ 𝐵 OR X∈ 𝐶
 X ∈ 𝐴 OR ( X∈ 𝐵 OR X∈ 𝐶)
 X ∈ 𝐴 OR (X∈(B U C))
 X ∈ 𝐴 𝑈(B U C)
 (AUB) U C ⊊ 𝐴 𝑈(𝐵 𝑈 𝐶)………….1

A U (BUC) =>X ∈ 𝐴 OR X∈ (B U C)

 X ∈ 𝐴 OR X∈ 𝐵 OR X∈ 𝐶
 X ∈ 𝐴 OR ( X∈ 𝐵) OR X∈ 𝐶
 X ∈ (A U B) OR X∈ 𝐶
 X ∈ ( A U B) U C
 A U (BUC) ⊊(A U B) U C………………..2
From eqn 1 and 2 we get
(A U B) U C = A U (BUC)

2. (AՌ B) Ռ 𝐂 = A Ռ (BՌ 𝐂)
Let X ∈(A Ռ B) Ռ C => X ∈(A Ռ B)and X∈ C
 (X ∈ 𝐴and X∈ 𝐵) and X∈ 𝐶
 X ∈ 𝐴 and ( X∈ 𝐵 and X∈ 𝐶)
 X ∈ 𝐴 and (X∈(BՌ C))
 X ∈ 𝐴 Ռ(B Ռ C)
 (A Ռ B)Ռ C ⊊ 𝐴 Ռ(𝐵 Ռ 𝐶)………….1
Let x ∈ 𝐴 Ռ(𝐵 Ռ 𝐶) =>X∈ 𝐴and X∈ (B Ռ C)
 (X ∈ 𝐴and X∈ 𝐵) and X∈ 𝐶
 (X ∈ 𝐴 ՌB) and X∈ 𝐶
 X ∈ (𝐴 ՌB) Ռ 𝐶
 A Ռ (B Ռ C) ⊊(A Ռ B) Ռ C………………...2
From eqn 1 and 2 we get

(AՌ B) Ռ C = A Ռ (BՌ C)

Commutative law

1. A U B =B U A
2. A Ո B =B Ո A
1. A U B =B U A
Let x be any arbitrary element of A U B. Then
X ∈(A U B) = { X: X ∈A OR X ∈B }
 X: X ∈B OR X∈A
 X ∈B U A
 X ∈(A UB) =>X ∈(B U A)
 A U B ⊊B U A ………………….1
Similarly
X ∈(B U A)= { X : X ∈B OR X∈A }
 { X : X ∈B OR X∈A }
 X: X ∈(A U B)
 X ∈(B U A) =>X ∈(A U B)
 B U A ⊊ A U B ………………2
From eqn 1 and 2 we get
A U B =B U A
2. A Ո B =B Ո A
Let x be any arbitrary element of A U B. Then
X ∈(A Ո B) = { X: X ∈A and X ∈B }
 X: X ∈B and X∈A
 X ∈B Ո A
 X ∈(A ՈB) =>X ∈(B Ո A)
 A Ո B ⊊B Ո A ………………….1
Similarly
X ∈(B Ո A)= { X : X ∈B and X∈A }
 { X : X ∈B and X∈A }
 X: X ∈(A Ո B)
 X ∈(B Ո A) =>X ∈(A Ո B)
 B Ո A ⊊ AՈ B ………………2
From eqn 1 and 2 we get
A Ո B =B Ո A

Distributive Law
1. Union of sets distributive w.r.t intersection of sets.
A U (B Ո C) = (A U B) Ո (A U C)
2. Intersection of sets is distributive w.r.t union of sets.
A Ո(B U C) = (A Ո B) U (A Ո C)
1. A U (B Ո C) = (A U B) Ո (A U C)
Let X ∈A U (BՈ C) =>X ∈ 𝐴 𝑂𝑅 X ∈ (BՈC)
 X ∈ 𝐴 𝑂𝑅 (X∈ 𝐵 𝑂𝑅 X ∈ 𝐶)
 (X ∈ 𝐴 𝑂𝑅X∈ 𝐵) AND (X∈ 𝐴 𝑂𝑅 (X∈ 𝐶)
 X ∈(A U B) AND X∈ (A U C)
 X ∈(A U B) Ո (A U C)
A U(B U C) ⊊ (𝐴 𝑈 𝐵)Ո (A U C)……………1

Similarly

(A U B) Ո(A U C) ⊊ 𝐴 𝑈 (𝐵 Ո C)…………..2
From eqn 1 and 2 we get

A U (BՈ C) = (A U B) Ո (A U C)

2. A Ո(B U C) = (A Ո B) U (A Ո C)
Let X ∈A Ո (BU C) =>X ∈ 𝐴 𝐴𝑁𝐷 X ∈ (BU C)
 X ∈ 𝐴 𝐴𝑁𝐷 (X∈ 𝐵 𝐴𝑁𝐷 X ∈ 𝐶)
 (X ∈ 𝐴 𝐴𝑁𝐷X∈ 𝐵) OR (X∈ 𝐴 𝐴𝑁𝐷 (X∈ 𝐶)
 X ∈(A Ո B) ORX ∈ (A Ո C)
 X ∈(A Ո B) U (A Ո C)
A Ո (B Ո C) ⊊ (𝐴 Ո 𝐵)Ո (A Ո C)……………1

Similarly

(A Ո B) U(A Ո C) ⊊ 𝐴Ո(𝐵 U C)…………..2


From eqn 1 and 2 we get

A Ո (BU C) = (A Ո B) U (A Ո C)
Cartesian Product / Cross Product:-The Cartesian product of n number of sets A1,
A2.....An, denoted as A1× A2 ×..... × An, can be defined as all possible ordered pairs (x1,x2,....xn)
where x1∈ A1 , x2∈ A2 , ...... xn∈ An .

Example: If we take two sets A= {a, b} and B= {1, 2},

The Cartesian product of A and B is written as: A×B= {(a, 1), (a, 2), (b, 1), (b, 2)}

The Cartesian product of B and A is written as: B×A= {(1, a), (1, b), (2, a), (2, b)}
Power Set:-Power set of a set S is the set of all subsets of S including the empty set. The
cardinality of a power set of a set S of cardinality n is 2n. Power set is denoted as P(S).

Example:For a set S = {a, b, c, d}

P(S) ={ {∅},{a}, {b}, {c}, {d},{a,b}, {a,c}, {a,d}, {b,c},{b,d},{c,d},{a,b,c},{a,b,d},{a,c,d},{b,c,d},{a,b,c,d}


}

| P(S) | = 24 =16

Partitioning of a Set:-Partition of a set, say S, is a collection of ndisjoint subsets, say P1,


P2,...… Pn, that satisfiesthe following three conditions:

1. Pi does not contain the empty set. [ Pi ≠ {∅} for all 0 < i ≤ n]

2. The union of the subsets must equal the entire original set. [P1
∪ P2 ∪ .....∪Pn = S]

3. The intersection of any two distinct sets is empty.


[Pa ∩Pb={∅}, for a ≠ b where n ≥ a, b ≥ 0 ]

Example

Let S = {a, b, c, d, e, f, g, h}

One probable partitioning is {a}, {b, c, d}, {e, f, g,h}

Another probable partitioning is {a,b}, { c, d}, {e, f, g,h}

The Inclusion-Exclusion principle:-The Inclusion-exclusion principle computes the cardinal


number of the union of multiple non-disjoint sets. For two sets A and B, the principle states:

|A ∪B| = |A| + |B| – |A∩B|

For three sets A, B and C, the principle states: |A∪B∪C | = |A| + |B| + |C| – |A∩B| –

|A∩C| – |B∩C| + |A∩B∩C |


RELATION
Relations may exist between objects of the same set or between objects of two or more sets.

Definition:-A binary relation R from set x to y (written as xRy or R(x,y)) is a subset of the
Cartesian product x × y. If the ordered pair of G is reversed, the relation also changes.

Generally an n-ary relation R between sets A1, ... , and An is a subset of the n-ary product
A1×...×An. The minimum cardinality of a relation R is Zero and maximum is n2 in this case.

A binary relation R on a single set A is a subset of A × A.

For two distinct sets, A and B, having cardinalities m and n respectively, the maximum
cardinality of a relation R from A to B is mn.

Domain and Range:-


If there are two sets A and B, and relation R has order pair (x, y), then:

The domain of R, Dom(R), is the set { x | (x, y) ∈ R for some y in B }


The range of R, Ran(R), is the set { y | (x, y) ∈ R for some x in A }

Types of Relations:
1. The Empty Relation between sets X and Y, or on E, is the empty set ∅.
2. The Full Relation between sets X and Y is the set X×Y.
3. The Identity Relation on set X is the set {(x,x) | x ∈ X}
4. The Inverse Relation R' of a relation R is defined as: R’= {(b,a) | (a,b) ∈R}

Example: If R = {(1, 2), (2,3)} then R’will be {(2,1), (3,2)}

5. A relation R on set A is called Reflexive if ∀a∈A is related to a (aRa holds).


Example: The relation R = {(a,a), (b,b)} on set X={a,b} is reflexive

6. A relation R on set A is called Irreflexive if no a∈A is related to a (aRa does not hold).
Example: The relation R = {(a,b), (b,a)} on set X={a,b} is irreflexive

7. A relation R on set A is called Symmetric if xRy implies yRx, ∀x∈A and ∀y∈A.

Example: The relation R = {(1, 2), (2, 1), (3, 2), (2, 3)} on set A={1, 2, 3} issymmetric.

8. A relation R on set A is called Anti-Symmetric if xRy and yRx implies x=y ∀x


∈ A and ∀y ∈ A.

Example: The relation R = { (x,y)∈N | x ≤ y } is anti-symmetric since x ≤ yand y ≤ x implies


x = y.

9. A relation R on set A is called Transitive if xRy and yRz implies xRz, ∀x,y,z∈ A. Example:
The relation R = {(1, 2), (2, 3), (1, 3)} on set A= {1, 2, 3} is transitive.

10. A relation is an Equivalence Relation if it is reflexive, symmetric, and transitive.

Example: The relation R = {(1, 1), (2, 2), (3, 3), (1, 2),(2,1), (2,3), (3,2), (1,3),(3,1)} on set
A= {1, 2, 3} is an equivalence relation since it is reflexive, symmetric, and transitive.

11. Partially Ordered Set (POSET):- A partially ordered set consists of a set with a binary
relation which is reflexive, anti-symmetric and transitive. "Partially ordered set" is
abbreviated as POSET.

Define Equivalence Relation and Prove ‘’=’’ is an Equivalence relation

Proof- For a relation R to be an equivalence relation, it must have the following properties, viz. R must
be:

• reflexive

• symmetric

• transitive

Proof Reflexive
Clearly, it is true that a = a for all values a. So = is reflexive.

Symmetric

If a = b, it is also true that b = a. So = is symmetric.

Transitive

If a = b and b = c, this says that a is the same as b which in turn is the same as c. So a is then the same as
c, so a = c, and thus = is transitive.

Thus = is an equivalence relation.

FUNCTION
Definition:A function or mapping (Defined as f: X→Y) is a relationship from elements of one
set X to elements of another set Y (X and Y are non-empty sets). X is called Domain and Y is
called Codomain of function ‘f’.

Function ‘f’ is a relation on X and Y such that for each x ∈ X, there exists a unique y ∈ Y such
that (x,y) ∈ R. ‘x’ is called pre-image and ‘y’ is called image of function f.

A function can be one to one or many to one but not one to many.

Injective / One-to-one function:-A function f: A→B is injective or one-to-one function if


for every y∈ B, there exists at most one x∈ A such that f(x) = y.

This means a function f is injective if x1≠ x2 implies f(x1) ≠ f(x2).

For example, if we define

f(x) = x2

then we have

f( - 1) = 1 f(1) = 1 f(7) = 49 f(1 / 2) = 1 / 4 f(4) = 16

f, in this instance, maps numbers to their squares.

#TYPES OF FUNCTIONS

This is not 1-1 function.


Surjective / Onto function:-A function f: A →B is surjective (onto) if the image of f equals
its range. Equivalently, for every b ∈ B, there exists some a ∈ A such that f(a) = b. This means
that for any y in B, there exists some x in A such that y = f(x).

Bijective / One-to-one Correspondence:-A function f: A →B is bijective or one-to-one


correspondent if and only if f is both injective and surjective.

Inverse of a Function:-The inverse of a one-to-one corresponding function f : A → B, is the


function g : B →A, holding the following property:

f(x) = y and g(y) = x

The function f is called invertible, if its inverse function g exists.

Composition of Functions:-Two functions f: A→B and g: B→C can be composed to give a


composition g o f. This is a function from A to C defined by (gof)(x) = g(f(x)).

Note:-

1. If f and g are one-to-one then the function (g o f) is also one-to-one.


2. If f and g are onto then the function (g o f) is also onto.
3. Composition always holds associative property but does not hold commutative
property.

Mathematical induction

Mathematical induction is a technique for proving results or establishing statementsfor natural


numbers. This part illustrates the method through a variety of examples.

Definition:-Mathematical Induction is a mathematical technique which is used to prove


astatement, a formula or a theorem is true for every natural number.
The technique involves two steps to prove a statement, as stated below:

Step 1(Base step): It proves that a statement is true for the initial value.

Step 2(Inductive step): It proves that if the statement is true for thenthiteration (ornumber n),
then it is also true for (n+1)th iteration ( or number n+1).

How to Do It:-

Step 1: Consider an initial value for which the statement is true. It is to be shown thatthe
statement is true for n=initial value.

Step 2: Assume the statement is true for any value ofn=k. Then prove the statement istrue for
n=k+1. We actually break n=k+1 into two parts, one part is n=k (which is already proved) and try
to prove the other part.

Strong Induction:-Strong Induction is another form of mathematical induction. Through this


induction technique, we can prove that a propositional function, P(n) is true for all positive
integers, n, using the following steps:

Step 1(Base step): It proves that the initial propositionP(1)true.

Step 2(Inductive step): It proves that the conditional statement


[ (1) ⋀ (2) ⋀ (3) ⋀ … … … … ⋀ ( k )] → ( k + 1) is true for positive integersk.

MATHEMATICAL LOGIC
The rules of mathematical logic specify methods of reasoning mathematical statements. Greek
philosopher, Aristotle, was the pioneer of logical reasoning. Logical reasoning provides the
theoretical base for many areas of mathematics and consequently computer science. It has
many practical applications in computer science like design of computing machines, artificial
intelligence, definition of data structures for programming languages etc.

Propositional Logicis concerned with statements to which the truth values, “true” and“false”,
can be assigned. The purpose is to analyze these statements either individually or in a
composite manner.

Definition:-A proposition is a collection of declarative statements that has either a truth value
"true” or a truth value "false". A propositional consists of propositional variables and
connectives. We denote the propositional variables by capital letters (A, B, etc). The
connectives connect the propositional variables.

Connectives:
In propositional logic generally we use five connectives which are:

1. OR (V)

2. AND (Λ)

3. Negation/ NOT (¬)

4. Conditional/ Implication / if-then (→)


5. Biconditional/ If and only if (⇔).

OR (V):The OR operation of two propositions A and B (written as A V B) is true if at leastany of


the propositional variable A or B is true.
The truth table is as follows:

A B AVB

True True True

True False True

False True True

False False False

AND (Λ):The AND operation of two propositions A and B (written as AΛB) is true if boththe
propositional variable A and B is true.

The truth table is as follows:

A B AΛB

True True True

True False False


False True False

False False False

Negation (¬):The negation of a proposition A (written as ¬A) is false when A is true andis true
when A is false.

The truth table is as follows:

A ¬A

False
True

False True
Implication / if-then (→):An implication A→B is the proposition “if A,then B”. Itisfalse if A is
true and B is false. The rest cases are true.

The truth table is as follows:

A B A→B

True True True

True False False

False True True

False False True

If and only if (⇔): A⇔B is bi-conditional logical connective which is true when p and q are
same, i.e. both are false or both are true.

The truth table is as follows:

A B A⇔B

True True True

True False False

False True False


False False True

Tautologies:-A Tautology is a formula which is always true for every value of its propositional
variables.

Contradictions:-A Contradiction is a formula which is always false for every value of its
propositional variables.

Contingency:-A Contingency is a formula which has both some true and some false values for
every value of its propositional variables.

Propositional Equivalences:-Two statements X and Y are logically equivalent if any of the


following two conditions hold:

The truth tables of each statement have the same truth values.

The bi-conditional statement X ⇔ Y is a tautology.

Inverse, Converse, and Contra-positive:-


Implication / if-then (→) is also called a conditional statement. It has two parts-

1. Hypothesis , p
2. Conclusion , q

As mentioned earlier, it is denoted as p → q.

Inverse:An inverse of the conditional statement is the negation of both the hypothesisand the
conclusion. If the statement is “If p, then q”, the inverse will be “If not p, then not q”. Thus the
inverse of p→q is ¬p→¬q.

Converse:The converse of the conditional statement is computed by interchanging


thehypothesis and the conclusion. If the statement is “If p, then q”, the converse will be “If q,
then p”. The converse of p→q is q→p.
Contra-positive:The contra-positive of the conditional is computed by interchanging
thehypothesis and the conclusion of the inverse statement. If the statement is “If p, then q”,
the contra-positive will be “If not q, then not p”. The contra-positive of p q is ¬q ¬p.

Duality Principle:
Duality principle states that for any true statement, the dual statement obtained by
interchanging unions into intersections (and vice versa) and interchanging Universal set into
Null set (and vice versa) is also true. If dual of any statement is the statement itself, it is said
self-dual statement.

UNIT-2

Recurrence Relations

In this chapter, we will discuss how recursive techniques can derive sequences and be used for
solving counting problems. The procedure for finding the terms of a sequence in a recursive
manner is called recurrence relation. We study the theory of linear recurrence relations and
their solutions. Finally, we introduce generating functions for solving recurrence relations.

Definition:-A recurrence relation is an equation that recursively defines a sequence where


the next term is a function of the previous terms (Expressing Fn as some combination of Fi with
i<n).
Linear Recurrence Relations:-A linear recurrence equation of degree k or order k is a
recurrence equation which is in the format xn= A1 xn-1+ A2 xn-1+ A3 xn-1+... Akxn-k (An is a
constant and Ak≠0) on a sequence of numbers as a first-degree polynomial.

These are some examples of linear recurrence equations:

Recurrence

Initial values Solutions

Relations

Fn = Fn-1 + Fn-2 a1=a2=1 Fibonacci number

Fn = Fn-1 + Fn-2 a1=1, a2=3 Lucas number

Fn = Fn-2 + Fn-3 a1=a2=a3=1 Padovan sequence

Fn = 2Fn-1 + Fn-2 a1=0, a2=1 Pell number

How to solve linear recurrence relation


Suppose, a two ordered linear recurrence relation is: Fn = AFn-1 +BFn-2 where A and B are real
numbers.

The characteristic equation for the above recurrence relation is:

x2 − Ax − B = 0

Three cases may occur while finding the roots:

Case 1: If this equation factors as (x- x1)(x- x1) = 0 and it produces two distinct real rootsx1 and
x2, then Fn = ax1n+ bx2n is the solution. [Here, a and b are constants]

Case 2: If this equation factors as (x- x1)2= 0 and it produces single real root x1, thenFn = a x1n+
bn x1n is the solution.
Case 3: If the equation produces two distinct complex roots, x1 and x2 in polar form
x1 = r ∠ θ and x2 = r ∠(- θ), then Fn = rn (a cos(nθ)+ b sin(nθ)) is the solution.
Problem 1

Solve the recurrence


relation Fn=5Fn−1−6Fn−2Fn=5Fn−1−6Fn−2 where F0=1F0=1 and F1=4F1=4
Solution

The characteristic equation of the recurrence relation is −

x2−5x+6=0,x2−5x+6=0,

So, (x−3)(x−2)=0(x−3)(x−2)=0
Hence, the roots are −

x1=3x1=3 and x2=2x2=2


The roots are real and distinct. So, this is in the form of case 1

Hence, the solution is −

Fn=axn1+bxn2Fn=ax1n+bx2n

Here, Fn=a3n+b2n (As x1=3 and x2=2)Fn=a3n+b2n (As x1=3 and x2=2)
Therefore,

1=F0=a30+b20=a+b1=F0=a30+b20=a+b
4=F1=a31+b21=3a+2b4=F1=a31+b21=3a+2b
Solving these two equations, we get a=2a=2 and b=−1b=−1
Hence, the final solution is −

Fn=2.3n+(−1).2n=2.3n−2nFn=2.3n+(−1).2n=2.3n−2n

Problem 2

Solve the recurrence relation


− Fn=10Fn−1−25Fn−2Fn=10Fn−1−25Fn−2 where F0=3F0=3 and F1=17F1=17
Solution

The characteristic equation of the recurrence relation is −

x2−10x−25=0x2−10x−25=0

So (x−5)2=0(x−5)2=0
Hence, there is single real root x1=5x1=5
As there is single real valued root, this is in the form of case 2

Hence, the solution is −

Fn=axn1+bnxn1Fn=ax1n+bnx1n
3=F0=a.50+b.0.50=a3=F0=a.50+b.0.50=a
17=F1=a.51+b.1.51=5a+5b17=F1=a.51+b.1.51=5a+5b
Solving these two equations, we get a=3a=3 and b=2/5b=2/5
Hence, the final solution is − Fn=3.5n+(2/5).n.2nFn=3.5n+(2/5).n.2n
Problem 3

Solve the recurrence


relation Fn=2Fn−1−2Fn−2Fn=2Fn−1−2Fn−2 where F0=1F0=1 and F1=3F1=3
Solution

The characteristic equation of the recurrence relation is −

x2−2x−2=0x2−2x−2=0

Hence, the roots are −

x1=1+ix1=1+i and x2=1−ix2=1−i


In polar form,

x1=r∠θx1=r∠θ and x2=r∠(−θ),x2=r∠(−θ), where r=2–√r=2 and θ=π4θ=π4


The roots are imaginary. So, this is in the form of case 3.

Hence, the solution is −

Fn=(2–√)n(acos(n.⊓/4)+bsin(n.⊓/4))Fn=(2)n(acos(n.⊓/4)+bsin(n.⊓/4))
1=F0=(2–√)0(acos(0.⊓/4)+bsin(0.⊓/4))=a1=F0=(2)0(acos(0.⊓/4)+bsin(0.⊓/4))=a
3=F1=(2–√)1(acos(1.⊓/4)+bsin(1.⊓/4))=2–√(a/2–√+b/2–
√)3=F1=(2)1(acos(1.⊓/4)+bsin(1.⊓/4))=2(a/2+b/2)
Solving these two equations we get a=1a=1 and b=2b=2
Hence, the final solution is −

Fn=(2–√)n(cos(n.π/4)+2sin(n.π/4))Fn=(2)n(cos(n.π/4)+2sin(n.π/4))

Non-Homogeneous Recurrence Relation and Particular Solutions:-


A recurrence relation is called non-homogeneous if it is in the form Fn =
AFn–1 + BFn-2 + f(n) where f(n) ≠ 0
Its associated homogeneous recurrence relation is Fn= AFn–1+ BFn-2

The solution (an) of a non-homogeneous recurrence relation has two parts.

First part is the solution (ah) of the associated homogeneous recurrence relation and the
second part is the particular solution (at).

an= ah + at

Solution to the first part is done using the procedures discussed in the previous section.

To find the particular solution, we find an appropriate trial solution.

Let f(n) = cxn ; let x2= Ax + B be the characteristic equation of the associated homogeneous
recurrence relation and let x1 and x2 be its roots.

If x ≠ x1 and x ≠ x2, then at= Axn


If x = x1, x ≠ x2, then at= Anxn
If x= x1= x2, then at= An2xn
Example

Let a non-homogeneous recurrence relation be Fn= AFn–1+ BFn-2+ f(n) with characteristic roots
x1 = 2 and x2 = 5. Trial solutions for different possible values of f(n) are as follows:

f(n) Trial solutions

4 A

5.2n An2n

8.5n An5n

4n A4n

2n2 + 3n + 1 An2 + Bn + C

Generating Functions:-Generating Functions represents sequences where each term of a


sequence is expressedas a coefficient of a variable x in a formal power series.

Problem 1
What are the generating functions for the sequences {ak}{ak} with ak=2ak=2 and ak=3kak=3k?
Solution

When ak=2ak=2, generating


function, G(x)=∑∞k=02xk=2+2x+2x2+2x3+…G(x)=∑k=0∞2xk=2+2x+2x2+2x3+…
When ak=3k,G(x)=∑∞k=03kxk=0+3x+6x2+9x3+……ak=3k,G(x)=∑k=0∞3kxk=0+3x+6x2+
9x3+……
Problem 2

What is the generating function of the infinite series; 1,1,1,1,…1,1,1,1,…?


Solution

Here, ak=1ak=1, for 0≤k≤∞0≤k≤∞


Hence, G(x)=1+x+x2+x3+…⋯=1(1−x)G(x)=1+x+x2+x3+…⋯=1(1−x)
Some Useful Generating Functions
• For ak=ak,G(x)=∑∞k=0akxk=1+ax+a2x2+……⋯=1/(1−ax)ak=ak,G(x)=∑k=0∞akxk=1+ax+
a2x2+……⋯=1/(1−ax)
• For ak=(k+1),G(x)=∑∞k=0(k+1)xk=1+2x+3x2……⋯=1(1−x)2ak=(k+1),G(x)=∑k=0∞(k+1)x
k=1+2x+3x2……⋯=1(1−x)2
• For ak=cnk,G(x)=∑∞k=0cnkxk=1+cn1x+cn2x2+……⋯+x2=(1+x)nak=ckn,G(x)=∑k=0∞cknx
k=1+c1nx+c2nx2+……⋯+x2=(1+x)n
• For ak=1k!,G(x)=∑∞k=0xkk!=1+x+x22!+x33!……⋯=ex

Some Areas of Application:


Generating functions can be used for the following purposes:

For solving a variety of counting problems. For example, the number of ways to make
change for a Rs. 100 note with the notes of denominations Rs.1, Rs.2, Rs.5, Rs.10, Rs.20
and Rs.50

For solving recurrence relations

For proving some of the combinatorial identities

For finding asymptotic formulae for terms of sequences


GROUP THEORY
Group Theory is a branch of mathematics and abstract algebra that defines an algebraic
structure named as group. Generally, a group comprises of a set of elements and an operation
over any two elements on that set to form a third element also in that set.

Binary Operator:
A binary operator defined on a set of elements is a rule that assigns to each pair of elements a
unique element from that set. For example, given the set A={1,2,3,4,5}, we can say ⊗ is a
binary operator for the operation = ⊗ , if it specifies a rule for finding c for the pair of (a,b),
such that a,b,c∈ A.

Postulates:Thepostulates of a mathematical system form the basic assumptions from which


rules can be deduced. The postulates are:

Closure :-A set is closed with respect to a binary operator if for every pair of elements in the
set; the operator finds a unique element from that set.

Associative Laws:-A binary operator ⊗ on a set A is associative when it holds the following
property:

(x⊗y ) ⊗z = x⊗ (y ⊗ z), where x, y, z∈A

Commutative Laws:-A binary operator ⊗ on a set A is commutative when it holds the


following property:

x⊗y = y⊗x, where x, y∈A

Distributive Laws:-Two binary operators ⊗ and ⊛ on a set A, are distributive over operator
⊛ when the following property holds:

x⊗ (y ⊛ z) = ( x⊗y )⊛ (x⊗ z) , where x, y, z∈A


Identity Element:-A set A has an identity element with respect to a binary operation ⊗ on
A, if there exists an element e ∈ A, such that the following property holds:

x⊗e = x=e⊗x, where x∈A

Inverse:-If a set A has an identity element with respect to a binary operator ⊗, it is said to
have an inverse whenever for every element x ∈ A, there exists another element y ∈ A, such
that the following property holds:

x⊗y= e

De Morgan’s Law:-De Morgan’s Laws gives a pair of transformations between union and
intersection of two (or more) sets in terms of their complements. The laws are

(A⋃B)’= A′⋂ B′ and (A⋂B)’= A′⋃ B′

Semigroup:-A finite or infinite set ‘S’ with a binary operation ‘0’ (Composition) is called
semigroup if it holds following two conditions simultaneously:

Closure: For every pair (a, b)∈S, (a 0 b) has to be present in the set S.
Associative: For every element a, b, c∈S, (a 0 b) 0 c = a 0 (b 0 c) must hold.

Monoid:-A monoid is a semigroup with an identity element. The identity element (denoted by
e or E) of a set S is an element such that (a 0 e) = a, for every element a∈S. An identityelement
is also called a unit element. So, a monoid holds three properties simultaneously: Closure,
Associative, Identity element.

Group:-A group is a monoid with an inverse element. The inverse element (denoted by I) of a
set S is an element such that (a 0 I) = (I 0 a) =a, for each element a ∈ S. So, a group holds four
properties simultaneously - i) Closure, ii) Associative, iii) Identity element, iv) Inverse element.
The order of a group G is the number of elements in G and the order of anelement in a group is
the least positive integer n such that an is the identity element of that group G.

Abelian Group:-An abelian group G is a group for which the element pair (a,b) ∈ G always
holds commutative law. So, a group holds five properties simultaneously - i) Closure, ii)
Associative, iii) Identity element, iv) Inverse element, v) Commutative.
Cyclic Group and Subgroup:-A cyclic group is a group that can be generated by a single
element. Every element of a cyclic group is a power of some specific element which is called a
generator. A cyclic group can be generated by a generator ‘g’, such that every other element of
the group can be written as a power of the generator ‘g’.

Note: A cyclic group is always an abelian group but not every abelian group is a cyclicgroup.
The rational numbers under addition is not cyclic but is abelian.

A subgroup H is a subset of a group G (denoted by H ≤ G) if it satisfies the four properties


simultaneously: Closure, Associative, Identity element, and Inverse.

A subgroup H of a group G that does not include the whole group G is called a propersubgroup
(Denoted by H<G). A subgroup of a cyclic group is cyclic and aabelian subgroup is also abelian.

Rings:-A ring is a set equipped with two operations (usually referred to as addition and
multiplication) that satisfy certain properties: there are additive and multiplicative identities
and additive inverses, addition is commutative, and the operations are associative and
distributive.

Commutative Ring:- If multiplication is commutative, the ring is called a commutative ring.


Again there may be an element 1 in R, such that for all elements a in R, a.1 = a =1.a. If such an
element exists, we call it the unity of the ring, and the ring is called a ring with unity. Else it is
called a ring without unity or a "ring" (a ring without i).

Subring:-A subset S ⊆ R of a ring R is called a subring of R if it is itself a ring with the same operations
(and the same unity) as R.

Integral domains and fields :-(Zero divisor, integral domain, division ring, field).Suppose R
is a ring.

(i) A nonzero element r ∈ R is said to be a zero divisor if there exists a nonzero s ∈ R such that
rs = 0 or sr = 0.
(ii) A ring is said to be a domain if it has no zero divisors.
(iii) A commutative domain is called an integral domain.
(iv) If every nonzero element in a (not necessarily commutative) ring is a unit, then R is called a
division ring (or skew field).
(v) A commutative division ring is called a field.
Theorems:-
1. Let G be a group. Then, •
(i) ∀a ∈ G, aG = G = Ga, where Ga = {ga : g ∈ G} and aG = {ag : g ∈ G}.
(ii) If a, x, y ∈ G, then ax = ay =⇒ x = y.
(iii) If a, x, y ∈ G, then xa = ya =⇒ x = y.
2. G is a group. Then:
(i)G has only one identity element.
(ii)Each g ∈ G has only one inverse g −1 .

3. Let G be a group and S ⊆ G. Then,


1. If t, s ∈ S, then st∈ S (Closure).
2. e∈ S. .
3. If s ∈ S, then s −1 ∈ S.

4. If H and K are two subgroup of a group G. Then show that H⋂K is the subgroup of G but H⋃K may
not be subgroup of G.

5. If H and K are two subgroups of G, neither of which contains the other. Then show that there exist an
element of G belonging neither to H and K.

6. Let H be a subgroup of the group G and let a, b ∈ G. Then Ha = Hb if and only if ab−1 ∈ H.

7. Any two right Cosets are either identical or disjoint.

8.(Lagrange’s Theorem). Let G be a finite group and S ⊆ G. Then, o(S)|o(G).

9. If |G| = p a prime, then G is cyclic.

10.Every subgroup of a cyclic group is cyclic.

11. Every subgroup of an abelian group is a normal subgroup.

12. The subgroup N of G is a normal subgroup of G if and only if g −1Ng ⊆ N for all g ∈ G

13. If N is a normal subgroup of G, then the cosets of N form a group. If G is finite, this group has order
|G : N|.

14. If G is a finite abelian group whose order is divisible by a prime p, then G contains an element of
order p.

15. Show that every subgroup of a cyclic group is cyclic.

16.Every division ring is a domain.

17. Every field is an integral domain.

18. If R is an (integral) domain and S is a subring of R, then S is an (integral) domain.


19. Every finite integral domain is a field.

20. Every finite division ring is a field.

21. A finite integral domain is a field.

COUNTING

Counting mainly encompasses fundamental counting rule, the permutation rule, and the
combination rule.

The Rules of Sum and Product:- The Rule of Sum and Rule of Product are used to
decompose difficult counting problems into simple problems.

The Rule of Sum: If a sequence of tasks T1, T2, …, Tmcan be done in w1, w2,…wmways
respectively (the condition is that no tasks can be performed simultaneously), then the
number of ways to do one of these tasks is w1 + w2 +… +wm. If we consider two tasks A
and B which are disjoint (i.e. A ∩ B = Ø), then mathematically |A ∪ B| = |A| + |B|

The Rule of Product: If a sequence of tasks T1, T2, …, Tmcan be done in w1, w2,…wm
ways respectively and every task arrives after the occurrence of the previous task, then
there are w1 × w2 ×...× wm ways to perform the tasks. Mathematically, if a task B
arrives after a task A, then |A×B| = |A|×|B|

Permutations:- A permutation is an arrangement of some elements in which order matters.


In other words a Permutation is an ordered Combination of elements.

Number of Permutations:- The number of permutations of ‘n’ different things taken ‘r’ at a
time is denoted by nPrn !
=
(n − r)!

where n ! = 1.2.3. … . . ( n− 1).

Proof: Let there be‘n’ different elements.


There are n number of ways to fill up the first place. After filling the first place (n-1) number
of elements is left. Hence, there are (n-1) ways to fill up the second place. After filling the
first and second place, (n-2) number of elements is left. Hence, there are (n-2) ways to fill up
the third place. We can now generalize the number of ways to fill up r-th place as [n – (r–1)]
= n–r+1

So, the total no. of ways to fill up from first place up to r-th-place:

nPr = n (n–1) (n–2)..... (n–r+1)

= [n(n–1)(n–2) ... (n–r+1)] [(n–r)(n–r–1)-----3.2.1] / [(n–r)(n–r–1) .. 3.2.1]

Hence,
nPr = n!/(n-r)!

Some important formulas of permutation:


1. If there are n elements of which a1 are alike of some kind, a2 are alike of another
kind; a3 are alike of third kind and so on and ar are of rth kind, where (a1 + a2 + ...

ar) = n.

Then, number of permutations of these n objects is = n! / [ (a1!) (a2!)..... (ar!)].

2. Number of permutations of n distinct elements taking n elements at a time = nPn = n!


3. The number of permutations of n dissimilar elements taking r elements at a time,
when x particular things always occupy definite places = n-xpr-x
4. The number of permutations of n dissimilar elements when r specified things always
come together is: r! (n−r+1)!
5. The number of permutations of n dissimilar elements when r specified things never
come together is: n!–[r! (n−r+1)!]
6. The number of circular permutations of n different elements taken x elements at time =
nPx /x

7. The number of circular permutations of n different things = nPn /n


Pigeonhole Principle:- In 1834, German mathematician, Peter Gustav Lejeune Dirichlet,
stated a principle which he called the drawer principle. Now, it is known as the pigeonhole
principle.

Pigeonhole Principle states that if there are fewer pigeon holes than total number ofpigeons
and each pigeon is put in a pigeon hole, then there must be at least one pigeon hole with more
than one pigeon. If n pigeons are put into m pigeonholes where n>m, there's a hole with more
than one pigeon.

GRAPH THEORY
A graph is a set of points, called nodes or vertices, which are interconnected by a set of lines
called edges. The study of graphs, or graph theory is an important part of a number of
disciplines in the fields of mathematics, engineering and computer science.

Definition:A graph (denoted as G = (V, E)) consists of a non-empty set of vertices ornodes V
and a set of edges E.

Degree of a Vertex:The degree of a vertex V of a graph G (denoted by deg (V)) is thenumber


of edges incident with the vertex V.

Vertex Degree Even / Odd

A 2 even

B 2 even

C 3 odd

D 1 odd

Even and Odd Vertex:If the degree of a vertex is even, the vertex is called an evenvertex
and if the degree of a vertex is odd, the vertex is called an odd vertex.

Degree of a Graph: Thedegree of a graph is the largest vertex degree of that graph. Forthe
above graph the degree of the graph is 3.
The Handshaking Lemma:In a graph, the sum of all the degrees of all the vertices isequal to
twice the number of edges.

Types of Graphs:- There are different types of graphs,

Null Graph:- A null graph has no edges. The null graph of n vertices is denoted by Nn

Null graph of 3 vertices

Simple Graph:- A graph is called simple graph/strict graph if the graph is undirected and does
not contain any loops or multiple edges.

Simple graph

Multi-Graph:- If in a graph multiple edges between the same set of vertices are allowed, it is
called Multi-graph. In other words, it is a graph having at least one loop or multiple edges.

a c
b

Multi-graph

Directed and Undirected Graph:- A graph G = (V, E) is called a directed graph if the edge
set is made of ordered vertex pair and a graph is called undirected if the edge set is made of
unordered vertex pair.

a c

Undirected graph

Directed graph

Connected and Disconnected Graph:- A graph is connected if any two vertices of the
graph are connected by a path; while a graph is disconnected if at least two vertices of the
graph are not connected by a path. If a graph G is disconnected, then every maximal connected
subgraph of G is called a connected component of the graph G.
a c

Connected Graph

b d dc
d

a c

b d

Unconnected graph

Regular Graph:- A graph is regular if all the vertices of the graph have the same degree. In a
regular graph G of degree r, the degree of each vertex of G is r.

a b

Regular graph of degree 3

Complete Graph:- A graph is called complete graph if every two vertices pair are joined by
exactly one edge. The complete graph with n vertices is denoted by Kn

a c

Complete graph K3

Cycle Graph:-If a graph consists of a single cycle, it is called cycle graph. The cycle graph with
n vertices is denoted by Cn.
a c

b Cyclic graph C3

Bipartite Graph:- If the vertex-set of a graph G can be split into two disjoint sets, 1 and 2, in
such a way that each edge in the graph joins a vertex in 1 to a vertex in 2, and there are no
edges in G that connect two vertices in 1 or two vertices in 2, then the graph G is called a
bipartite graph.

a c

b d

Bipartite graph

Complete Bipartite Graph:- A complete bipartite graph is a bipartite graph in which each
vertex in the first set is joined to every single vertex in the second set. The complete bipartite
graph is denoted by , where the graph G contains x vertices in the first set and y vertices in the
second set.

a c

b d

Complete bipartite graph K2,2

Representation of Graphs:- There are mainly two ways to represent a graph:


Adjacency Matrix
Adjacency List

Adjacency Matrix:- An Adjacency Matrix A[V][V] is a 2D array of size V×V where V is the
number of vertices in a undirected graph. If there is an edge between Vx to Vy then the value of
A[Vx][ Vy]=1 and A[Vy][ Vx]=1, otherwise the value will be zero. And for a directed graph, if
there is an edge between Vx to Vy, then the value of A[Vx][ Vy]=1, otherwise the value will be
zero.

Adjacency Matrix of an Undirected Graph:- Let us consider the following undirected


graph and construct the adjacency matrix:

An undirected graph

a b c D

a 0 1 1 0

b 1 0 1 0

c 1 1 0 1

d 0 0 1 0
Adjacency matrix of the above undirected graph will be:

Adjacency Matrix of a Directed Graph:- Let us consider the following directed graph and
construct its adjacency matrix:

a c

b d

A directed graph

Adjacency matrix of the above directed graph will be:

A b C D

a 0 1 1 0

b 0 0 1 0

c 0 0 0 1
d 0 0 0 0

Adjacency List:- In adjacency list, an array (A[V]) of linked lists is used to represent the graph
G with V number of vertices. An entry A[Vx] represents the linked list of vertices adjacent to the
Vx-th vertex.

Planar vs. Non-planar Graph:-

Planar graph:A graph G is called a planar graph if it can be drawn in a plane without anyedges
crossed. If we draw graph in the plane without edge crossing, it is called embedding the graph
in the plane.

a c

b d

Planar graph

Non-planar graph:A graph is non-planar if it cannot be drawn in a plane without graphedges


crossing

Isomorphism:- If two graphs G and H contain the same number of vertices connected in the
same way, they are called isomorphic graphs (denoted by G≅H).

It is easier to check non-isomorphism than isomorphism. If any of these following conditions


occurs, then two graphs are non-isomorphic:

The number of connected components are different

Vertex-set cardinalities are different

Edge-set cardinalities are different


Degree sequences are different

Example

The following graphs are isomorphic:

Three isomorphic graphs

Homomorphism:- A homomorphism from a graph G to a graph H is a mapping (May not be a


bijective mapping) h: G H such that: (x, y) ∈ E(G) (h(x), h(y)) ∈ E(H) . It maps adjacent vertices
of graph G to the adjacent vertices of the graph H.

Properties of Homomorphisms:
A homomorphism is an isomorphism if it is a bijective mapping.
Homomorphism always preserves edges and connectedness of a graph.
The compositions of homomorphisms are also homomorphisms.
To find out if there exists any homomorphic graph of another graph is a NP-complete
problem.

Euler Graphs:- A connected graph G is called an Euler graph, if there is a closed trail which
includes every edge of the graph G. An Euler path is a path that uses every edge of a graph
exactly once. An Euler path starts and ends at different vertices.

An Euler circuit is a circuit that uses every edge of a graph exactly once. An Euler circuit always
starts and ends at the same vertex. A connected graph G is an Euler graph if and only if all
vertices of G are of even degree, and a connected graph G is Eulerian if and only if its edge set
can be decomposed into cycles.
The above graph is an Euler graph as “a 1 b 2 c 3 d 4 e 5 c 6 f 7 g” covers all the edges of the
graph.

Non-Euler graph

Hamiltonian Graphs:- A connected graph G is called Hamiltonian graph if there is a cycle


which includes every vertex of G and the cycle is called Hamiltonian cycle. Hamiltonian walk in
graph G is a walk that passes through each vertex exactly once.

If G is a simple graph with n vertices, where n ≥ 3 If deg(v) ≥ n/2 for each vertex v, then the
graph G is Hamiltonian graph. This is called Dirac's Theorem.

If G is a simple graph with n vertices, where n ≥ 2 if deg(x) + deg(y) ≥ n for each pair of non-
adjacent vertices x and y, then the graph G is Hamiltonian graph. This is called Ore'stheorem.

Graph Coloring:- Graph coloring is the procedure of assignment of colors to each vertex of a
graph G such that no adjacent vertices get same color. The objective is to minimize the number
of colors while coloring a graph. The smallest number of colors required to color a graph G is
called its chromatic number of that graph. Graph coloring problem is a NP Complete problem.

Method to Color a Graph:


The steps required to color a graph G with n number of vertices are as follows:

Step 1. Arrange the vertices of the graph in some order.

Step 2. Choose the first vertex and color it with the first color.

Step 3. Choose the next vertex and color it with the lowest numbered color that has notbeen
colored on any vertices adjacent to it. If all the adjacent vertices are colored with this
color, assign a new color to it. Repeat this step until all the vertices are colored.

Example

a b

d e

Graph coloring

In the above figure, at first vertex a is colored red. As the adjacent vertices of vertex a are again
adjacent, vertex b and vertex d are colored with different color, green and blue respectively.
Then vertex c is colored as red as no adjacent vertex of c is colored red. Hence, we could color
the graph by 3 colors. Hence, the chromatic number of the graph is 3.

Applications of Graph Coloring:

Some applications of graph coloring include-


Register Allocation

Map Coloring

Bipartite Graph Checking

Mobile Radio Frequency Assignment

Making time table, etc.


TREES
Tree is a discrete structure that represents hierarchical relationships between
individualelements or nodes. A tree in which a parent has no more than two children is called a
binary tree.

Tree and its Properties:-

Definition:A Tree is a connected acyclic undirected graph. There is a unique path


betweenevery pair of vertices in G. A tree with N number of vertices contains (N-1) number of
edges. The vertex which is of 0 degree is called root of the tree. The vertex which is of 1 degree
is called leaf node of the tree and the degree of an internal node is at least 2.

Centers and Bi-Centers of a Tree:- The center of a tree is a vertex with minimal
eccentricity. The eccentricity of a vertex X in a tree G is the maximum distance between the
vertex X and any other vertex of the tree. The maximum eccentricity is the tree diameter. If a
tree has only one center, it is called Central Tree and if a tree has only more than one centers, it
is called Bi-central Tree. Every tree is either central or bi-central.

Labeled Trees:- A labeled tree is a tree the vertices of which are assigned unique
numbersfrom 1 to n. We can count such trees for small values of n by hand so as to conjecture
a general formula. The number of labeled trees of n number of vertices is n n-2. Two labeled
trees are isomorphic if their graphs are isomorphic and the corresponding points of the two
trees have the same labels.

A labeled tree with two vertices

Three possible labeled tree with three vertices

Unlabeled trees:-An unlabeled tree is a tree the vertices of which are not assigned any
numbers.

An unlabeled tree with two vertices

An unlabeled tree with three vertices


Two possible unlabeled trees with four vertices

Rooted Tree:- A rooted tree G is a connected acyclic graph with a special node that is called
the root of the tree and every edge directly or indirectly originates from the root. An ordered
rooted tree is a rooted tree where the children of each internal vertex are ordered. If every
internal vertex of a rooted tree has not more than m children, it is called an m-ary tree. If every
internal vertex of a rooted tree has exactly m children, it is called a full m-ary tree. If m = 2, the
rooted tree is called a binary tree.

Spanning Tree:- A spanning tree of a connected undirected graph G is a tree that minimally
includes all of the vertices of G. A graph may have many spanning trees.

A Graph G

A Spanning Tree of Graph G


Minimum Spanning Tree:- A spanning tree with assigned weight less than or equal to the
weight of every possible spanning tree of a weighted, connected and undirected graph G, it is
called minimum spanning tree (MST). The weight of a spanning tree is the sum of all the
weights assigned to each edge of the spanning tree.

Kruskal's Algorithm:- Kruskal's algorithm is a greedy algorithm that finds a minimum


spanning tree for a connected weighted graph. It finds a tree of that graph which includes every
vertex and the total weight of all the edges in the tree is less than or equal to every possible
spanning tree.

Algorithm:-
Step 1: Arrange all the edges of the given graph G (V,E) in non-decreasing order as pertheir
edge weight.

Step 2: Choose the smallest weighted edge from the graph and check if it forms a cyclewith the
spanning tree formed so far.

Step 3: If there is no cycle, include this edge to the spanning tree else discard it.

Step 4: Repeat Step 2 and Step 3 until (V-1) number of edges are left in the spanningtree.

Prim's Algorithm:- Prim's algorithm, discovered in 1930 by mathematicians, Vojtech Jarnik


and Robert C. Prim, is a greedy algorithm that finds a minimum spanning tree for a connected
weighted graph. It finds a tree of that graph which includes every vertex and the total weight of
all the edges in the tree is less than or equal to every possible spanning tree. Prim’s algorithm is
faster on dense graphs.

Algorithm:-
1. Initialize the minimal spanning tree with a single vertex, randomly chosen from the
graph.
2. Repeat steps 3 and 4 until all the vertices are included in the tree.
3. Select an edge that connects the tree with a vertex not yet in the tree, so that the
weight of the edge is minimal and inclusion of the edge does not form a cycle.
4. Add the selected edge and the vertex that it connects to the tree.
Difference between general tree and binary tree

General Tree Binary Tree


A general tree is a data structure in that each node A Binary tree is a data structure in that each node
can have infinite number of children, has at most two nodes left and right.
A General tree can’t be empty. A Binary tree can be empty.
There is no limit on the degree of node in a general Nodes in a binary tree cannot have more
tree. than degree 2.
Subtree of general tree are not ordered. Subtree of binary tree are ordered.
In general tree, root have in-degree 0 and In binary tree, root have in-degree 0 and
maximum out-degree n. maximum out-degree 2.
In general tree, each node have in-degree one and In binary tree, each node have in-degree one and
maximum out-degree n. maximum out-degree 2.
Height of a general tree is the length of longest path Height of a binary tree is : Height(T) =
from root to the leaf of tree. Height(T) = { max(Height(Left Child) , Height(Right Child) + 1}
{max(height(child1) , height(child2) , … height(child-
n) ) +1}

You might also like