Discrete Structure - Theory of Logics (Ful PDF) - Watermark - Watermark - Removed - 2

You might also like

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

1

UNIT
Set Theory, Functions
and Natural Numbers

CONTENTS
Part-1 : Set Theory :
Introduction, .. ************************ 1-2C to 1-5C
Combination of Sets, Multisets

Part-2 : Ordered Pair, Proof of Some..********* 1-5C to 1-8C


General ldentities on Sets

Part-3 : Relations Definition,


Operation . 1-8C to 1-16C
onRelations, Properties of Relation,
Composite Relation, Equality of
Relation, Recursive Definition of
Relation, Order of Relation

Part-4 : Function:
Detinition,...
Classification of Functions,
****
.1-16C to 1-22C
Operations on Functions,
Recursively Defined Functions,
Growth of Functions

Part-5 Natural Numbers.


.. 1-22C to 1-26C
Introductions, Mathematical
Induction, Variants of
Induction, Induction with
Non-zero Base Cases

Part-6 :
Proof Methods, Proof by . ********************** 1-26C to 1-29C
Counter-Example,
Proof by Contradiction

1-1C(CS/IT-Sem-3)
Functions & Natural Numbers
1-2 C (Cs/AT-Sem-3) Set Theory,

PART1
Set Theory: Introduction,
Combination of Sets, Multisets.

Questions-Answers

and Medium Answer Type Questions


Long Answer Type

Que 1.1.What do you


understand by set ? Explain different types
of set.

Answer
members
1. A set is a collection of well defined objects, called elements or
of the set.
anything like numbers, letters of alphabets,
These elements may be
points etc.
letters and their elements by lower case
3. Sets are denoted by capital
letters. 'x
A and read it as
4. If an object x is an element of set A, we write it as x E

belongs to A' otherwise x e A (x does not beleng to A).


Types of set:
1. Finite set: A set with finite or countable number of elements is called
finite set.
2 Infinite set: A set with infinite number of elements is called infinite
set.
set. It is
Null set: A set which contains no element at all is called null
a
3.
denoted by ¢ or {}. It is also called empty or void set.

Singleton set: A set which has only one element is called singleton set.

5. Subset: Let A and B be two sets, if every elements of A also belongs to


set B, then A is
B ie., if every element of setA is also an element of
called subset of B and it is denoted by A c B.
Symbolically, A cB itfx e A > x eB.
Superset: IfA is subset of a set B, then B is called superset of A.
7. Proper subset:Any subset A is said to be proper subset of another set

B, if there is at least one element of Bwhich does not belong to A, i.e., if


AcB butA +B. It is denoted by AcB.
8. Universal set: In many applications of sets, all the sets under
consideration are considered as subsets of one particular set. This set is
called universal set and is denoted by U.
9. Equal set:Two set A and B are said to be equal if every element of A
belong to set B and every element of B belong to set A. It is written as
A = B.
Symbolically,A = B ifx eA andx e B.
Discrete Structures & Theory of Logic 1-3C (CSTT-Sem-3)

10. Disjoint set : Let A and B be two sets, if there is no common element
between A and B, then they are said to be disjoint.

Que 1.2. Describe the different types of operation on sets.

Answer
1. Union: Let A and B be two sets, then the union of sets A and B is a set
that contain those elements that are either in A or B or in both. It is
denoted by AUB and is read as 'A union B.
Symbolically, A uB = lx|x e A or x e B)
For example: A 1, 2,3, 4
B = 3, 4, 5, 61
A uB =
{1,2,3, 4, 5, 6
2 Intersection: Let A and B be two sets, then intersection of A and B is
a set that contain those elements which are common to both A and B. It
is denoted by A nB and is read as 'A intersection B.
Symbolically, AnB = lx|x e A and x e B)
For example: A = 11,2,3, 4)
B = (2, 4, 6, 71
then AnB =
{2,4)
3 Complement: Let U be the universal set and A be any subset of U,
then complement of A is a set containing elements of U which do not
'

belong to A. It is denoted by Aor A or A.


Symbolically, A lx |x e U and x eA)
For example: U 1,2,3,4,5, 61
and A = 12,3, 5)

then A = {1, 4, 6)
4. Difference of sets: LetA and B be two sets. Then difference of A and
Bis a set of all those elements which belongto A but do not belong to B
and is denoted by A - B.

Symbolically, A -B = lx|x e A andr e B)


For example: Let A = (2, 3, 4, 5, 6, 71
and B = 14, 5, 7)
A - B= (2, 3, 6)
then
5. Symmetric difference of set: Let A and B be two sets. The symmetric
difference of A and B is a set containing all the elements that belong to
A or B but not both. It is denoted by A ® B orA AB.
Also A DB = A uB) - A nB)

For example: Let BA = (1,2,


12,3, 4, 6)
=

5, 6)

then A DB (1, 3, 4, 5)

Que 13,What do you mean by multisets ?

Answer
Multisets are sets where an element appear more than once,
1-4C (CS/T-Sem-3) Set Theory, Funetions& Natural Numbers
For example: A = {1, 1, 1, 2, 2, 3)
B = la, a, a, b, b, b, c, c,)
are multisets.
2. The multisets A and B can also be written as
A = {3.1, 2.2, 1.3) and B = {3.a, 3.b, 2.c)
3. The multiplicity of an element in a multiset is defined to be the number
of times an element appears in the multiset. In above examples,
multiplicities of the elements 1,2,3 in multiset A are 3,2, 1 respectively.
4. Let A and B be two multisets. Then, A u B, is the multiset where the
multiplicity of an element is the maximum ofits multiplicities in A and B.
5. The intersection of A and B, A nB, is the multiset where the multiplicity
of an element is the minimum of its multiplicities inA and B.
The difference of A andB, A -B, is the multiset where the multiplicity
of an element is equal to the multiplicity of the element in A minus the
multiplicity of the element in B ifthe difference is positive, and is equal
to zero if the difference is zero and negative.
7. The sum ofA and B, A +B, is the multiset where the multiplicity of an
elements is the sum of multiplicities of the elements in A and B.

Que 14 Let P and Qbe two multisets (4.a, 3.b, 1.e) and (3.a, 3.b,
2.d) respectively. Find
i. PuQ, ii. Poe, ii. P-Q, iv. Q-P,v. P Q +

Answer
i PuQ={4.a, 3.b, 1.c, 2.d)
PnQ={3.a, 3.6)
ii P-Q= {1.a, 1.e)
iv. - P = {2.d}
v. P+Q= {7.a, 6.b, 1.c, 2.d)

Que 1.5. Describe each of following in roster form:


A = lx:* is an even prime)
ii. B = lx:x is a positive integral divisor of 60)
iii. C= (x e R:r-1 =0}
iv. D= (x:x*-2x+l= 0)
v. E= lx:x is multiple of 3 or 5)

Answer
A ={2)
i B=(1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60)
ii. C 1, -1}
iv. D =

{1
v. E = {3, 5, 6, 10, 15....

Que 1.6. Describe the following in set builder form:


i. A=4,-3,-2,-1,0, 1,2,3
Discrete Structures & Theory of
Logic 1-5C (CSAT-Sem-3)
ii. B =1, 8, 27, 64)
iii. C = {(3, 6, 9, 12, 15 ....)
iv. D= (2,3, 5, 7, 11, 13 . .

Answer
i A
=lr |x is an integer and 4 Sx s31
ii. B =lx|x n*, where 1
C=
=

sns4, n is natural number)


ii.
lx |x =
3n, where n is natural
number
iv. D lx |x is the
=
integer and prime number

PART2
Ordered Pair, Proof of Some General Identities on Sets.

Questions-Answers
Long Answer Type and Medium Answer Type Questions

Que 1.7.List down laws of algebra of sets.


OR
Write down the general identities on sets.

Answer
Let A, B, C be any three sets and U be the universal set, then
the laws of algebra of sets: following are

1. Idempotent laws:
a. AUA =A
b. AnA =A
2. Commutative laws:
a.
b.
AuB=BuA
AnB=BnA
3. Associative laws:
a. Au(BUC) = (A UB)U C
b An BnC) =(A nB)nC
Distributive laws:
a. AuBnC) = A uB)nA UC)
b. AntB UC) =AnB)uAnC)
5. Identity laws:
a.
A u=A1
b AnU=A
. A uU= U
d An=
6. Involution law:
(AY = A
Set Theory, Functions & Natural Numbers
1-6C (CS/IT-Sem-3)

7. Complement laws:
a.
AUA°= U
. AnA°=
C. U =
d. = U
& De Morgan's laws:
a. (Au B¥ = A° n B°
(AnBY = A° UB°
b.
9. Absorption laws:
a. Au (A nB) =A
b. An(AUB) =A
and B that, (A UB) =A'nB'.
Que 1.8. Prove for any two sets A
AKTU 2014-15, Marks 05
Answer
re (AuB
Let
xAU B
xeA and x e B
x eA' andx e B'

...(1.8.1)
(AUBYCA'nB
x EA'nB'
Now, let
xeA'and x e B'
B
x A andx e
x e (Au B)
r e (Au By .(1.8.2)
(A'nB)g (A UBY
From eq. (1.8.1) and (1.8.2), (A UBY =A' OB'
of
2, 3, 4, 5, 6, 7, 8, 9, 10), and the ordering
Que 1.9.Let (1, U=
order; that is, a, i.
=

elements of U has
the elements in increasing
in U, the
the subset of all odd integers
What bit strings represent not
in U, and the subset of integers
subset of all e v e n integers
U?
exceeding 5 in

Answer
Since U= 11, 2, 3, 4, 5, 6, 7, 8,9, 10)
be s, i.e.,
Let the subset of all odd integers
s,= (1, 3, 5, 7, 91
subset of all even integers be s,, i.e.,
12,4,6, 8, 10)
8
not exceeding 5 be »g, i.e.,
and the subset of integers
8 1, 2, 3, 4, 5 follows
characteristic function
is given as
The bit string by
Discrete Structures & Theory of
Logic 1-7C (CS/IT-Sem-3)
Bit string for s, is 1010101010
Bit string for s, is 0101010101
Bit string for s, is 1111100000
Que 1.10.|IfA and B are two subsets of universal set, then prove
the following:
a. A- B) =
(B -A) iffA = B
b A- B) =AiffA nB =4
Answer
Let A B
Consider any element x e A -B
xEA and x e B
x e B andx e A
I:A = Bl
xe B-A
A-BcB-A ..(1.10.1)
Conversely, if
x eB-A
x E B and x e A
re A andx eB
x EA-B
B-AcA -B
From eq. (1.10.1) and (1.10.2), ...(1.10.2)
we have
If A =B=A -B =B -A
Now let A-B =B-A
Let xeA-B as A -B =B- A
xeB-A
Now x
EA-BaxeA and x e B ..(1.10.3)
and B-A
xe
Eq. (1.10.3) and (1.10.4), can hold true when A >xeB and x e A ...(1.10.4)
= B
b. Let
To show
A-B=A
AnB =¢
Let AnB: and let x e AnB andx
x EA and x e B
e ¢
XE
A-B) and x eB IA -B =A]
x e A and x « B and x e B
which is a contradiction.
AnB
Now conversely, let AnB=¢
To show A - B = A
Let
xEA-B
xE A and x « B
A
las A nB =¢l
A-BcA .(1.10.5)
Conversely, let x e A
x EA andx e B
lasAnB =$l
1-8C (CS/IT-Sem-3) Set Theory, Functions & Natural Numbers

x EA - B
...(1.10.6)
AcA-B
From eq. (1.10.5) and (1.10.6),
A = A - B

PART-3
Relations: Definition, Operation on Relations, Properties of
Relation, Composite Relation, Equality of Relation, Recursive
Definition of Relation, Order of Relation.

Questions-Answers

Long Answer Type and Medium Answer Type Questions

Que 1.11. Describe the term relation along with its types.
B if R is
Let A and B be two non-empty sets, then R is relation from A to
e B. It is
subset of A x B and is set of ordered pair (a, 6) where a eA and b
denoted by aRb and read as "a is related to b by R".
a eA, b eB, aRb}
Symbolically, R =

{(a, b):
If a, b) e R then a R b and read as "a is not related to b by R".

For example: and aRb iffa xb number


Let A {1, 2, 3, 41, B 11, 2)
= = =even

Then R =
{(1, 2), (2, 1), (2, 2), (3, 2), (4, 1), (4, 2))
Types of relation :
on A if
1. Universal relation: A relation R is called universal relation
R A x A. In case where R is defined from A to B, then R is universal
relation ifR = A x B.

For example:
If A = 1, 2, 31
then
R= (1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (2, 3), (3, 1),
(3, 2), (3,3)
is universal relation over A.
2 Identity relation: A relation R is called identity relation on A if
R= {(a, a)la eA). It is denoted byl or A^ or A. It is also called diagonal
relation.
For example:
IfA = {1, 2, 31, then
= (1, 1), (2, 2), (3, 3))
is identity relation on A.
Void relation:A relation R is called a void relation on A ifR = ¢. It is
3.
also called null relation.
For
IfA =example:
{1, 2, 3) and R is defined as R = lla + b) |a +b> 5), a, b e A then
R=¢.
Discrete Structures & Theory of Logic 1-9C (CS/IT-Sem-3)

Inverse relation: A relation R defined from B to A is called inverse


relation of R defined from A to B3if
R' ={(6, a):b e B and a e A and (a, b) e
R).
For example : Consider relation
R ={(1, 1), (1, 2), (1, 3), (3, 2))
then R'
((1, 1), (2, 1, (3, 1),
=
(2, 3)
5 Complement of a relation: Let relation R is defined from A to B, then
complement R is set of ordered pairs ((a, b): (a, b) e R). It is also called
complementary relation.
For example:
Let A =[1, 2,3) B ={4, 5)
Then A x B ={(1, 4), (1, 5), (2, 4), (2,
5), (3, 4), (3, 5))
Let R be defined as R = {(1, 4),
(3, 4), (3, 5)
Then RC= R = ((1, 5), (2, 4), (2, 5))

Que 1.12.| Explain operation on relation with example.


Answer
1. Relations are sets of ordered pairs so all set operations can be done on
relations.
2. The resulting sets contain ordered
pairs and are, therefore, relations.
3. If R and S denote two relations, then RnS, known as intersection of
R and S, defines a relation such that
x(R n
S) y =xRy nx Sy
4. Similarly, R nS, known as union of R and S, such that
x(R n
S) y xRy v x Sy
=

Also, x(R-S)y =xRy^x $y where R -Sis known as different


of R and S
and x(R°) y = xRy where R' is the complement of R
For example: A =lx, y, z), B = lx, y, z1, C = lx, y, zl
D ={Y, z), R ((x, X, (x, Y), (y. 2))
=

S= I(x, Y), y, z))


The complement of R consists of all pairs of the Cartesian product
AxB that are not R.
Thus A x B = X), x, Y), (x, Z), (y. X), (y. Y),
{(x,
(y, Z), (z, X), (z, Y), (2, Z
Hence R'
((x, Z), (y, X). (y, Y),
RUS= I(x, X), (x, Y), (y, Z)
(2, X), (a, Y), (2, Z))
RoS= (x, Y), (y, Z
R-S= l(x, Y)

Que 1.13. Give properties of relation.

Answer
Properties of relation are:
. Reflexive relation : A binary relation R on set A is said be
to retlexive
if every element of set A is related to
itself
1-10C (CSAT-Sem-3) Set Theory, Functions& Natural Numbers

Le.,
Va eA, (a, a) e Ror aRa.
For example : Let R = {(1, 1), (1, 2), (2, 2), (2, 3), (3, 3)) be a relation
defined on set A = {1, 2, 31. As (1, 1) e R, (2, 2)e R and (3, 3) e R.
Therefore, R is reflexive relation.
2 Irreflexive relation: A binary relation R defined on setA is said to
irreflexive if there is no element in A which is related to itself i.e.,

va eA such that (a, a) eR.


For example: Let R ={(1, 2), (2, 1), (3, 1)} be a relation defined on set
A = 1, 2, 31. As (1, 1) e R, (2, 2) « R and (3, 3) R. Therefore, R is
irreflexive relation.
3. Non-reflexive relation: A relation R defined on setA is said to be non-
reflexive if it is neither reflexive nor irreflexive i.e., some elements are
related to itself but there exist at least one element not related to itself.
4 Symmetric relation: A binary relation on a set A is said to be
symmetric if (a, b) eR> 6 , a) ¬R.
5. Asymmetric relation : A binary relation on a set A is said to be
asymmetric if(a, b) e R> 6, a) e R.
6. Antisymmetric relation:A binary rela on R defined on a set A is said
to antisymmetric relation if(a, b) eR and (b, a) eR5a=bie., aRb and
bRa >a =b for a, b eR.
7. Transitive relation : A binary relation R on a set A is transitive
whenever (a, b) e R and (b, c) e Rthen (a, c) eR
Le., aRb and bRc > aRc.

Que 1.14. Write short notes on

a. Equivalence relation
b. Composition of relation
OR
Write a short note on equality of relation.

Answer
a. Equivalence relation:
. A relation R on a setA is said to be equivalence relation if it is
reflexive, symmetric and transitive.
2. The two elements a and b related by an equivalence relation are
called equivalent.
So, a relation R is called equivalence relation on set A if it satisfies
followingthree properties:
(a, a) e R y a eA
(Reflexive)
i. (a, b) eR» (b, a) eR
ii. (a, b) e R and (b, c) eR» la, c) e R
(Symmetric)
(Transitive)
b. Composition of relation:
1. Let R be a relation from a set A to B and S be a relation from set B
to C then composition of R and S is a relation
consisting
or ordered
pair (a, c) where a e A and c e Cprovided that there exist b e B such
that (a, b)e RcA x B and (b, c) e ScBx C. It is denoted by RoS.
Discrete Structures &
Theory of Logic 1-11 C (CS/IT-Sem-3)

2.
Symbolically, R oS
=((a, c)13 b e B such that (a, b) e R and
(b, c) e S1

Que 1.15. Describe recursive definition of relation.

Answer
1. The characteristic function
C, ofa relation
-CX,.. X,) = 1 if <X,, .., X,> eS
RcN* is defined as follows:
-CX X,) =0 if <X,.X,>eS
Arelation R is a recursive set iff its characteristic function is
recursive function. C, a

3. Examples of recursive relations: <,>, s, =


cx, y)= sgy +x)
cx, y) = sg(x + y)

cx, y)= sg (x +y)


cx, y) = Sg x + y) xc x, y) = sg (y +x)
4. Consider relation Ra, y, z) defined as follows:
-

Rx, y, z) iff y x z Sx
5. We that R is the result of
see

recursive relation s.
substituting the recursive function x into
6. Thus, R is recursive.
7. (Technically, R is the result of
z and
substituting
the functions
fr, y, 2) =y x
f., y, z) =x into s, and we

,x, y, 2) x are recursive need to show that


=
but that's trivial
f{x, y, z) =y xz and
...

the using identity


functions).
Que 1.16. Define the term partial order relation or partial ordering
relation.

Answer
A binary relation R defined on set A is called Partial Order Relation (POR) if
R satisfies
following properties:
(a, a) e R Va eA (Reflexive)
. If(a, b) e R and (b, a) e R, the a b (Antisymmetric) =

ii. If (a, b) e R and (6, c) e R = (a, c) R where a, b, c e A


A setA together with a partial order e (Transitive)
relation R is called order partial set or
poset.

Que 1.17.Write short notes on :


a. Closure of relations
b. Total order
c. Compatibility relation
1-12C (CSAT-Sem-3) Set Theory, Functions& Natural Numbers

Answer
a. Closure of relations:
i. Reflexive closure : Let R be a relation defined on set A. The

Ru'is called reflexive closure whereof R, {(a, a)|a eA) is


I =

diagonal or identity relation.


ii. Symmetric closure : LetR be a relation defined on set A. Then
RURis called symmetric closure of R, where R-l is inverse of R
on A.
b. Total order: A binary relation R on a setA is said to be total order iffit

i Partial order
i (a, b) e R or (b,a) e R Va, b e A
It is also called linear order.
Compatibility relation:A binary relation R defined on set A is said to
be compatible relation ifit is reflexive and symmetric. It is denoted by .

Que 1.18. Show that R = {la, b)|a =b (mod m)) is an equivalence


relation on Z. Show that if a, = , and x, =y, then (r, + *) = , +3).

AKTU 2014-16, Marks 06


Answer
R= {(a, b) |a =b (mod m)}
For an equivalence relation it has to be reflexive, symmetric and transitive.
Reflexive: Forreflexive Va e Zwe have (a, a) eRi.e.,
a =a (mod m)
a -ais divisibleby mie., 0is divisible by m
Therefore aRa, Va e itis
2, reflexive.
Symmetric: Let (a, b) e Z and we have
(a, b) e Rie., a =b (mod m)
a-b is divisible by m
a-b= km, k is an integer
(b-a) = (-k) m
(b-a) = p m,p is also an integer
b-ais also divisible by m
b=a (modm)» (b, a) eR
It is symmetric.
Transitive: Let (a, b)eR and (b, c) eR then
(a,6) eRaa-bis divisible bym
a-b= tm, t is an integer .1.18.1)
(b, c) e R »b-eis divisible by m
b-c = s m, s is an integer .(1.18.2)
From eq. (1.18.1) and (1.18.2)
a-b+b-c = (t +s) m
a-c= lm, l is also an integer
Discrete Structures & Theory of Logic 1-13C (CS/IT-Sem-3)

a-c is divisible by m
ac (mod m), yes it is transitive.
Ris an
equivalence relation.
To show : (*,
+a) (V, +Y2) :
It is given
x =y1 and x2 =Y2
1.e., t -y, divisible by m
*2-y2 divisible by m
Adding above equation:
( - ) + (t2 -y2) is divisible by m
(xtx,)- (V, +y2) is divisible by m
Le,
( t*2) (01 +y2) =

Que 1.19.Let R be binary relation on the set of all strings of 0's


and 1's such that R {(a,
=
b)|a and b are strings that have the same
number of 0's). Is R is an
equivalence relation and a partial ordering
relation ? AKTU 2014-15, Marks 05
Answer
For equivalence relation:
Reflexive: a Ra» (a, a) e R a e R
where a is a string of 0's and 1's.
Always a is related to a because both a has same number of 0's.
It is reflexive.
Symmetric: Let (a, 6) e R
then a and b both have same number of 0's which indicates that
both b and will also have
again
a number of
same
zeros. Hence (b, a) eR. It is
symmetric.
Transitive: Let (a, b) e R, (b, c) e R
a, 6) E R5a and b have same number of zeros.
(6, c) e R »b and c have same number of zeros.
Therefore a and c also have same number of zeros, hence (a, c) e R.
It is transitive.
Risan equivalence relation.
For partial order, it has to be reflexive, antisymmetric and transitive. Since,
symmetricity and antisymmetricity cannot hold together. Therefore, it is not
partial order relation.

Que 1.20,|Let A(1,2, 3, 13). Consider the equivalence relation


on A xA defined by (a, b) R (c, d) if a + d = b+c. Find equivalence
classes of (5, 8). AKTU 2014-15, Marks 05
Answer
A =1,2,3,.., 13)
I5, 8) [(a, b): (a, b) R (5, 8), (a, b)
=
e A x A|
1-14 C (CS/IT-Sem-3) Set Theory, Functions & Natural Numbers

=
I(a, b):a + 8 =b +5
= [(a, b): a +3 =b]
15, 8 I(1, 4), (2, 5), (3, 6), (4, 7)
(5, 8), (6, 9), (7, 10), (8, 11)
(9, 12), (10, 13))

Que 1.21. The following relation on A =


1, 2, 3, 4). Determine
whether the following:
a. R ={(1,3), (3, 1), (1, 1), (1, 2), (3, 3), 4, 4))
b. R =AxA
Is an equivalence relation or not ? AKTU 2015-16, Marks 10

Answer
a. R = {(1, 3), (3, 1), (1, 1), (1, 2), (3, 3), (4, 4)
Rva eA
Reflexive: (a, a) e
(1, 1) e R, (2, 2) « R

Risnot reflexive. R.
Symmetrie: Let (a, b) e R then (6, a) e

(1,3) e R so (3, 1) e R
(1,2) eR but (2, 1) e R
Ris not symmetric.
Transitive: Let (a, b) e R and (6, c) e R then (a, c) e R
(1,3)eR and (3, 1) e R so (1, 1) e R
(2, 1) e R and (1, 3) eR but (2, 3) e R
R is not transitive.
transitive so R is not
Since, R is not reflexive, not symmetric, and not
an

equivalence relation.
b. R= A xA
is reflexive,
Since, A xA contains all possible elements of set A. So, R
Hence R is equivalence relation.
symmetric and transitive. an

be partially ordered set. Let s be a binary


Que 1.22.Let (A, s) a

a is related to b iff b sa.


relation. such that for a and b in A,
i Show that s is partially ordered relation.
ii. Show that (A, S) is lattice or not.

Answer
A, 3) is a partially ordered relation if it is reflexive, antisymmetric and
transitive.
sawhich
Let a eA then by definition of relation, aRa
»a
Reflexive:
is true.
Hence, the relation R i.e., s is reflexive.
Antisymmetric: Let a, b eA and
aRbb Sa
ab
Discrete Structures & Theory of Logic 1-15C (Cs/IT-Sem-3)

bRa
aRb and bRa holds only when ab. Relation is
Transitive:
=
antisymmetric.
Let a, b, c and aRb and bRc
eA
bsa,csb
C Sa
akc
Hence, relation is transitive.
Therefore, s is a partial order relation.
i. Since all the elements of the
given set A are comparable to each other,
we
always haveleast upper bound and
a
greatest lower bound for each
pair of elements
of Aand A is also a partial order relation.
is a lattice. Hence, (A, S)

Que 1.23. Letn be a positive integer and Sa set of strings. Suppose


that R, is the relation on S such that sR,t if and only if
s=t, or both s and t have at least n
characters and first n characters
of s and t are the same. That
is, string of fewer than n characters is
a
related only to itself; a string s with
at least n characters is related
to a stringt ifand
only if t has at least n characters and t beings with
the n characters the start of
at s.
AKTU 2018-19, Marks 07
Answer
We have to show that the relation
1. Reflexive: The
R, is reflexive, symmetric, and transitive.
relation R, is reflexive because s s, so that
whenever s is a string in S.
=
sR,s
2. Symmetric: f sR, t, then either s t or s and t are both at least n
=

characters long that begin with the same n


characters. This means that
tR, s. We conclude that R, is symmetric.
3. Transitive: Now suppose that sR,t and tR, u. Then either s t or s =

and t are at least n characters


long and s and t begin with the same n
characters, and either t u ort and u are at least n characters
=

t and u long and


begin with the same n characters. From this, we can deduce that
either s =u or both s and u are n characters
long ands and u begin with
the characters, i.e., sR, u. Consequently, R, is transitive.
same n

Que 1.24. LetX=(1,2, 3, 7) andR {r,)| G-y) is


Is R equivalence relation. Draw the
divisible by 3).
=

digraph of R.
AKTU 2017-18, Marks 07
Answer
Given that X ={1, 2,3, 4, 5,6, 7)
and R= (x, y): (x-y) is divisible
Then R is
by 31
an
equivalence relation if
1-16C (CS/IT-Sem-3) Set Theory, Functions & Natural Numbers

Reflexive: VxeX=»(x -x) is divisible by 3


So, (x,x) eX Vx eX or, R is reflexive.
ii. Symmetric: Letx, y eX and(x,y) eR
(x-y) is divisible by 3 x-y) = 3n, (n being an integer)
( y - x ) =-3n2 = 3n2, ng is also an integer
So, y -x is divisible by 3 or R is symmetric.
iii. Transitive: Letx, y, 2 e Xand (x, y) e R, (y, 2) e R
Then x -y =
3n1, y-z 3ng n, ng being integers
=

x - 2 = 3(n, + nz), n + n2 = ng be any integer


So, (x-2) is also divisible by 3 or (x, 2) e R
So, R is transitive.
Hence, R is an equivalence relation.

Fig. 1.24.1. Diagraph of R.

PART-4
Function : Definition, Classification of Functions, Operations on
Functions, Recursively Defined Functions, Growth of Functions.

Questions-Answers
Long Answer Type and Medium Answer Type Questions

Que 1.25. Define the term function. Also, give classification of it.

Answer
1. LetX and Y be any two non-empty sets. A function from X to Yis a rule
that assigns to each element x e Xa unique element y e Y.
2. Iffis a funtion from X to Y we write f: X-> Y.
3. Functions are denoted by f. 8, , i ete.
4 It is also called mapping or transformation or correspondence.
Domain and co-domain of a funetion: Let fbe a function from X to Y.
Then set X is called domain of function fand Yis called co-domain offunction f.
Discrete Structures &Theory
of Logic 1-17C (CS/IT-Sem-3)

Range of
function : The range offis set of all
i.e.,
images of elements of X.
Range () : y e Y and y f (x)
=
=
Vxe X
Also Range ()cY
Classification of functions:
1. Algebraic functions: Algebraic functions are those functions which
consist of a finite number of terms
involving powers and roots of the
ndependent variable x.
Three particular cases
i.
of algebraic functions are:
Polynomial functions: A function of the form a"
+a where n is a positive +a-+..
and
integer and a, a .,a are real constants
a, 0 is called a polynomial of x in degree n, for example
f x) =
2x3 +
5x 7x -3 is
+ a
polynomial of degree 3.
ii. Rational functions:A function
of theform g(x) wheref(x) and
glx) are polynomials.
iii. Irrational functions : Functions involving radicals are called
irrational functions. flx) =
Vx+ 5 is
function.
an
example of irrational
2 Transcendental functions:A function which is not
transcendental function. algebraic is called
i.
Trigonometric functions: Six functions sin x, cos x,
cosec x, cot x where the tanz, sec x,
angle x is measured in radian
trigonometric functions. are called
ii. Inverse
trigonometric functions: Six functions sinx, cosl x,
tanx, cotx, secx, cosec x, are called inverse
functions. trigonometric
iii. Exponential functions: A function f (x) a" (a > 0)
law a' and a'a' =a*" is called the
= a satisfying the =

iv. exponential function.


Logarithm functions: The inverse of the exponential function is
called logarithm function.
Que 1.26. Give the types / operations on functions.
Answer
1. One-to-one function (Injective function
f:X> Ythen fis called one-to-one function
or
injection) : Let
there are distinct image in if for distinct elements of X
Yi.e., f is one-to-one iff
Ax) fxp) implies x -*2
=
V
X1, X2, EX

Fig. 1.26.1. One-to-one


1-18C (CS/IT-Sem-3) Set Theory, Functions & Natural Numbers

2. Onto function (Surjection or surjective function) : Letf:X -> Y


then f is called onto function iff for every element y e Y there is an
element x eXwith flx) = y or fis onto if Range () = Y.

Fig. 1.26.2. Onto


3. One-to-one onto function (Bijective funetion or bijection): A
function which is both one-to0-one and onto is called one-t0-one onto
function or bijective function.

Fig. 1.26.3. One-to-one onto.


4 Many one function: A function which is not one-to-one is called many
one function i.e., two or more elements in domain have same image in
co-domain i.e.,
Iff:X> Ythen flx,) =
Ax2)>*1 * g

1
2

Fig. 1.26.4. Many one.


5. Identity function: Let f: X >X then fis called identity function if
fla) = a Va eXie., every element of Xis image ofitself. It is denoted
by I.
Inverse function (Invertible function) : Let fbe a bijective function
from X to Y. The inverse function of fis the function that assigns an
element y e Y, a unique element x e X such that flx) = y and inverse of
fdenoted by f , Therefore if flx) =y implies fo)=x.
Que 127. Determine whether each of these functions is a bijective
from R to R.
a fx)=*+1 b. fx) =
c. flr)= (a*+ 1/«2+2) AKTU 2015-16, Marks 15
Discrete Structures & Theory of
Logic 1-19C (CS/IT-Sem-3)

Answer
a. flx) =x+1
Let x, t2 eR such that
Ax) = fAxg)
x+1= x, +1

Therefore, if x, = 1 then x = tl
So, fis not one-to-one.
Hence,fis not bijective.
b.
Letx, X2 E R such
that flx)= flx2)

fis one-to-one.
Let y e Rsuch that

For V y eR3a
unique x e R such that y =f(x)
f is onto.
Hence,f is bijective.
Let , R such that fx) =
fa,)

If * 1, - 1 then fx,) =Ax)


but
.fis not one-to-one.
Hence, fis not bijective.

Que 1.28. Iff:A ->B, g:B->C are invertible functions, then show
thatg of: ACis invertible and (g ofri =
for'
AKTU 2014-15, Mark 05
Answer
Iff.A > B andg: B>C be one-to-one onto functions, then g ofis also one-
onto and (g ofl =flogrl
Proof. Since fis one-to-one, fx) =f(x,)>*, = X2 for x, *2 E R
Again since g is one-to-one, g (y)=g V,)1=V2 tor y1, Y2 ER
Now g of is one-to-one, since (g on x,) = (g ofn x,) >s lr))= g f(x,))
fx) = fx,) g is one-to-one
*2 fis one-to-one]
Since g is onto, for z e C, there exists y e B such that g (y) = z. Also fbeing
onto there exists x eA such that f(x) = y. Hence z =g (y)
=g fl«) = (go) x)
1-20 C (CS/IT-Sem-3) Set Theory, Functions & Natural Numbers

This shows that every element z e Chas pre-image under gof. So, g ofis
onto.
one-to0-one onto function and hence goflexists.
Thus, g ofis A C. So,
By the definition of the composite functions, g of: >

g o:C>A.
Also grl: C>B andfl:B->A.
Then by the definition of composite functions,flog:CA.
Therefore, the domain of (g o fl= the domain off- og.
Now g o 2 ) =x »g of x) =z
g fx)) =2
g y) = z where y =f(x)
y=ga)
et)=A grl2))= (flogr)(e)
er=(flogrl) (2) F ) =*
Thus, (goa)=(og)e).
So, 6 of=Aogl
Que 1.29. Explain the following:
a Composition of functions
b. Recursive function
c. Primitive recursion

Answer

a. Composition of functions:
Iff:X>Yandg: Y->Z then the composition offandg is a new function
from X to Z denoted by gof= gfu))

go f{x)
f{x)\

8of

fog
Fig1.28.1. Many one onto
1. Iffandg are considered to be relations then composition off and g
was denoted by fog whereas the composition of functionfand g is
denoted by gof.
2. Composition of functions is not commutative i.e., fog * gof.
3. Composition of functions is associative i.e., folgoh) = fogoh.
where h: X>Y, g: Y>Z, and f: Z> W.
b. Recursive function (Recursively defined function):
Sometimes it becomes difficult to define a function explicitly then it may
be easy to define this function in terms of itself. This technique is referred
as recursion.
Discrete Structures & Theory of Logic 1-21C (CS/IT-Sem-3)
This concept of recursion can be used to define sets, sequences and
algorithms also.
We will define three
functions which are called Basis function or Initial
functions that are used in
1.
defining other functions by induction.
Zero function: (Z:
2.
zlx) 0) =

Successor function: (S: s(x) =x + 1)


3. Projection function or generalized identity function:
U:U (, Xgy.. x,)=x,)
where superscripts n indicates a
number of argument ofthe function
and subscripts i indicates the
value of the function is equal to in
argument.
c. Primitive recursion:
A function is called primitive recursion if and
from the initial functions and other known
only ifit can be constructed
primitive recursive functions
by a finite number of operations and recursion
For
only.
exanmple : Consider the function
fx, y) = x +y
Now fx, y + 1)=x +(y + 1)
= (x +y)+1
= fx, y)+1
Also flx, 0) =x +0 =*
Now fx, 0) = * = U, («)
Also 1.29.1)
x , y +1) =fAx, y)+1
Sflx, y)} where S is the successor function
=

If we consider g(x) {U3°lx, y, flz, yN)


=
..(1L29.2)
U,x) and
=

From eq. (1.29.1) and (1.29.2), we


h{x, y, z) =SU," a, y, 2)
get f(, 0) glx) =

and flx, y + 1) hlz, y, fx, y)}


=

Thus, fis obtained from the initial functions U, U and S by applying


compositions once and recursion once. Hence,fis primitive recursive.

Que 1.30. Write short note on growth of functions.


Answer
1. We need approximate the number of steps required to execute
to
algorithm because of the difficulty involved in expression or difficultyany
in
evaluating an expression. We compare one function with another
functionto know their rate of
growths.
2 Iffand g are two functions we can give the statements like fhas same
growth rate
g' or fhas higher growth rate than g'.
as
3. Growth rate of function can be defined through notation.
a. 0-Notation (Same order): This notation bounds a function to
within constant factors. We say fln) 0gln) if there exist
=

constants n, c, and e, such that to the right of the value


positive
always lies between c,gln) and «,gln) inclusive.
n, of fn)
1-22 C (CS/AT-Sem-3) Set Theory, Functions& Natural Numbers
C2gn)

f(n)

Cg(n)

n fn) = O (g{n))

Fig. 1.30.1.
an upper bound
b. 0-Notation (Upper bound): This notation gives
if
for a function to within a constant factor. We writefAn) Og(n))
=

the right of the


there are positive constants n, and c such that to n,
value of fln) always lies on or below cgln).

eg{n)

fn)

n fn) = O(g(n))

Fig. 1.30.2
N-Notation (Lower bound): This notation giveslower bound
a
.

for a function to within a constant factor. We write =2gn)) if


fin)
there a r e positive constants n, and c such that
to the right of n, the
value of fn) always lies on or above cgln).

fn)

cgn)

Do fn)= Q (g(n))
Fig. 1.30.3.

PART-5
Natural Numbers: Introduction, Mathematical Induction,
Variants of Induction, Induction with Non-zero Base Cases.
Discrete Structures &
Theory of Logic 1-23 C (CS/IT-Sem-3)

Questions-Answes
Long Answer Type and Medium Answer Type Questions

Que 131.Describe mathematical induction.


Answer
Mathematical induction is a
technique of proving a proposition over the
positive integers. It is the most basic method of proof used for
statements having a general proving
pattern. A formal statement of principle of
mathematical induction can be stated as follows:
LetS(n) be statement that involve
Step 1: Verify S(1) is true. positive integer n =
1, 2,... then
Step 2:Assume that Stk) (Inductive base)
is true for some
arbitrary k.
(Inductive hypothe sis)
Step 3:Verify Stk+ 1) is true using basis of inductive hypothesis.
(Inductive step)
Que 132.| Prove that n + 2n is divisible by 3 using principle of
mathematical induction, where n is natural number.

AKTU 2015-16, Marks 10]


Answer
Let Sn):n3+ 2n is divisible by 3.
Step I: nductive base: For n = 1
(1+2.1 =3 which is divisible by 3
Thus, S(1) is true.
Step II: Inductive hypothesis: Let S(k) is true i.e., k + 2k is divisible by
3 holds true.
or k3+ 2k 3s for s eN
=

Step II1:Inductive step: We have to show that Stk + 1) is true


i.e., k + 1"+ 2k + 1) is divisible by 3
Consider (k + 1 + 20k +
1)= k3+ 1+ 32 + 3k + 2k +2
=
(k*+ 2k)+ 3(k +k+ 1)
3s+3 wherel = k2 +k+ le N
3(s-
Therefore, S(tk + 1) is true
Hence by principle of mathematical induction S(n) is true for all

n E N.
1-24 C (CS/AT-Sem-3) Set Theory, Functions & Natural Numbers

Que 1.33. Prove by induction: 2 23t*(n+1) n+1)


AKTU 2016-17, Marks 10
Answer
Let the given statement be denoted by S(n).
1. Inductive base: For n = 1

Hence S (1) is true.


2 Inductive hypothesis : Assume that S (k) is true ie.,
k
1
1.2 2.3 A(k +1)k+1
3 Inductive step : We wish to show that the statement is true for
n =k+lie.,
k+l
1.2 2.3**(k +1Xk + 2) k+2
1 1
Now,2 +1'+ 1Xk +2)
1 k+2k+1
k+1 (k +1Mk +2) (k+ 1Xk + 2)
1
k+
Thus, Stk+ 1) is true whenever S(h) is true. By principle of mathematical
induction, S(n) is true for all positive integer n .

Que 134 Prove by the principle of mathematical induction, that


the sum of finite number of terms of a geometrie progression,
a + ar + arr+... ar = a l r - 1/(r-1) ifr* 1.

AKTU 2014-15, Marks 05


Answer
Basis: True for n = 1 i.e.,
L.H.S = aa

R.H.S= ar-1)
r-1
Therefore, L.H.S. = R.H.S.
Induction: Let it be true for n =kie.,
Discrete Structures & Theory of
Logic 1-25 C (CS/IT-Sem-3)

atar +ar+ . + ark-1 a r -)


(1.34.1)
r
-1
Now we will show that it is true for n = k+l using eq. (1.34.1)
Le, a +ar + a r +.... + ar*+ a r
Using eq. (1.34.1), we get
a (r-1) +ar
r-1
a r - a + ar* - a r " _ a (r**' - 1)
*"=
r-1 1
which is R.H.S. forn =k+ 1, hence it is true for n =k+1.
By mathematical induction, it is true for all n.
Que 1.35.| Prove that if n is a positive integer, then 133 divides
11+122-1 AKTU 2018-19, Marks 07
Answe
We prove this by induction on n.
Base case: For n = 1, 11*l + 12àn-l = 112 + 12 = 133 which is divisible by
133.
Inductive step : Assume that the hypothesis holds for n = k, i.e.,
11 122- = 133A for some integer A. Then for n =k+1,
11"*+122n-1 = 11k+l1+1 + 122k+1)-1
11k* + 122k+1
1111+l + 144* 122-1
=
11* 11k*l+ 11*122k-1133* 122
11[11**+ 122-1+ 133* 122-1
= 11* 133A + 133 * 122k-1
= 133|11A+ 122
Thus if the hypothesis holds for n =k it also holds for k+ 1.
n =
Therefore, the
statement given in the equation is true.

Que1.36. Prove by mathematical induction


n'-
4n is divisible by 3 for all n > =2.

AKTU 2017-18, Marks 07


Answer
Base case : Ifn = 0, then n- 4n2 = 0, which is divisible by 3.
Induetive hypothesis: For some n 2 0, n - 4n is divisible by 3.
Induetive step: Assume the inductive hypothesis is true for n. We need to
show that (n
+
1-40n + 1 is divisible by 3. By the inductive hypothesis, we
know that n 4n4(nis+divisible by 3
Hence (n + 1- 1) is divisible by 3 if
(n+
1 - 4(n + 1)-(n-4n) is divisible by 3.
Set Theory, Functions & Natural Numbers
1-26C(CS/AT-Sem-3)

Now (n + 1)- 4(n + 1)2-(n- 4n2)


4n 1- 4n2 8n-4- nt + 4n2
=
n+4n"+ 6n2 + +

4n+6n-4n-3, 4n 4n(n + 1)
4n is. .Since 4n"
=

which is divisible by 3 if 4n"


-

3.
n-1), we see that 4n"- 4n is always divisible by
that 1 - 4(n + 1) is divisible by 3, and
Going backwards, we conclude (n +

that the inductive hypothesis holds for n +1.


is divisible by 3, for all
By the Principle Mathematical Induction, n'-
of 4n
neN
Que 1.37.| Prove by mathematical induction
(10*-9n-10)/27
3 33+333+. ..3333 =

AKTU 2017-18, Marks 07


L

Answer

+3333 (10+1-9n -

10/27
3+33+333+. . . . .
=

Let given statement be denoted by S(n)


1. Inductive base: For n =1

a_
3 (10-9(1)-10)3 100-19 81 =3
27 27 27
3 3. Hence S(1) is tree.
2. Inductive hypothesis: Assume that Stk) is true i.e.,
3+ 33 + 3 3 3 . . . . + 3 3 3 3 =(10* * l-9k- 10/27
Inductive steps:We have to show that S(k + 1) is also true i.e.,
(10* * 2- 9R
+ )- 10/27
3+33 + 333 + ....
Now, 3 + 33+....+33a . . . . . . 3
3+33 +333 +... +3.
= (10+1-9k - 10/27+3(10**l-1)/9
= (10* +1 + 9 k 10+ 9.10k + 1 - 9 / 2 7

= (10 ++9.10*+I- 9k - 8-10/27 = (10 +2 9k + 1)- 10/27


Thus Stk + 1) is true whenever S(k) is true. By the principle of
mathematical induction S(n) true for all positive integer n.

PART-6
Proof Methods, Proof by Counter Example, Proof by Contradiction.
-

Questions-Answers
Long Answer Type and Medium Answer Type Questions

Que 1.38. What are the different proof methods ?


Discrete Structures & Theory of Logic 1-27C (CS/AT-Sem-3)

Answer
Different methods of
1.
proof are
Direct proof: In this method, will assume that we
from the hypothesisp is true
implication p >q. We can proof that q is true
interference or some by using rules of
combination
other theorem. This will showp qis true. The
of p is true and is false will
q never occur.
2 Indirect methods: These
a Proof by
are
of five types as follows:
contrapositive.
Proof by contradiction (Reductio ad
absurdum).
Proof by exhaustive cases.
Proof by cases.
e. Proof by counter
example.
Que 139.| Explain proof by counter
example.
Answer
In this method, will
wegive an example for which given statement is false.
This example is called counter example.
For example: Prove
by counter that every positive integer can be written
as sum of
square of three integers.
To look for a counter
example we will first write successive positive integers
as the sum of of
square three integers.
l = 1 + 0 + 02
2 12+02+12
3 =12+12 + 12
4 2 +0 +02
5 02+12+ 22
6 12+12+ 22
But there is no way to write 7 as a sum of three squares which gives
counter example. Therefore, given statement is false.

Que 140.| Explain proof by contradiction with example.


Answer
In this method, we assume that q is false i.e.,
q is true. Then by using rules
of inference and other thcorems we will show the
given statement is true
as well as false ie., we will reach at
a contradiction. Therefore,
q must be
true.

For example: Prove that 3 is irrational.


Let 3 is a rational number. Then 1positive prime integerp and q such that
v3 = P

3- p= .(1.40.1)
1-28 C (CS/AT-Sem-3) Set Theory, Functions & Natural Numbers

3/p2 (3 divides p)
3/p (: pis an integer)
p 3r for some x eZ
p?= 92 ...(1.40.2)
From eq. (1.40.1)
and (1.40.2) we get,
9= 3

3/q (3 divides q)
3q
3 dividesp and q which is contradiction to our assumption thatp and
g are prime. Therefore, v3 is irrational.

Que 141. Write a short note on the following with example :


Proof by contrapositive.
ii. Proof by exhaustive cases.
ii. Proof by cases.

Answer
i. Proof by contrapositive: In this we can prove p q is true by
showing-4-pistrue. It is also called proof by contraposition.
Example : Using method of contraposition if n is integer and 3n +2 is
even then n is even.

Letp: 3n + 2 is even
n is even
Let - q is true i.e., n is odd
n 2k + 1, where k e Z
Now, 3n + 2 3(2k + 1)+2
23k + 2) +1
2m+1 where m 3k +2 e = Z
(3n ) is odd pis true
Hence y - p is true.
By method of contraposition p >q is true.
ii. Proof by exhaustive cases : Some proofs proceed by exhausting all
the possibilities. We will examine a relatively small number of examples
to prove the theorem. Such proofs are called exhaustive proofs.
Example : Prove that n2+ 1 2 2" where n is a positive integer and
1 sn s4.
We will verify the given inequality n*+ 122" for n = 1,2, 3,4.
For n = 1; 1+1 =2 which is true
For n = 2; 4+ 1>2 which is true

For n 3;9+1>2 which is true


For n = 4; 16 +1>24 which is true
In each ofthese four cases n2+ 122" holds true. Therefore, by method
of exhaustive cases n2 + 12 2", where n is the positive integer and
1 sns4 is true.
Discrete Structures &Theory of Logic 1-29 C (CSAT-Sem-3)

iii. Proof by Cases : In this method, we will cover up all the possible
cases that we come across while
proving the theoremn.
Example : Prove that if r and y are real numbers, then max (x, y)
min (r, y) = x +y.
Case I: If x s
y, then max (x, y) + min (x, y) y +X
= = X +y.
Case II: ifr >y, then max (x, y) + min
(x, y) = x +y.

VERY IMPORTANT QUESTIONS

|Following questions are very important. These questions


may be asked in your SESSIONALS as well as
UNIVERSITY EXAMINATION

Q.1. Prove for any two sets A and B that, (A u B) = A' nB'.
Ans Refer Q. 1.8.

Q.2. Show that R = {(a, b)|a = b (mod m)) is an equivalence


relation on Z. Show that if x, = y, and *, = , then (x, +*)
,+)
Ans Refer Q. 1.18.

9.3. Let R be binary relation on theset of all strings of 0's and


's such that R = {(a, b)|a and b are strings that have the
same number of 0's1. Is R is an equivalence relation and a
partial ordering relation ?
Ans Refer Q. 1.19
9.4. LetA {1,2, 3,.131. Consider the equivalence relation
on A x A defined by (a, b) R (c, d) if a + d = b + c. Find
equivalence classes of (5, 8).
Ans Refer Q. 1.20.

5 . The following relationon A =(1,2,3, 4). Determine whether


the following:
a. R={(1, 3), (3, 1), (1, 1), (1, 2), (3, 3), (4, 4)1
b. R =A xA
Is an equivalence relation or not ?
Ans Refer Q. 1.21.

Q.6. Let n be a positive integer and S a set of strings. Suppose


that R, is the relation on S such that sR.! if and only if
=4, or both s and t have at least n characters and first n
characters of s and t are the same. That is, a string of fewer
than n characters is related only to itself; a strings with at
2 UNITT
Algebraic Structures

CONTENTS
Part-1 :
Algebraic Structures: **********************2-2C to 2-10C
Definition, Groups,
Subgroups and Order

Part-2 : Cyclic Group, Cosets,*************************.2-10C to 2-16C


Lagrange's Theorem
Part-3 : Normal Subgroups, ************************
.2-17C to 2-18C
Permutation and
Symmetric of Groups

Part-4 Group
:
Homomorphisms,.-. .
Definition and Elementary
219C to 2-22C

Properties of Rings and Fields.

2-1C (CS/IT-Sem-3)
2-2C (CS/IT-Sem-3) Algebraic Structures

PART-1
Algebraic Structures : Definition, Groups, Subgroups and Order.

Questions-Answers
Long Answer Type and Medium Answer Type Questions

Que 2.1.What is algebraic structure ? List properties of algebraie


system.

Answer
Algebraic structure: An algebraic structure is a non-empty set Gequipped
with one or more binary operations. Suppose * is a binary operation on G.

Then (G, *) is an algebraic structure.


Properties of algebraic system: Let lS, *, +} be an algebraic structure
where * and + binary operation on S:
1. Closure property: (a * b) e S
Va,6, e S
2 Associative p r o p e r t y : (a * b) * c = a * (6 * c) y a , b, c e S

3. Commutative p r o p e r t y : (a * b) = (6 * a) v a, b e S

4 Identity element: 3 e e S such that a *e =a (right identity) V a e S,


e is called identity element ofS with respect to operation *.
5. Inverse element: For every a e S, 3a"l e S such that
a *a= e =a"l*a
here a i s called inverse of 'a'under operation *.
6. Cancellation property :
ab=a*c »b=candb *a =c*a»b=c V a, b, c eSand a:0
7. Distributive property:V a, b, c e S
a * (b + c) = (a * b) + (a * c) ( r i g h t d i s t r i b u t i v e )

(6+c)*a = (b *a) + (e *a) (left distributive)


& Idempotent property : An element a e Sis called idempotent element
with respect to operation * i f a * a =a.

Gue 2.2. Write short notes on:

Group ii. Abelian group


i . Finite and infinite group iv. Order of group
V. Groupoid

Answer
Group:Let (G, *) be an algebraic structure where * is binary operation

then (G, *) is called a groupif following properties are satisfied:


Discrete Structures & Theory of Logic 2-3 C (CS/IT-Sem-3)

1. a*b eGv a,b e


G Iclosure propertyl
2. a
*
(b *c) (a * b) *c G
=
Va, b, c e lassociative property|
3. There exist an element e e G such that for any a e G
a "e=e*a =e
lexistence of identityl
4. For every a e G, 3 element a"l e G
such thata *a"l =al *a =e
For example : (Z, +), (R, +), and (Q, +) are all groups.
i. Abelian group:A group (G, *) is called abelian group or commutative
group i f binary operation * is commutative i.e., a *b = b * a y a, b e G

For example: (2, +) is an abelian group.


iis. Finite group: A group (G, *) is called a finite group if number of

elements in G are finite. For example G = (0, 1,2,3, 4, 5) under is a


finite group.
Infinite group: A group 1G, *} is called infinite group if number of
element in G are infinite.
For example, (Z, +) is infinite group.
iv.
Order of group: Order
G. It is denoted (G)
of group G is the number of elements in group
by o
|G|.A or 1 has group of order only the identity
element.
V. Groupoid: Let (S, *) be an algebraic structure in which S is a non-
empty set and * is a binary operation on S. Thus, S is closed with the

operation *, Such a structure consisting of a non-empty set S and a


binary operation defined in S is called a groupoid.
Que 2.3. Deseribe subgroup with example.

Answer
If (G, *) is a group and H sG. The (H, *) is said to subgroup of G if
(H, *) is also a group by itself. i.e.,
(1) a *b eH Va,b e H(Closure property)
(2) 3e e H such that a * e = a =e * a Va e HH

Where e is called identity of G


(3) 3 a - e H such t h a t a * a - l = e= a " l * a V a e H

For example: The set Q ofall non-zero +ve rational number is subgroup
of Q-10).
Que 24.Show that the set G ={«+y /2 Jx,y e Q) is a group with
respect to addition.

Answer
i. Closure:
Let X=x1t /2'1
Y= x2+
V2 2
where , 2 J1. Y2 E Qand X, YeG
24C (CSIT-Sem-3) Algebraic Structures

Then X + Y= (x + /2y1) + (a2 + v2 >2)

(r tX) +1 *2) V2
X+ 2Ye Gwhere X, Y1 e

Therefore, Gis closed under addition l. Sum oftwo rational numbers is


rationall.
ii. Associativity:
Let X, Y and Z e G

where 1,
g3 1 2
Consider (X+ )+Z= «
Y3
+ 2 1 + *g + v2 ) + rg + 2)3)
=

( +
za) +(1 *2) V2) +
(*g +
v2 y)
..(2.4.1)
Also X+(Y +Z)=(a + v2y) +(a + 2y) +zg+ v2y)
( r + v2 y1) + ((a2 +") +2*3) /2)
+ +) +01 t2*s .(2.4.2)
From eq. (2.4.1) and (2.4.2)
V2
CX+Y) +Z = X+ (Y +2)
Therefore, Gis associative under addition.
iii. Identity element:
Lete e G be identity elements of G under addition then
Cx +y 2)+ (e + e2 2 ) =z +y/2

where e= e +e2 v2 and e, ez, , y e


ete22 = 0+0 2
0 and e,= 0 =
e
Therefore, 0 e G is identity element.
iv. Inverse element
-x-y 2 e Gis inverse of x +y 2 eG.
Therefore, inverse exist for every elementx +y 2 e G such that, y eQ
Hence, G is a group under addition.

Que 2.5. Let Hbe a subgroup ofa finite group G. Prove that order
of His a divisor of order of G.
AKTU 2018-19,Marka 07
nswer
1. Let H be any sub-group of order m of a finite group Gof order n. Let us
consider the left coset decomposition of G relative to H.
2. We will show that each coset aH consists of m different elements.
Let H= th, h2 m
Discrete Structures & Theory of Logic 2-5C (CS/IT-Sem-3)

3. Then ah, ahg, .., ah are the members of aH, all distinct.
For, we have
ah, = a h , h , =h,
by cancellation law in G.
4. Since G is a finite group, the number of distinct left cosets will also be
finite, say k. Hence the total number of elements of all cosets is
which is equal to the total number of elements of G.
k
Hence
n =imk
This show that m, the order of H, is a divisor of n, the order of the
group G
We also find that the index k is also a divisor of the order of the group.

Que 2.6.Define identity and zero elements of a set under a binary


operation*. What do you mean by an inverse element?
Answer
Identity element: An elemente in a set Sis ealled an identity element with
respect to the binary operation * if, for any element a in S

a *e =e*a =a
Ifae=a, then e is called the right identityelementfor the operation and
ifea=a, then e is called the leftidentity element for the operation.
Zero element: Let R be an abelian group with respect to addition. The
element 0 e R will be the additive identity. It is called the zero element of R.
Inverse element: Consider a set S having the identity element e with
respects to the binary operation *. If corresponding to each element
a e S there exists an element b e S such that
a *b=b *a =e
Then b is said to be the inverse of a and is usually denoted by a-1. We say a
1s invertible.

ue 2.7. Prove that (Z, (+)) is an abelian group of order 6, where

Z,=10,1,2, 3, 4, 5). AKTU 2014-15, Marks 05


Ane
Answer
The compositiontable is

01 2 3 4 5
2 3 4 5
1 4 5 0
2 2 5 0 1
3 4 5 1 2
3
5 5 2 3 4
Since 2+1 3
2-6C (CS/IT-Sem-3) Algebraic Structures

4 +5 3
From the table we get the following observations
Closure:Since all the entries in the table belong to the given set 2,. Therefore,
Z, is closed with respect to addition modulo 6.
Associativity: The composition +, is associative. Ifa, b, c are any three
elements of Z
+b c) = a +,(b +c) I:b+,c =b+ c(mod 6))
a

= least non-negative remainder when a + (b + c) is divided by 6.


= least non-negative remainder when (a +b) +c is divided by 6.
=
(a +b) +C =
(a +p6)+C.
Identity: We have 0 eZ. Ifa is any element of Z, then from the composition
table we see that
0a = a = a +,0

Therefore, 0 is the identity element.


Inverse: From the table we see that the inverse of 0, 1, 2, 3, 4,5are 0, 5, 4,
3, 2, 1 respectively. For example 4 +2 0 =2+4 implies 4 is the inverse
of 2.
Commutative : The composition is commutative as the elements are
symmetrically arranged about the main diagonal. The number of elements
in the set 2, is 6.

( +) is a finite abelian group of order 6.


Que 2.8. Let G (1, - 1, i, - il with the binary operation

multiplication be an algebraiestructure, where iz y-1. Determine

whether G is an abelian or not. AKTU 2018-19, Marks 07


Answer
The composition table of G is

1 1-1

-i-i -1 1
1. Closure property: Since all the entries of the composition table are
the elements of the given set, the set G is closed under multiplication.
2 Associativity: The elements of G are complex numbers, and we know
that multiplication of complex numbers is associative.
3. Identity: Here, 1 is the identity element.
Inverse: From the composition table, we see that the inverse elements
of1,-1, i,-i are 1,-1,-i, i respectively.
Discrete Structures & Theory of Logic 2-7 C (CSIT-Sem-3)

5. Commutativity: The corresponding rows and columns of the table


are identical. Therefore the binary operation is commutative. Hence,
(G, *) is an abelian group.

Que 2.9. Write the properties of group. Show that the set (1,2, 3,
4, 5) is not group under addition and multiplication modulo 6.

AKTU 2017-18, Marks 07


Answer
Properties of group : Refer Q. 2.26i), Page 2-2C, Unit-2.
Numerical:
Addition modulo 6 (+): Composition table of S = {1, 2, 3, 4, 5) under
operation +6 is given as
Fs 1 2 4 5

2 3
2 3 5 0
3 4 5
4 5 0
5 0 1
Since, 1+5=0 but 0 e
Sie., Sis not closed under addition modulo 6.
So, S is not a group.
Multiplication modulo 6 (*):
Composition table of S = [1, 2, 3, 4, 5) under operation 6 is given as

12 3 4 5

1 1 2
2 2
3

4 2 4 2
5 5 3 2
Since, 2 3 = 0 but 0 e Sie.,Sis not closed under multiplication modulo 6.
So, S is not a group.

Que 2.10. Let G la, a', a', a', a", a =el. Find the order of every
element.
Answer
ola): a =e> o(a) =6
ola): (a3 = a5 = e -o (a2) = 3
ola): (a3) =ad =e olas) = 2
Algebraic Structures
2-8C (CS/IT-Sem-3)

(a6)2 e2 >ola') 3
ola): (a)3 al2
=
= = = = e

-> ola5) 6
ofa): (a5)6 = a30 = (a5)5 =e =e
=

olas) 1
ofa5): (a5) =a5 =e - =

b G be any elements.
group and let a,
e
G be
Que2.11.| Let a

Then
i. (a)' =a
ii. (a* b)-l =b-1*a' AKTU 2014-15, Marks 05
Answer
Lete be the identity element for *in G.
Then we have a
*
a i =e, where a- e G.

Also (a)-1*a-l=e
Therefore, (a-l)-1*a-l=a *a
(a-l)-l=a.
Thus, by right cancellation law, we have *
be G (closure)
Let a and b e G and G is a group for *, then
a
ii.
* * 2.11.1)
Therefore, (a b)=l (a b) =e.
*

then a ,
Let a - and b-1 be the inverses of a and b respectively,
b-1 eG.
=b-1* (a-1l* a) *b (associativity)
Therefore, (b-l *a-1)
*
*b)
(a
(2.11.2)
=b-*e *b =b-1*b=e
From (2.11.1) and (2.11.2) we have,
(a *b)-1* (a *b) =(6-1*a-l)* (a *b)
(a*6)-1 =b-1*a1 (by right cancellation law)

Que 2.12 Prove that the intersection of two subgroups of a group

is also subgroup. AKTU 2014-15, Marks 05

Answer
Let H, and any two subgroups of G. Since at least the identity element
e is common to bothH, and H,
.
In order to prove that H,nH,is a subgroup, it is sufficient to prove that
a eH,nH, b e H,nH,> abl e HnH,
Now a eH,nH,>a eH, and a e H,
beH,nH,»b eH, and b e H2
But H,, H, are subgroups. Therefore,
a eH, b.eH,5abl e H,
a eH2, be H, >abrl e H,
Finally, ab eH,ab'e H, a b l e H,nH,
Thus, we have shown that
aeH,nH, beH,nH,* ab eH,nH,
Hence, H,nH,is a subgroup of G.
Discrete Structures & Theory of Logic 2-9C (CS/IT-Sem-3)

Que 213. Let G be the set of all non-zero real number and let
a b ab/2. Show that (G *) be an abelian group.

AKTU 2015-16, Marks 10


Answer
i. Closure property: Let a, b e G.

a *b = EG as ab : 0
2
*
is closure in G.
ii. Associativity : Let a, b, c eG

Consider c) =a* |bealbc)_abe


* *
a (b ) 4 4

(ab)e _abe
(ab)e G
* i s associativein G.
ii. Existence of the identity: Let a e Gand 3e such that

a *e= de a
ae = 2a

e 2
2 is the identity element in G.
iv. Existence of the inverse : Leta e Gand b e Gsuch that a *b =e = 2
ab. 2
2
ab 4

The inverse ofa is,va e G.

v. Commutative: Let a, b e G

a*b ab
2

and b*a= 0 a b
*2
* is commutative.
Thus, (G, *) is an abelian group.

Que 2.14.|Prove that inverse of each element in a group is unique.

AKTU 2015-16,Marks 10
2-10C (CS/IT-Sem-3) Algebraic Structures

Answer
Let if possible) b and c be two inverses of element a e G.
Then by definition of group:
b*a =a *b=e
and a *c=c*a ze
where e is the identity element of G
b = e * b = (c * a ) * b
Now
=c* (a *6)
=C*C
C

b=c
Therefore, inverse of an element is unique in (G, *).

PART-22 |
Cyclic Group, Cosets, Lagrange's Theorem.

Questions-Answers
Long Answer Type and Medium Answer Type Questions

Que 2.15. Define eyelic group with suitable example.

Answer
Cyclic group:Agroup Gis called a cyclic group if3 at least one element a
in Gsuch that every element z e Gis of the forma", where n is some integer.
The element a e G is called the generator of G.
For example:
Showthat the multiplicative group G = (1,-1,i,-i) is eyelíc. Also find its
generators.
We have, i=i,i?=-1,=-i,i=1.
(-i)=-i, (-iP = -1, (-i =i,(i" =1
and
Thus, every element in G be expressed as i" or (-i"
. Gis cyclic group and its generators are i and -i.

Que 2.16 Prove that every group of prime order is eyclic.

AKTU 2018-19, Marks0


Answer
1. Let G be a group whose order is a prime p.
2. Since P> 1, there is an element a e G such that a#e.
Discrete Structures & Theory of
Logic 2-11 C (CS/IT-Sem-3)

3. The group
<a> generated by 'a is a subgroup of G.
4. By Lagrange's theorem, the order of'a' divides |G|.
5. But the only divisors of
|G|=p are 1 and p. Since a t e we have | <a>|>
1, so I <a>l=p.
6. Hence, G andGis
<a> =
cyclic.
Que 2.17.Show that every group of order 3 is cyclic.
AKTU 2014-15, Marks 05
Answer
Suppose G is a finite group whose order is a prime number p, then to
prove that Gis a cyclic group.
2.
An integer p is said to be a prime number ifp : 0,p #t1, and if the only
divisors ofp are + 1, tp.
3. Some G is a
group of prime order, therefore G must contain at least 2
element. Note that 2 is the least positive prime
4.
integer.
Therefore, there must exist an element a e G such that a * the identity
element e.
5. Sincea is not the identity element, therefore ofa) is definitely22. Let
ola) = m. If H is the cyclic subgroup of G generated by a then
o (H = o (a) = m).
6. By Lagrange's theorem m must be divisor of p. But
a
p is prime and
m22. Hence, m =p.
7. H=G. Since His cyclic therefore G
is cyclic and a is agenerator ofG.
Que 2.18 Show that group (G, +) is a cyclie group where G = {0, 1,
2,3, 4). What are its generators ?

Answer
Composition table of G under operation +5 is shown in Table 2.18.1.
Table 2.18.1.
1 4

3
3
2 2 3 4 0 1
4 0 1 2

0 12 3
0 is the identity element of G under +5
1= 1 = 1 mod 5
12 1+1= 2 mod 5
1 = 1+1+1 =3 mod5
1 =
1+1+ 1+1 =
4 mod 5
15 1 1+1+1+1 =
0 mod 5
2-12C (Cs/IT-Sem-3)) Algebraic Structures

where 1" means 1 is added n times


Therefore, l is generator of G.
Similarly, 2, 3, 4 are also generators of G.
Therefore, G is a cyclic group with generator 1, 2, 3, 4.

Que 2.19. Show that G = [(1, 2, 4, 5, 7, 8), X, is eyelic. How many

generators are there ? What are they?AKTU 2015-16,Marks7.5


Answer
Composition table for Xg is

1
5 2
4 21
1is identity element of group G
2 2 2 mod 9
22= 4 = 4 mod 9
2 8 =8 mod 9
24 = 16 = 7 mod 9
25 = 32 =5 mod 9
25 64 =1 mod 9
Therefore, 2 is generator of G. Hence G is cyclic.
5 is also generator of G.
Similarly,
Hence there are two generators 2 and 5.

Que 2.20. Define cosets. Write and prove properties of cosets.

Answer
Let H be a subgroup of group G and leta e G then the set
Ha = {ha:h e H} is called right coset generated by H and a.
Also the set aH = {ah:h e H) is called left coset generated by a and H.
Properties of cosets: Let Hbe a subgroup of G and let a and b belong
to

G. Then
1. a e aH
:a =ae E aH
Pro
Since e is identity element of G.
2. aH= Hiffa e H.
Proof: Let aH = H.
Then a = ae e aH = H (e is identity in G and so is in H)
a eH

3. aH= bH or aH N bH= ¢
Discrete Structures &Theory of Logic 2-13C (CS/IT-Sem-3)

Proof: Let aH bH
or aH N bH= ¢
=

and to prove that aH = bH.


Let aH i bH
Then there exists h,, h, e H such that
x =
ahj and x =
bh2.
a =
ahl= bh, h,1
Since H is a subgroup, we have h2 hjl eH
let h, h = h eH
Now, aH =bhzh,lH = (bh) H =b (hH) = bh(: hH= H by property 2)
a H =bH ifa H N bH * ¢
Thus, either a H N bH= $or aH = bH.
4. aH = bH iffa"l b eH.
Proof: Let
aH bH.
aaH= a bH
eH= abH (e is identity in G)
H= (alb) H
Therefore by property (2); alb e H.
Conversely, now ifa"be H.
Then consider bH = e (bH) = (a a-) (bH)
=a (1-1 b) H
aH
Thus aH= bHiffa-1b eH.
5. aH is a subgroup of G iff a e H.
Proof: Let aH is a subgroup of G then it contains the identity e of G.
Thus, aH0 eH * ¢
then by property (3) ; aH= eH =H
aH =H*a eH
Conversely, ifa e H then by property (2); aH = H.

Que 2.21 State and prove Lagrange's theorem for group. Is the
converse true ? AKTU 2016-17, Marks 10
Answer
Lagrange's theorem:
Statement: The order of each subgroup of a finite group is a divisor of the
order of the group.
Proof: Let G be a group of finite order n. Let H be a subgroup of G and let
OH)= m. Suppose h, h are the m members of H.
Let a e G, then Ha is the right coset of H in G and we have
Ha =
lh,a, h, a,...ha
Ha has distinct members, since h,a h,a
m = = >
h;,= h;
Therefore, each right coset of H in G has 'm distinct members. Any two
distinet right cosets of H in G are disjoint ie., they have no element in
Algebraic Structures
2-14C (CS/IT-Sem-3)

common. Since Gis finite group, the number of distinct right


a
cosets of H in
G will be finite,say, equal to
k. The union k distinct right cosets
of these of H
in G is equal to G.
the k distinct right cosets of H in G. Then
Thus, if Ha,, Ha,.., Ha, are

G = Ha, U Ha, u Ha,.. UHa, in


G the number of elements
the number of elements in
=

number of elements in
Ha, t . . +the number elements in Ha, t . . . . . + the
of
Ha O(G) = km

n = km
k=
m

m is a divisor ofn.
OCH) is a divisor of O(G).
Proof of converse : If G be a finite group of order n and n e G, then
e
a
Let o (a) =m which implies a" =e.
integral power of a is a subgroup
Now, the subset H of G consisting of all the
of G and the order of H is m.
is divisor of n.
Then, by the Lagrange's theorem, m

Let n = mk, then


a" = a" = (a"" = e* = e

Yes, the converse is true.

theorem.
Que 2.22. State and explain Lagrange's
Answer
Lagrange's theorem:
IfG is a finite group and H is a subgroup of G then o(H) divides o(G
Moreover, the number of distinct left (right) cosets of H in G is o(G)/o(H).
Proof: Let H be subgroup of order m of a finite group G of ordern.
Let H h hgy -.,
h
Leta eG. Then aH is a left coset of H in G and aH = {ah, ah2s .., ah} has m
distinct elements as ah, = ah; h=h,by cancellation law in G.
Thus, every left coset of H in G has m distinct elements.
Since G is a finite group, the number of distinct left cosets will also be finite.
Let it be k. Then the union of these k-left cosets of H in G is equal to G.
i.e., ifa,H, a,H, ., H
are right cosets
of Hin G then
G=a,Hua,HU... Ua,H.
oG)= ofa,H) + ola,H) +.. +o(a^H)
(Since two distinct left cosets are mutually disjoint.)
n = m+ m +.. +mn (k times)

k=
n =mk m

k = olG)
o(H)
Discrete Structures & Theory of Logic 2-15 C (CSIT-Sem-3)

Thus order of each subgroup of a finite group Gis a divisor of the order of the
group.
Cor 1:IfH has m different cosets in G then by Lagrange's theorem:
o(G) = m o(H)

oG)
o(H)
G:H= o(G)
o(H)
Cor 2:If |G|
Let Ja| = m
=n and a
a" =e
e
Gthen a" = e

Now, the subset H of G consisting of all integral powers ofa is a subgroup of


G and the order of H is m.
Then by Lagrange's theorem, m is divisor of ..
Let n = mk, then
a" = amk= (ay* = eh =e

Que 2.23.
a. Prove that every cyclic group is an abelian group.
b. Obtain all distinct left cosets of ((0), (3)} in the group
Z and find their union.
c Find the left cosets of [[0], [3]} in the group (Z *)
AKTU 2016-17, Marks 10
Answer

a. Let G be a cyclic group and let a be a generator of G so that


G= <a> la" : n e Z
Ifg, and g, are any two elements of G, there exist integers r and s such
that8=a' and g, =a". Then
8182 d a' =ats = a"*" = a . c ' = 8 1
So, G is abelian.
b. 0 + H = 13] + H, 11 + 14] +H and (2] + H = [5] + H are the three
distinct left cosets ofH in (Zg,+6).
We would have the following left cosets:
8,H= ls1 h, h e H}
8H= e2h, h e H}
8H= e h, h e H)
The union of all these sets will include all the g' s, since for each set
B B h , h e H}
we have
6. B le, h, h
= e H}
where e is the identity.
Then if we make the union of all these sets we will have at least all the
elements ofg. The other elements are merely 8, for some h. But since g,e G
they would be repeated elements in the union. So, the union of all left cosets
of H in Gis G, i.e.,
Z=101, 111, 121, 131, 141, 16]}
2-16C (CS/IT-Sem-3) Algebraic Structures

Let Z =
{[O], [11, (2), 131, 141, 15]) be a group.
H= [0], [3]) be a subgroup of (26, t6).
The left cosets of H are,
0] +H= {[O), [3])
[1 + H {[11, 14]}
21 +H {[2], [5])
13) +H (13], [O])
14 +H l141, [1}}
151+H={51, (2)}
Que224.Write and prove the Lagrange's theorem. Ifa group
G=3,2,-1,0,1,2, 3,.havingthe addition as binary operation.
IfHis a subgroup of group G where * eH such that x e G. What is

H and its left coset w.r.t 1? AKTU 2014-15, Marks 05

Answer
Lagrange's theorem: Refer Q. 2.22, Page 2-14C, Unit-2.
Numerical :
H= 2:x e
(0,1,4,9, 16, 25..
G =

Left coset of Hwillbe 1+H= 11, 2,5, 10, 17, 26,.


Que 2.25. What do you mean by cosets of subgroup? Consider the
group Z of integers under addition and the subgroup
H=.,-10,-5, 0, 5, 10, ) consideringthe multiple of 5.
Find the cosets of H in Z.
ii. What is index of H in Z ?

Answer
Coset: Refer Q: 2.20, Page 2-12, Unit-2.
Numerical:
i We have Z = (-7,-6,-5,-4,-3,-2,-1,0, 1, 2, 3, 4, 5, 6,..
and H= 10, -5, 0, 5, 10,.
Let 0 e Z and the right cosets are given as
H= H+0 = .-10, 5, 0, 5, 10,. -

H+1= .-9,-4, 1,6, 11,.


H+2 ..,-8,-3, 2,7, 12, ...
H+3 =
l..-7,-2, 3, 8, 13, ..
H+4 (.-6,-1, 4,9, 14, ...
H+5 =
...10, 5, 0, 5, 10, ...) =H
Now, its repetition starts. Now, we see that the right cosets,
H, H+ 1, H+2, H +3, H +4 are all distinct and more over they are
disjoint. Similarly the left cosets will be same as right cosets.
ii. Index of H in Gis the number of distinct right/left cosets.
Therefore, index is 5.
Discrete Structures & Theory of Logic 2-17C (Cs/IT-Sem-3)

PART-3
Normal Subgroups, Permutation and Symmetric of Groups.

Questions-Answers
Long Answer Type and Medium Answer Type Questions

Que 2.26. Write short notes on:


a. Normal subgroup
b. Permutation group

Answer
a. Normal subgroup:A subgroup H of Gis
said to be normal subgroup
of G if Ha =aH V ae G ie., the right coset and left coset of H is G

generated
i
by are the same.
a
Clearly, every subgroup H of an abelian group G is a normal

Subgroup of G. For a Gand h H, ah ha.


e e =

Since a cyclic group is abelian, every subgroup of a cyclic group is


normal.
Permutation group A set G of all permutation on a
:

set A under the binary operation * is called


non-empty
permutation group.
IfA ={1,2, 3, ..., n, the given permutation group formed by A is also
called symmetric group of degree n denoted by S,. Number of elements
of S, will be n!.
Cyclic permutation: Let A = l , Ig ., *.Then let t1, tgy., tk be
elements of set
Aand permutation P:A -> defined by
Pt)=t2
Plt,) = tg

* *

Pth)=
Pt,) = t
is called a cyclic permutation of length k.

For example: Consider A = la, b, c, d, el. Then let Pa= h


bcd
d e
Then P has a cycle of length 3 given by (a, c, d).

Que 2.27. Define the subgroup of a group. Let (G, o) be a group.


Let H la |aeG and a o b = boa for all be Gl. Show that H is a
normal subgroupP.
2-18C (CS/IT-Sem-3) Algebraic Structures

Answer
Subgroup:If(G, *) is a group and HgG.Then (H, *) is said to subgroup of
Gif (H, *) is also a group by itself.
Le.,
a *be HVa, b e H (Closure property)
2. 3e e H such that a *e =a =e *a Va e HI
e is called identity of G.
where *
3 a eHsuch that a * al =e =a"l a Va eH
Numerical: Let (G, x) be a group. A non-empty subset H of a group G is said
to be
a subgroup of G if (H, *) itself is a group.

Given that, H= lala e G and a o b =b oa; Vb e


G
Let a, b e Haox=x oa and b ox =xob, vx e G
(b ox)-l= (x ob)-l
xob-l=b-loxl
b-le H.
Now, (a ob-) ox =a o (b-lox) ois associative]
ao(x ob-1) (: useb-l e H]
= (a ox) ob-
a eH]
= (x o a) ob-
= * o (a ob-)
aob-leH
Therefore, His a subgroup of group G.
Let h e H and g e G and any x in G.
Consider
(g oh og-1)ox = (g ogl oh)ox : he H
= (e o h) ox =hox
*oh h eH
= xo (h og Og-l)
=
xo goh og-i) h e H]
gohog-l eHfor any g e G
His a normal subgroup of G.
Que 2.28. IfN and M are normal subgroup of G then N NM is a
normal subgroup of G.

Answer
As N and M are subgroups of G then N [1 M is a subgroup of G. Letg e G
and a e NN M
a eNanda e M.
Since N is normal subgroup of G, gagl e N
Since M is normal subgroup of G, gagr' e M
gugr' N N Mis
e a normal subgroup of G
Hence N M is a normal subgroup of G.
Discrete Structures & Theory of Logic 2-19C (Cs/AT-Sem-3)

PART 4
Group Homomorphism, Definition and Elementary Properties of
Ring and Fields.

Questions-Answers
Long Answer Type and Medium Answer Type Questions

ue 2.29. Discuss homomorphism and isomorphic group.

Answer
Homomorphism : Let (G,, *) and (G,, *) be two groups then a mapping
f:G,>G,is called a homomorphism iffla b)=fa)* fb) for all a, b e G.
Thus fis homomorphism from G, to G, then fpreserves the composition in
G, and G, i.e., image of composition is equal to composition of images.
The group G, is said to be homomorphic image of group G, if there exist a
homomorphism of G, onto G
Isomorphism : Let (G,, ) and (G, *) be two groups then a mapping
if
f:GG is anisomorphism
i fis homomorphism.
i. fis one to one i.e., fx) =fy)=x=y vx,y G. e

ii. fis onto.

Que 2.30. Give the definitions ofrings, integral domains and fields.

Answer
Ring: Aring is an algebraic system (R, +,*) where R is a non-empty set and
+and are two binary operations (which can be different from addition and
multiplication) and if the following conditions are satisfied:
1. (R, +)is an abelian group.
2. (R,)is semigroup i.e., (a b) e =a (b* c) va, b,e eR.
3. The operation is distributive over +.
i.e., for any a, b, e eR
a (b+c) = (a *b)+ (a c) or (b+ c) a = (b a) + (c ° a)
Integral domain:A ring is called an integral domain if:
i It is commutative
i. It has unit element
i. It is without zero divisors
2-20 C (CS/IT-Sem-3) Algebraic Structures

Field: A ring R with at least two elements is called a field if it has following
properties:
R is commutative
R has unity
ii. Ris such that each non-zero element possesses multiplicative inverse.
For example, the rings of real numbers and complex numbers are also fields.

Que 2.31. Consider a ring (R, +, +) defined by a*a=a,determine


whether the ring is commutative or not.

AKTU 2014-15, Marks 05


Answer
Let a,b eR (a + by=a + b)
( a +b) (a + b) =(a +b)
(a +bla + (a + b)b = (a + b)
(a+ba)+ (ab + b) =(a +b)
(a +ba)+ (ab +b) = (a +b) ( a = a and b = b)
(a +b) + (ba + ab) = (a +b) +0
b a +ab =0
a +b=0a+b=a+a being every element of itsown additive inversel
b=a
a b = ba
. Ris commutative ring.
Que 2.32 Write out the operation table for 1Z, t * Is Z, a

ring? Is an integral domain ? Is a field ? Explain.

Answer
The operation tables are as follows:
we have Z = {0, 1}

1 1 | o
Since (Z2 t22) satisties the following properties :
i Closure axiom: All the entries in both the'tables belong to Z Hence,
closure is satisfied.
i. Commutative: In both the tables allthe entries about the main diagonal
are same therefore commutativity is satisfied.
ii. Associative law : The associative law for addition and multiplieation
are also satisfied.
Discrete Structures & Theory of Logic 2-21 C (Cs/IT-Sem-3)

iv. Here0 is the additive identity and 1 is the multiplicative identity. Identity
property is satisfied.
Inverse exists in both the tables. The additive inverse of 0, 1 are 1, 0
respectively and the multiplicative inverse of non-zero element of Z2

is 1.
vi. Multiplication is distributive over addition.
Hence (Z2, t2 *2) is a ring as well as field. Since, we know that every field is
an integral domain therefore it is also an integral domain.

Que 2.33.If the permutation of the elements of 1, 2, 3, 4, 5} are

given by a =(123) (4 5), b = (1) (2) (3) (4 5), c = (1524) (3). Find the value
ofx, if ar =b. And also prove that the set Z,= (0, 1,2,3) is a commutative
ring with respect to the binary modulo operation + and

AKTU 2015-16, Marks 10


Answer
ax =b (123) (45) x = (1) (2) (3) (4, 5)

(1 2 3 4 5/1 2 3 4 5. 3 4
l2 a1 4 512 3 5
4 23 5 4
(123 4 5= 3 5 4

2 3 1 5 41 2 3 5 4
2 3 1 5 4/1 2 3 4 5
u 2 3 4 5/1 2 3 54
1 2 3 4 5/1 2 34 5
la 1 2 5 ali 2 3 5 4
3 4
1 2 4 5
4 0 1 2 3
t0 1 2 3 0 0 0 0 0
00 1 23
2 3 0 0 1 2 3
1|1
2 2 3 0 1 2 0 2 0 2
3 3 0 1 2 3 0 3 2
We find from these tables:
. All the entries in both the tables belong to Z,. Hence, Z, is closed with
respect to both operations.
Algebraic Structures
2-22C (Cs/IT-Sem-3)
identical
ii. Commutative law: The entries of 1st, 2nd, 3rd, 4th rows are

4th columns
the 1st, 2nd, 3rd,
with the corresponding elements of
is commutative with respect to
respectively in both the tables. Hence, 2,
both operations.
and multiplication
ii. Associative law: The associative law for addition
a +(b+4c) = (a +,6) +4c for all a, b, c e Z,
a x (b xc) = (a x,b) xc, for all a, b, c eZ4
can easily be verified.
multiplicative
of identity:0is the additive identity and
1is
iv. Existence
identity for 24
1
v. Existence of inverse: The additive inverses of 0, 1, 2, 3 are 0, 3, 2,
respectively.
Multiplicative inverse of non-zero element 1, 2, 3 are 1, 2, respectively.
3
vi. Distributive law: Multiplication is distributive over addition i.e.,
a x b +c)=a xb +a x,e

(b+c) xa=b x^a + cxa


b +,c =b+c(mod 4)
For, a
xlb +c) a x,{b + c) for
=

+ c) is
least positive remainder when a x (b
divided by 4
= least positive remainder when ab + ac is divided
by 4
ab +4c
a
xb +4 x£
For a xb a xb (mod4)
Since (Z,+) is an abelian group, (Z4, *) is a semigroup and the operation is
distributive over addition. The (Z t4X)is aring. Now (Z4*)is commutative

with respect to x4. Therefore, it is a commutative ring.

Que 2.34. What is meant by ring ? Give examples of both


commutative and non-commutative rings.

AKTU 2018-19, Marks 07


Answer
Ring: Refer Q. 2.30, Page 2-19C, Unit-2.
Example of commutative ring: Refer Q. 2.31, Page 2-20c, Unit-2.
Example of non-commutative ring: Consider the set R of 2 x 2 matrix
with real element. For A, B, C eR
A * (B + C) = (A * B ) + ( A * C)

also, (A + B)*C = (A *C)+(B *C)


i s distributive over +.
( R , +, *) is a ring.
We know that AB : BA, Hence (R, +, *) is non-commutative ring.
3
UNIT
Lattices and
Boolean Algebra

CONTENTS
Part-1 : Lattices: Definition, .**************************s*.
..3-2C to 3-10CC
Properties of Lattices-Bounded,
Complemented, Modular
and Complete Lattice

Part-2 Boolean Algebra :. .3-10C to 3-13C


Introduction, Axioms and
Theorems of Boolean Algebra

Part-3 Algebraie Manipulation. 1 3 C to 3-17C


of Boolean Expressions,
Simplification of Boolean
Functions, Karnaugh Maps

Part-4 Logic Gates, Digital. .3-17C to 3-20C


***********************

Circuits and
Boolean Algebra

3-1C (CS/IT-Sem-3)
3-2C (CS/IT-Sem-3) Lattices and Boolean Algebra

PART-1
Lattices: Definition, Properties ofLattices-Bounded,
Complemented, Modular and CompleteLattice

Questions-Answers
Long Answer Type and Medium Answer Type Questions

Que 8.1 Define lattice. Give its properties.

Answer
A lattice is a poset (L, s) in which every subset la, b} consisting of2 elements
has least upper bound (lub) and greatest lower bound (glb). Least upper
bound of la, b} is denoted by a vb and is known as join of a and b. Greatest
lower bound of la, b} is denoted byanb and is known as meet of a and b.
Lattice is generally denoted by (L, A, v).
Properties:
Let L be a lattice and a, b eL then
1. Idempotent property:
i. a va=aa i. a aa=a
Commutative property:
i avb=bva i. a ab=baa
3 Associative property:
i av(bvc)=(avb)ve ianbac) =(a nb) nnc
Absorption property:
i av (aab) =a i an (avb) =a
5. i avb=biffa «b i. anbza iffa<b
i. anb =aiffa v b =b
6 Distributive Inequality:
i an bve)2(a ab) v (a nc) iav(bac) s(a vb) n (avc)
7. Isotonicity:
Let a, b, c, EL and a <b, then
i. avc b v c c i. a ac b a c
8. Stability:
Let a, b, c, e L, then
a sb, a sc>a < (bv c),a < (bac)
i. ab, a >c >a >(bac), a > (b ac)

Que 3.2.Explain types of lattice.


Discrete Structures & Theory of Logic 3-3C (CSIT-Sem-3)

Answer
Types of lattice:
L Bounded lattice: A lattice L is said to be bounded if it has a greatest
element 1 and a least element 0. In such lattice we have
avl 1,anl=a
av0= a, an0=0
Va eL and 0 Sa sI
Complemented lattice : Let L be a bounded lattice with greatest
element l and least element 0. Let a e L then an element a' eL is
complement of a if,
ava'=1 and a aa'=0
A lattice L is called complemented ifis bounded and ifevery element in
L has a
complement.
3 Distributive lattice: A lattice L is said to be distributive if for any
element
i
a, b and c of Lfollowing properties are satisfied :
av (bac)= (a vb) a (a vc)
i anlbve) = (a nb) v (a nc)
otherwise L is non-distributive lattice.
4 Complete lattice : A lattice L is called complete if each of its non-
empty subsets has a least upper bound and greatest lower bound.
For example:
i (Z, S)is not a complete lattice.
Let S be the class of all subsets of some universal set A andHa
relation is defined as X s Y~ X is a subset of Y such that
XnY=XnY and X uY. Every subset of S has glb and lub. So, S
is complete.
5. Modular lattice : A lattice (L, S) is called modular lattice if,
av(bac) = (a vb) Ac whenever a sc for all a, b, c e L.

Que 33.If the lattice is represented by the Hasse diagram given


below:
Find all the complements of 'e.
ii. Prove that the given lattice is bounded complemented lattice.
b

.1
AKTU 2014-15, Marks 10
3-4C (CS/IT-Sem-3) Lattices and Boolean Algebra

Answer
i. Complements ofe are c and d which are as follows:
Cve=b , CAeÍ
dve=b ,dne=f
Here b is
ii. A lattice is bounded if it has greatest and least elements.
greatest and fis least element.
lattice. For any a, b, c, d in a lattice (A, ) ifa sb
Que 3.4.Define a
and c Sd then show that a v e s b v d and a ncSbad.

AKTU 2018-19, Marks 07


Answer
Lattice: Refer Q. 3.1, Page 3-2c, Unit-3.
Numerical:
sbsbvdand c sd <bvd.
As a Sb and c s d, a

By transtivity of s, a sbvdand c sbv d.


So bv d isupper bound of a and
an c.

Soa vesbvd.
As a ac Sa
and a Ac Sc, ancSa aband a a c s c sd.
Hence a nc is a lower bound ofb and d. So a n c sbAd.
So a acsbad.

bounded distributed lattice, prove if aa


Que 3.5. Let L be a

Is complemented lattice ?
complement exists, it is unique. D2 a

Draw the Hasse diagram of [P (a,b,c), 3, (Note:<stands for subset)D.


Find greatest element, least element, minimal element and maximal

element. AKTU 2016-16, Marks 15


OR
Draw the Hasse diagram of [P (a,b,c),clNote:'c stands for subset).
maximal
Find greatest element, least element, minimal element and
element. AKTU 2015-16, Marks 10

Answer
Let a, and a, be two complements of an element a e L.
Then by definition of complement

ava =I ...(3.5.1)
anG -0
ava .3.5.2)
ana2 0
Discrete Structures & Theory of Logic 3-5 C (CS/IT-Sem-3)

Consider a a v0

Vla Aa) Ifrom (3.5.2)]


=
(a,va) (a, va2)
a
Distributive property
=
(ava,) (a, va)
n
[Commutative propertyl
=
Inla, a)v from (3.5.1)]
.(3.5.3)
Now Consider
a2V0
@2 V(aAa) from (3.5.2)1
=
(ag va) n (a, va) Distributive propertyl
=
(avaz)n (a, vag) [Commutative property
=
Ia(aj va) from (3.5.1)
a VG2 ..(3.5.4)
Hence, from (3.5.3) and (3.5.4),

So, for bounded distributive lattice complement is unique.


Hasse diagram of [Pla, b, c), cl or [Pla, b, c), S] is shown in Fig. 3.5.1.
la, b
c

la, bl la, cl (b, c

a {b} c

Fig. 3.5.1.
Greatest element is (la, b, cl and maximal element is la, b, c)..
The least
element is and minimal element is ¢.
Que 3.6.The directed graph G for
a relation R on set A =
{1,2,3,
4) is shown below :

Fig. 3.6.1.
Lattices and Boolean Algebra
3-6C (CS/AT-Sem-3)

Verify that (A, R) is a poset and find its Hasse diagram.


ii. Is this a lattice ?
needed in the Fig. 3.6.1 to extend
iii. How many m o r e edges are

(A, R) to a total order ? elements ?


iv. What are the maximal and minimal

AKTU2014-15, Marks 10
Answer
The relation R corresponding to the given directed graph is,
R= {(1, 1), (2, 2), (3, 3), (4, 4), (3, 1), (3, 4), (1, 4), (3, 2))
and transitive.
Ris a partial order relation ifit is reflexive, antisymmetric

Reflexive : Since aRa, VaeA. Hence, it is reflexive.


b otherwise aRb
Antisymmetric: Since aRb and bRa then we get a =

or bRa.
Hence, it is antisymmetric.
Transitive: For every aRb and bRe we get aRc. Hence, it is transitive.

Therefore, we can say that (4, R) is poset. Its Hasse diagram is

3 Fig. 3.6.2.
Since there is no lub of 1 and 2 and same for 2 and 4. The given poset is
not a lattice.
2 3 4
v1
1 1 - 1 1

2-2 2
3 1 2 3 1
4|1 1 4
i. Only one edge (4, 2) is included to make it total order.
iv. Maximals are 11, 2) and minimals are 13, 4).

Que3.7. In a lattice ifa sbse, then show that


a. avb =bac

b. (avb)v (bac) = (av b) a (a v c) =b ARKTU 2016-17, Marks 10o

Answer
a. Given:a sb Sc
Diserete Struetures & Theory of Logic 3-7C (CS/IT-Sem-3)

Now avb= least upper bound of a, b


= least lall upper bounds of a, b}

least using a S bscl


=
lb, c,.
b .3.7.1)
and bac= greatest lower bound of b, c
= maximum lall lower bounds of b, cl

maximum lb, a,..) lusinga sb scl


..3.7.2)
Eq. (3.7.1) and (3.7.2) gives, a v b=bac
b. (a vb)v (b nc)> (a vb) a la ve) =b
Consider, (a vb) v (bac)
= bvb lusing a sb Scand definition of v and a]
b (3.7.3)

and (a v b) a (a vc)=bac
= b ..(3.7.4)
Fromeq. (3.7.3) and (3.7.4), (a v b) v (b ac) = (a vb) a (av c) =b.

Que 3.8.
a. Prove that every finite subset of a lattice has an LUB and a
GLB.
b. Give an example of a lattice which is a modular but not a

distributive. AKTU 2016-17,Marks 10


Answer

1. The theorem is true if the subset has 1 element, the element being
its own glb and lub.
2. It is also true if the subset has 2 elements.
3. Suppose the theorem holds for all subsets containing 1, 2, .., k
elements, so that a subset a, G2, .., G of L has a glb and a lub.
4. If L contains more than k elements, consider the subset
a,a Gh+1 of L.
5. Let w = lub (a1, a 2 , ) .

Lett lub (w, aj, 1).


7. Ifsis any upper bound of a , Gg, + 1 then s is 2 each of a,, a
a, and therefore s 2 w.
8. Also, s 2ag,1 and therefore s is an upper bound of w and a,1
9. Hence s 2t.
10. That is, since t 2 each a, t is the lub ofa, G2 . , a . 1
11. The theorem follows for the lub by finite induction.
3-8C (CSIT-Sem-3) Lattices and Boolean Algebra

12. IfL is finite and contains m elements, the induction process stops
when k +1 =m.

1. The diamond is modular, but not distributive.


2. Obviously the pentagon cannot be embedded in it.
3. The diamond is not distributive:
yv (xAz) = y (y vx) A (y v z) =1

4. The distributive lattices are closed under sublattices and every


sublattice ofa distributive lattice is itself a distributive lattice.
5. If the diamond can be embedded in a lattice, then that lattice has a
non-distributive sublattice, hence it is not distributive.

Que3.9. Show that the inclusion relation is a partial ordering


on the power set of a set S. Draw the Hasse diagram for inclusion on
the set P(S), whereS= la, b, c, d}. Also determine whether (P(S), c) is

a lattice. AKTU 2018-19, Marks 07


Answer
Show that the inclusion relation ( ) is a partial ordering on the power set of
a set S.
Reflexivity : A cA whenever A is a subset of S.
Antisymmetry: IfA and B are positive integers with AcB and BcA, then
A =B.
Transitivity:IfA gB and Be C, then A sC.
Hasse diagram
(a, b, c, d}

ta, ba) lae, d} {b, c, d


la, b, cl

la, b} a a, ,c ba (C, d

a b d

Fig. 3.9.1.
Discrete Structures &Theory of Logic 3-9C (CSIT-Sem-3)

(PS), )is not a lattice because (la, b),1b, d) has no lub and glb.
Que 3.10. Explain modularlattice, distributive lattice and bounded

lattice with example and diagram. AKTU 2017-18, Marks 10


Answer
Modular distributive and bounded lattice : Refer Q. 3.2, Page 3-2C,
Unit-3.
Example
Let consider a Hasse diagramn:

Fig. 3.10.1.
Modular lattice:
0saie., taking b = 0
bv(anc) =0v0=0,an (bve) =anc=0
Distributive lattice
For a set 8, the lattice PlS) is distributive, since union and intersection each
satisfy the distributive property.
Bounded lattice: Since, the given lattice has 1 as greatest and 0 as least
element so it is bounded lattice.

ue 3.11. Draw the Hasse diagram of lA, ), where


A 13, 4, 12, 24, 48, 72) and relations be such that a sb ifa divides b.

AKTU 2017-18, Marks 07


Answer
Hasse diagram of (A, S) where A = {3, 4, 12, 24, 48, 72)

Fig 3.11.1,
ue 3.12. For any positiveintegerD36, thenfind whether (D36,')
is lattice or not ? AKTU 2017-18, Marks 07
3-10C (CS/TT-Sem-3) Lattices and Boolean Algebra

Answer
D36 = Divisor of 36 = {1,2,3, 4, 6,9, 12, 18, 36)
Hasse diagram:
(1 v3) 13, 61, (1 v 2) = (2, 4),(2 v 6) = (6, 18), (9v 4)= l)

Since, 9v4 I¢
So, D36 is not a lattice.

PART-2
Boolean Algebra: 1Introduction, Axioms and Theorems of
Boolean Algebra.

Questions-Answers
Long Answer Type and Medium Answer Type Questions

9ue3.13. What is Boolean algebra ? Write the axioms of Boolean


algebra. Also, describe the theorems of it.

Answer
A Boolean algebra is generally denoted by (B, +,.,0, 1) where (B, +,) is a
lattice with binary operations+ and" called the join and meet respectively
and () is unary operation in B. The elements 0 and 1 are zero (least) and unit
greatest) elements of lattice (B, +, ). B is called a Boolean algebra if the
following axioms are satisfied for all a, b, c in B.
Axioms of Boolean algebra :
Ifa, b, e e B, then
1. Commutativelaws
a. a+b=b+a b. a.b = b.a

Distributive laws:
a. a+ (b.c) = (a + b)la +c) b. a.lb + c) = (a.b) = (a.c)
3. Identity laws:
a. a+0 =a b. a.l=a
Discrete Structures & Theory of Logic 3-11 C (CS/IT-Sem-3)
4. Complement laws:
a. a +a' = 1 b. a.a' =0

Basic theorems:
Let a, b, c e B, then
1. Idempotent laws:
a. a + a =a b. a.a=a
2. Boundedness (Dominance) laws:
a. a+1= 1 b. a.0 =0
3. Absorption laws :
a. a+(a.b) =a b. a.(a +6) =a
4. Associative laws
a. a+6) + c = a + (b + c) b. (a.b).c = a.(b.c)

Uniqueness of complement:
a +x=land a.x = 0, then x = a
6. Involution law: (a'Y =a
7. a. 0' =1 b. 1'=0
8. De-Morgan's laws:
a. (a +b) =
a.b b. (a.b =a' +b'

Que 3.14. Prove the following theorems:


a. Absorption law : Prove that V a, b, e B
i. a.la+6) =a ii. a + a.b = a
b. Idempotent law: Prove that V ae B, a + a=a and a.a =a.
c. De Morgan's law: Prove that V a, b, e B
i. (a+b) =a'.b' is. (a. b)y =a' +b'
d Prove that 0' = 1 and 1' = 0.

Answer
a. Absorption law:
i. To prove: a.(a +b) = a
Let a.(a + 6) = (a + 0).(a +b) by Identity law
a +0.b by Distributive law
a +6.0) y Commutative law
a+0 by Dominance law
by Identity law
ii. To prove:a +a.b = a

Let a+a.b =
a.1 +a.b by Identity law
= a.(1+b)
by Distributive law
= a.(b + 1)
by Commutative law
a.1 by Dominance law
= a
by Identity law
3-12C (CS/IT-Sem-3) Lattices and Boolean Algebra
b. Idempotent law:
To prove:a +a =a and a.a =a

by Identity law
a = a +0
Let by Complement law
= a +a. a
by Distributive law
(a+a).(a +a'
= (a +a).1
by Complement law
by Identity law
a+a1
a = a.l by Identity law
Now let
a.(a+a')
by Complement law
by Distributive law
a.a +a.a'
a.a+0
by Complement law
by Identity law
aa
c. De Morgan's law:
i. To prove: (a + b ' = a'.b'

To prove the theorem we will show that


(a +b) +a'.b' = 1
Consider (a +b)+a'.b' = {(a + b) +a'l.(a +b) +6')by Distributive law
= ((b +a)+a').{(a +b) +6)|
by Commutative law
= lb + (a +a')).{a + (b +b'))
by Associative law
= (b + 1).(a + 1) by Complement law

= 1.1 by Dominance law


= 1 ..(3.14.1)
Also consider (a +b).a'b' = a'b'.a +6) by Commutative law
= a'b'.a+a'b.b by Distributive law
a.(a'b')+a'.(b'b) by Commutative law
= (a. a').b' +a.b. b) by Associative law
= 0.b'+a'0 by Complement law
b.0+a'.0 by Commutative law
= 0+0 by Dominance law
= 0 ..(3.14.2)
From eq. (3.14.1) and (3.14.2), we get,

a'b' is complement of (a +6) i.e.la +b)' =a'b'.


To prove: (a. bY = a' +b'
Follows from principle of duality, that is, interchange operations+ and

and interchange the elements 0 and 1.


d To prove:0'=1 and l'=0. by Complement law
0' (a a')
=a'+(a' by De Morgan's law
= a'+a by Involution law
a+a' by Commutative law
1 by Complement law

Now (0'Y = 1'


0 1
1' 0.
Discrete Structures & Theory of Logic 3-13 C (CS/IT-Sem-3)

Que 3.15. Define Boolean algebra. Show that in a Boolean algebra


meet and join operations are distributive to each other.

Answer
Boolean algebra: Refer Q.3.10, Page 3-10C, Unit-3.
Meet and join operations are distributive:
L Let L be a poset under an orderings. Let a, b e
L
We define
avb (read "a join b") as the least upper bound of a and b, and
a nbread "a meet b") as
greatest lower bound of a and b.
3. Since the join and meet operation produce a unique result in all cases
where they exist, we can consider them as binary operations on a set if
they always exist.
4. A lattice is a poset L (under ) in which every pair of elements has a lub
and a glb.
5. Since a latticeLis an algebraic system with binary operations A and v, it
is denoted by [L, v, al.
6. Let us consider,
a. PA), v, Al is a lattice for any set A and
b. The join operation is the set operation of union and the meet
operation is the operation of intersection; that is, v = U and a = n.
7. It can be shown that the commutative laws, associative
laws, idempotent
laws, and absorption laws are all true for any lattice.
8. An example of this is clearly [PA); U, nl, since these laws hold in the
algebra of sets.
9. This lattice is also distributive such that join is distributive over meet
and meet is distributive overjoin.

PART-3
Algebraic Manipulation of Boolean Expressions, Simplification
ofBoolean Functions, Karnaugh Maps.

Questions-Answers
Long Answer Type and Medium Answer Type Questions

Que 3.16, Express each Boolean expression as SOP and then in its
complete sum-of-products form.
3-14C (CSNT-Sem-3) Lattices and Boolean Algebra

a. E=x(xy' +*'y +y'z)


b. E = zlx' +y) + y.
Answer
a. E=xxy' +xx'y +xy'.z =xy +xy'.z =xy
( x.x'y = 0 andxy' is contained in xy'.2)
Complete SOP form = xy (z +z) (: zis missing)
*y'.2 +xy'.z'
b. E = z.(x'+ y) + y' = r'z +y.2 +y'
Then E =*'.zly +y') +y.z.(x +*') +y.(x +*) (z +z)
(by Complement law)
=*'yz +x' y'z +xy.z +r'yz +xy'z +x2'y'
+x'y'z+x'y2
x ' y z + x'yz +xyz +xy'z +xy2 +ry'2

Que 3.17 Define a Boolean function of degree n. Simplify the


following Boolean expression using Karnaugh maps
yz + *yz +x'y'z +*'yz + x'y'z'

Answer
Boolean function of degree n
1 Let B = (0, 1). Then B" = ( , *g..)lx,B for 1sisn) is the set of all
possible n-tuples of Os and ls.
2 The variable x is called a Boolean variable if it assumes values only
from B, that is, if its only possible values are 0 and 1.
3. A function from B" to B is called a Boolean function of degree n.
4 For example, the function Flx, y) =xy from the set of ordered pairs of
Boolean variables to the set (0, 1), is a Boolean function of degree z
with F1, 1)= 1, F1, 0) = 0, F0, 1) = 0 and F(0, 0) = 0.

Numerical : The Karnaugh map for the given function is:


xyz + xy'z +x'y'z + x'yz +x'y'?

y'z yz yz yz'

Fig. 3.17.l.
Then the simplified expression is : z +*'y'.

Que 8.18. Simplify the following Boolean functions using three


variable maps:
Discrete Structures & Theory of Logic 3-15C (CS/IT-Sem-3)
a. F (r,y, 2) = 2(0, 1, 5, 7)
b. Fx, y, 2) = 2(1, 2, 3, 6, 7)

Answer
a. Rx, y, 2) = X{0, 1, 5, 7)

0 1
od
0 2 3
167
14
f 3y +xz

Fig. 3.18.1
b. flx,y, 2) = E (1, 2, 3, 6, 7)

0 0 01 1110

Fig. 3.18.2
f= Tz +y

Que 3.19. | Simplify the following Boolean function using K-map:


Fla, y, 2) = z(0, 2,3, 7)

AKTU 2017-18, Marks 07


Answer
00 01 11 10

LI
F= T2 +y2

Que 3.20. Simplify the following Boolean expressions using


K-map:
a. Y=((AB) +A'+ABy
b. A'B' CD' +A'B' CD +A'B' CD +A'B CD'=A'B

AKTU 2015-16, Marks 10


Answer
a. Y= (ABY + A' +ABY
= ((ABYY A'+ (AB)»

(AB) (A')y AB))


Lattices and Boolean Algebra
3-16C (CS/AT-Sem-3)
= AB (A (A' +B'))

= AB (AA' +AB')
=
AB(0 + AB) =
AB AB
ABB

Here, we find that the expression is not in minterm. For getting minterm,
we simplify and find that its value is already zero. Hence, no need to usee

K-map for further simplification.


b. A'B' CD' +A'B' C'D+A'B CD +A'B' CD' =A'B
=A' B'CD'+A'B'CD +A'B'CD +A'BCD'

cDAB

A'B'CD
A'BC'D
A'B'CD-

A'B'CD
Fig. 3.20.1
On simplification by K-map, we get A'B" corresponding to all the four
one's.

Que 3.21 Pind the Boolean algebra expression for the following

system. AKTU 2016-17, Marks 7.5

Fig. 3.31.1.

Answer
ABC
ABC+ ACB +C)
A.B'+C'

Fig. 3.21.2
Discrete Structures & Theory of Logic 3-17C (CS/IT-Sem-3)

Que 3.22. Find the Sum-0f-Products and Product-Of-sum


expansion of the Boolean function Flx, y, z) = (* +y) z'.

AKTU 2018-19, Marks 07


Answer
Flx, y, z) =(x +y)z'

+ (x +y)z
0

0 0 0

0_ 0 0

Sum-Of-Product:
F x ,y, z) = xyz' +*y'z' +x'yz'

Product-0f-Sum:
Px, y, z) = (x +y +z\x +y'+ z\r'+y + z)\x'+y' +z)

r+y' +2)

PART-4
Logic Gates, Digital Circuits and Boolean Algebra

Questions-Answers
Long Answer Type and Medium Answer Type Questions

Que 3.28. Consider the Boolean function.

i Simplify falgebraically
ii. Draw the logie circuit of the fand the reduction of the f.
b. Write the expressions E, = (* + * * y) + (x/y) and
B,=x+ (r "y +y\ly), into
3-18C (CS/AT-Sem-3) Lattices and Boolean Algebra

Prefix notation

i. Postfix notation AKTU2014-15, Marks 10


Answer
i. Ax, gy
a.
g *)="+ (ag.a1' +X2) +Xg.r2+x,)

+(1+) +,*2 +3344

ii. Logic circuit:

Fig 3.28.1
Reduction off:
f g z)=*+(a,a +z2)+*,.rg +x,)

b. E = (x +x *y) + zly)
Binary tree is:

O-
R
Fig. 3.23.2.
Prefix:++ x "xyl*
Postfix: * y * + * y l +

E =* + ( "y + yMy)
Discrete Structures & Thecry of Logic 3-19C (CS/IT-Sem-3)

Binary tree is:

0-

Fig. 3.23.3.
Prefix: +x/+ **y yy
Postfix : z xy *y +yl+
Que 324 Construct circuits that produce the following output :

FX,Y,2)= (X+Y+2) RY})


Answer
The logic network is shown below :

X+Y+Z

CX+Y+Z)X YZ

Fig. 3.24.1.

Que 3.25. Draw the logie network corresponding to the following


Boolean expressions
y+
ii. XYZ+X'YZ + XY
3-20 C (CS/IT-Sem-3) Lattices and Boolean Algebra

Answer
i. The logic network is shown in Fig. 3.25.1.

xy + Xy

Fig. 3.25.1
ii. The logic network shown in Fig. 3.25.2.

XYZ'

XY Z + XYZ+ XY
XYZ

D XY
Fig. 3.25.2

VERY IMPORTANT QUESTIONS

Following questions are very important. These questions


1y be asked in your SESSIONALS as uwell as
UNIVERSITY EXAMINATION.

Q1. If the lattice is represented by the Hasse diagram given


below:
i. Find all the complements of 'e'.
ii. Prove that the
given lattice is bounded complemented
lattice.
b

Fig. 1.
4
UNIT
Propositional Logic
and Predicate Logic

CONTENTS
Part-1: Propositional Logie ****** ** 4-2C to 4-6C
Proposition, Well Formed
Formula, Truth Tables

Part-2 4-6C to 4-14C


Tautology, Satisfiability,..
Contradiction, Algebra of
************|

Proposition, Theory of Inference

Part-3 : Przdicate Logic:. 4-15C to 4-19C


First Order Predicate,
Well Formed Formula
of Predicate, Quantifiers,
Inference Theory of
Predicate Logic

4-1C(CS/IT-Sem-3)
4-2C (CS/IT-Sem-3) Propositional Logic & Predicate Logic

PART-1
Propositional Logic: Proposition, Well Formed Formula,
Truth Tables.

Questions-Answers
Long Answer Type and Medium Answer Type Questions
-

Que 4.1. Define the term proposition. Also, explain compound


proposition with example.

Answer

Proposition: Proposition is a statement which is either true or false but not


both. It is a declarative statement. It is usually denoted by lower case letters
called Boolean variable or logic variable.
P, g, r, s, t etc. They are

For example:
1 Dr.A.P.J. Abdul Kalam was Prime Minister of India.
2. Roses are red.
3. Delhi is in India
true.
(1) proposition is false whereas (2) and (3) are

Compound proposition:A compound proposition is formed by composition


of two or more propositions called components or sub-propositions.

For example:
1. Risabh is intelligent and he studies hard.
2. Sky is blue and clouds are white.
and "he
Here first statement contain two propositions "Risabh intelligent"
is
studies hard" whereas second statement contain propositions "sky is blue"
and "clouds are white". As both statements are formed using two propositions.
So they are compound propositions.

Que 4.2.Discuss connectives in detail with truth tables.


Answer
1. The words or phrases used to form compound proposition are called
connectives.

2. There are five basic connectives as shown in the Table 4.2.1.


Discrete Structures & Theory of Logic 4-3 C (CS/IT-Sem-3)

Table. 4.2.1.

S. No. Connective words Name of connective Symbol


Not Negation - or or

And Conjunction
Or Disjunction
If-then Implication
If and only if Biconditional

i. Negation: If P is a proposition then negation of P is a proposition


which is true when p is false and false when p is true. It is denoted
by p or o r p' or p
Truth table:

F
T
ii. Conjunction: Ifp and q are two propositions then conjunction of
p and q is a proposition which is true when both p and q are true
otherwise false. It is denoted byp aq.
Truth table:
PA
T T
F F
T
F F
iii. Disjunction: Ifp and q be two
and q is
propositions, then disjunction of p
a
proposition
which is true when either one
of p or q or both
are true and is false when
bothp and q are false and it is denoted by
P vq.
Truth table

Pvq
T T
T
T T
F
4-4 C (CS/IT-Sem-3) Propositional Logic & Predicate Logic

Que 4.3. What do you mean by well formed formula?

Answer
1 Well formed formula is defined as a mathematical expression
represented in well defined form and uses parenthesis, braces and
square brackets to avoid the ambiguity
2. Logical statements are also represented in well defined form using
parenthesis according to priority of operations. To generate well formed
formula recursively, following rules are used:
An atomic statement P is a well formed formula.
ü. If Pis well formed formula then - Pis also a well formed.
ii. IfPand Q are well formed formulae then (Pv Q), (PaQ),
and (P> Q)
(P>)
are also well formed formulae.
iv. A statement consists of variables, parenthesis and connectives is
recursively a well formed formula iff it can be obtained by applying
the above three rules.
For example:
1. (P (PvQ)
2 ((PQ)>R)
Que 4.4.Write short notes on:
i. Truth table ii. Logical equivalence

Answer
Truth table: A truth table is a table that shows the
truth value of a
compound proposition for all possible cases.

P P

T| T T T F
T F
T FT
F
T F| T T
LFF
ii. Logical equivalence: If two propositions P 9,
where p, q, are propositional variables, have (P. ...)and Q (p, q,.)
the same truth values
in every possible case, the
propositions
simply equivalent, and denoted by
are called logically equivalent or
P(p,q, . . ) Q{p, 9, .
Que 4.5.Explain the
following terms with suitable example:
i. Conjunction
ii. Disjunction
ii. Conditional
Discrete Structures & Theory of Logic 4-5C (CS/IT-Sem-3)

iv. Converse

v. Contrapositive |AKTU 2014-15, Marks 10


OR
Define inverse.

Answer
i. Conjunction: Ifp and q are two statements, then conjunction of p and
q is the compound statement denoted by p a g and read as
"p and q". Its truth table is,

PAq

F F

Example:
p: Ram is healthy.
q: He has blue eyes.
paq: Ram is healthy and he has blue eyes.
i. Disjunction: If p and q are two statements, the disjunction of
p and q is the compound statement denoted by p vq and it is read as "p
or q". Its truth table is,

PV

T T

T T
F T T
F F F

Example:
p: Ram will go to Delhi.
q: Ram will go to Calcutta.

pvq: Ram will go to Delhi or Caleutta.


iii. Conditional: Ifp and q are propositions. The compound proposition if
p then q denoted by p >q orp q and is called conditional proposition
or implication. It is read as "Ifp then q" and its truth table is,
4-6 C (CS/T-Sem-3)
Propositional Logic & Predicate Logic

Example :

p:Ram works hard.


g:He will get good marks.
marks.
P q : If Ram works hard then he will get good
For converse and contrapositive:
Let p: It rains.
q: The crops will grow.
iv. Converse: Ifp>qis an implication then its converse is given by q >p

states that S : If the crops grow, then there has been rain.

q is an implication
then its contrapositive is
v. Contrapositive: Ifp »

given byq-p states that,


there has been rain.
t:If the crops do not grow then
no

Inverse
implication the inverse of p =>q is -p> q.
-

Ifp » q is
Consider the statement

p: It rains.
: The crops will grow
The implication p=»q states that,
r: Ifit rains then the crops will grow.
states that.
The inverse of the implication p q , namely - p - 9
u : Ifit does not rain then
the crops will not grow.

PART-2
Tautology, Satisfiability, Contradiction, Algebra of Proposition,
Theory of Inference.

Questions-Answers

Long Answer Type and Medium Answer Type Questions


Discrete Structures & Theory of Logic 4-7C (CS/IT-Sem-3)

Que 4.6. Explain tautologies, contradictions, satisfiability and


contingency.
Answer
1. Tautology : Tautology is defined as a
compound proposition
always true for all possible truth values of its propositional
that is
variables and
it contains T in last column of its truth table.
Propositions like,
The doctor is either male or female.
ii. Either it is raining or not.
always true and are tautologies.
are

2 Contradiction: Contradiction is defined


that is always false for all proposition as a
compound
possible truth values of its propositional
variables and it contains F in last column of its truth table.
Propositions like,
i. x is even and x is odd number.
i. Tom is good boy and Tom is bad boy.
are always false and are contradiction.
3. Contingency: A proposition which is neither tautology nor
contradiction is called contingency.
Here the last column of truth table contains both T
and F.
4 Satisfiability:
A compound statement
formula
A (P, P2, Pp) is said to be satisfiable,
ifit has the truth value T for at least one combination of
...

truth value of
PPgP
Que 4.7.Write short note on algebra of propositions.
Answ
Proposition satisfies various laws which are useful in simplifying complex
expressions. These laws are listed as
1. Idempotentlaws:
a. pvP=P
b. pp=p

2 Associative laws:
a.
Pvgvr =p (q vr) v

b PAq)ar=pa (qnr)
3 Commutative laws
a.
pv4qVP
b.
prq= q np
Propositional Logic & Predicate Logic
4-8C (CS/IT-Sem-3)

4. Distributivelaws
a. pvqar)=(pvq)a (p vr)
b. pa q vr) =(p ^q)v (p ar)
5. Identity laws:
a. pvP=P
b. pvT=T
C. pAF=F
d paT=p
6. Complement laws:
a pv-P= T
b. pA-p =F
c.-T F
d -F T
7. Involutionlaw:
a--p)=p
8. De Morgan's laws :

a.-(pvq)=-pa -9
b . - ( p nq) = -pv 9

9. Absorption laws:
a. pvpn g) =p
b papvq) =p
These laws can easily be verified using truth table.

Que 4.8. Discuss theory of inference in propositional logic.

Answer
Rules of inference are the laws of logic which are used to reach the given
conclusion without using truth table. Any conelusion which can be derived
using these laws is called valid conclusion and hence the given argument is
valid argument.
1. Modus ponens (Law of detachment) : By this rule if an implication
p-qis true and the premise p is true then we can always conclude that
q is also true.
The argument is of the form

2. Modus tollens (Law of contraposition): By this rule if an implication


p->qis true and conclusionq is false then the premise p must be false.
The argument is of the form:
Discrete Structures & Theory of Logic 4-9C (CS/IT-Sem-3)

pq

P
3 Hypothetical syllogism: By this rule whenever the two implications
p q andq >rare true then the implicationp >r is also true.
The argument is of the form :

4. Disjunetive syllogism: By this rule if the premises p v q and - q are


true then p is true.
The argument is of the form:
Pv9

P
5. Addition: By this rule ifp is true thenp v q is true regardless the truth
value of q.
The argument is of the form

P
.pvg
6 Simplification: By this rule if p nq is true then p is true.
Theargument is of form:

p or . q

7. Conjunction : By this rule if p and q are true then p a q is true.


The argument is of the form:
p

prg
8. Constructive dilemma: By this rule if (p >q) a (r-> s) and p v r are
true thenqvsis true.
The argument is ofform:
(pg)a(r>s)
PVr
qvs
9. Destructive dilemma: By this rule if (p >q) A (r> s) and - q as
are true.
The argument is of the form:
4-10C (Cs/AT-Sem-3) Propositional Logic &Predicate Logic

(p g)ar+8)
9AS
P r
10. Absorption: By this rule ifp >qis true then p > (p aq) is true.
The argument is of the form:
P
p>(pAq)

Que4.9.What do you mean by valid argument? Are the followingE


arguments valid ? If valid, construet a formal proof; if not, explain
why.
For students to do well in diserete structure course, it is necessary
that they study hard. Students who do well in courses do not skip
elasses. Student who study hard do well in courses. Therefore
students who do well in discrete structure course do not skip class.

Answer
Valid arguments :
An argument Pi, P2 . , PEQis said to be valid if Qis true whenever
1
all the premises PP2 .., P, are true.
2 For example:Consider the argument: p 99FP.
P P

P
T T

F F

T
7
where P denotes the premise and C denotes the conclusion.

3. From the truth table we can see in first and third rows boththe premises
q andp q are true, but the conclusion p is false in third row. 'Therefore,
this is not a valid argument.

4. First and third rows are called critical rows.

5 This method to determine whether the conclusion logically follows


from the given premises by constructing the relevant truth table is
called truth table technique.
6. Also, we can say the argumentP, Pay ...,
P,EQis valid if and only if
the proposition Pj a P2 A . A PR is true or we can say if

PnPz. APy >Qis a tautology.


For example : Consider the argument p > q,p E4
Discrete Structures & Theory of Logic 4-11C (CS/IT-Sem-3)

Then from the truth table

P PApqpA p g)
T

T F T
T F
T F T
p p q ) > q i s a tautology since the last column contains T only.
P 9,p q i s a valid argument.
Numerical:
Let the propositional
variables be:
p > Do well in the course.
qThey study hard.
r>Do not
skip classes.
1. For students to do well in discrete structure course, it is necessary that
they study hard:p >
2. Students who do well in the courses do not skip classes p r
Students who study hard do well in courses :q>p
Therefore, students who do well in discrete structure course do not skip
classes: P >r
Therefore, we have,
Given: P9 Pr q p Conclusion : p >r
IV
Proof: Taking III and II together we get
9 PPrgives q>r (Using hypothetical syllogism)
Now taking I and V
P g and g>r we getp->r (Using hypothetical syllogism)
is conclusion, so it is valid.
Hence,p r
Yes, the statement is valid.

Que 4.10.
Show that ((p v q) a - (-pa(-qv - r})) v (-pa-q)v (-pv r) is a
tautology without using truth table.
ii. Rewrite the following arguments using
and predicate symbols:
quantifiers, variables
All birds can fly.
b. Some men are genius.
Some numbers are not rational.
d There is a student who likes mathematics but not
geography.
AKTU 2014-15, Marks 10
OR
Showthat ((p v q) n - (-pa (-qv -r)) v (-p a -q) v (- pvr) is a

tautology without using truth table. AKTU 2018-19, Marks 07


4-12C (CS/IT-Sem-3) Propositional Logic & Predicate Logic

Answer
. We have
(pvg)a -(-pa(-qv-r)) v (-p A - q)v(-p vr)
(pvg) -(-pr -(qar)) v(-(pvq)v-(pvr))
(Using De Morgan's Law)
l(p vg) A(pv (qar)v -(pvq)a (pvr)
=
l(p vg) n (pvq) a (par)) ((pvq)a (p v -
v r))
(Using Distributive Law)
l(p vg) A pvg)) a (p vr)v - (pvq) a (pvr)
(pvg) n (pvr)) v -(pvq)a (pvr)
=xv -*
where x (pvg)
= a (PAr)
= T

ii. a. Vx [B(x) =Mx)] b. 3x Mx) a G)}


c.-I ) (N(a) a R(z)) d r Stx) a Mlx) A - Gx))

Que 4.11. "If the labour market is perfect then the wages of all
persons in a particular employment will be equal. But it is always
the case that wages for such
persons are not equal therefore the
labour market is not perfect". Test the validity of this argument
using truth table.
AKTU 2014415, Marks 10
Answer
Let P The labour market is perfect.
P2 Wages of all persons in a particular employment will be equal.
PWages for such persons are not equal.
-P: The labour market is not perfect.
The premises are p, >P2» - Pz and the conclusion is - P The argument

P P P - P , is valid if (p, >p) n -P,)-P, is a tautology.


Its truth table is,

P PPPPPPPPPPP)P
T T F F T F

T F T F T

T T T

Since (p, P) A -P,)>-P is a


tautology. Hence, thisis valid argument.
Que 4.12.What is a tautology, contradiction and contingency ?
Show that (pvg)v(-pvr)+ (qvr) is a tautologEy, contradiction or
contingency. AKTTU 2018-18, Marka 07
Discrete Structures & Theory of Logic 4-13C (CS/IT-Sem-3)

Answer
Tautology, contradiction and contingency: Refer Q. 4.6, Page 4-7C,
Unit-4.
Proof:((pvq)v(-pvr)-> (qvr)
Pvg =PvnB
AvB) (qvr)C>D
A C = D

F F T T F
T T T
F T F T T
T
T T F F

T T F T T T
T T F T

TTTF T T T
So, ((p vq) v (-pvr))> (q vr) is contingency.

Que 4.13.
i Find a compound proposition involving the propositional
variables p, q, r and s that is true when exactly three
propositional variables are true and is false otherwise.
ii. Show that the hypothesis "It is not sunny this afternoon and it
is colder than yesterday", "We will go swimming only if it is
sunny", "If we do not go swimming, then we will take a canoe
trip." and "If we take a canoe trip, then we will be home by
sunset" lead to the conclusion "We will be home by sunset."
OR
Show that the premises "It is not sunny this afternoon and it is
colder than yesterday," "We will go swimming only if it is sunny,
"If we do not go swimming, then we will take a canoe trip." and
"If we take a canoe trip, then we will be home by sunset" lead to
the conclusion "We will be home by sunset."

AKTU 2018-19,Marks07
Answer
The compound proposition will be : (p nqar) es s
i. letp be the proposition "It is sunny this aftern0on", q be the proposition
"It is colder than yesterday", r be the proposition "We will go swimming",
s be the proposition "We will take a canoe trip", and t be the proposition
"We will be home by sunset".
4-14C (CS/IT-Sem-3) Propositional Logic & Predicate Logic

Then the hypothesis becomes -p nq, r >p, - r s , and s t . The


conclusion is simply t.
We construct an argument to show that our hypothesis lead to the
conclusion as follows

S. No. Step Reason

p Aq Hypothesis

2. P Simplification using step 1

Hypothesis
Modus tollens using steps 2 and 3

r- Hypothesis
6. Modus ponens using steps 4 and 5
Hypothesis
8. Modus ponens using steps 6 and 7

Que 4.14. Show that: (r> -


q, rv S, S > -
q,p > q) +- p are

inconsistent.
AKTU 2017-15,Marks07
Answer
Following the indirect method, we introduce p as an additional premise and show
that this additional premise leads to a contradiction.
11) (1)p >9 Rule P
(2 (2)p Rule P (assumed)
(1, 21 (3) Rule T, (1), (2) and modus ponens
4 (4) s > q Rule P

(1,2,4) (5) s Rule 7, (3), (4) and modus tollens


(6) rvs Rule P
(1,2,4, 6) (7) r Rule T,5), (6) disjunctive syllogism
(81 (8) r> 4 Rule P
81 (9) F v Rule T,(8) and EQ16 (P-q= p v9
18) (10) r aq Rule T, (8) and De Morgan's law
11, 2, 4, 6) (11) rag Rule T, (7), (3) and conjunction
1,2, 4,6, 81 (12)r a qa raq Rule T, (10), (11) and conjunetion.

Since, we know that set of formula is inconsistent if their conjunction implies


contradiction. Hence it leads to a contradiction. So, it is inconsistent.
Discrete Structures & Theory of Logic 4-15C (CS/IT-Sem-3)

PART-3|
Predicate Logic: First Order Predicate, Well Formed Formula of
Predicate, Quantifiers, Inference Theory of Predicate Logic.

Questions-Answers
Long Answer Type and Medium Answer Type Questions

Que 4.15. Write a short note on


1. First order logie
2 Quantifiers

Answer
1. First order logic
First order logic is the extension of propositional logic by generalizing
and quantifying the propositions over given universe of discourse.
ii. In first order logic every individual has the property p (say).
ii. Itis also called first order predicate calculus.
iv. Predicate calculus is generalization of propositional calculus.
Predicate calculus allows us to manipulate statements about all or
something
v. Universe of Discourse (UD) : It is the set of all possible values that
can be substituted in place of predicate variable.
2 Quantifiers: There are following two types of quantifiers:
i Universal quantifier: Let plx) be a propositional function defined
on set A. Consider the expression.
(Vx eA) Plx) or Vx Px) (4.15.1)
Here the symbol "v" is read as "for all" or "for every" and is called
universal quantifier. Then the statement (4.15.1) is read as "For
every x e A, Plx) is true."

ii. Existential quantifier: Let Ar) be a propositional function defined


on set B. Consider the
expression
(e
B) Qx) or l r ) ..4.15.2)
Here the symbol "3" is read as "for some" or "for at least one" or
"there exists" and is called existential quantifier
Then the statement (4.15.2) is read as "For somexe B, Qr) is
true".

Que 4.16. Explain rules of inferenee in predicate logie.


4-16C (CS/IT-Sem-3) Propositional Logic & Predicate Logic

Answer
Rule of inference is a logical form consisting offunction which takes premises,
analyzes their syntax and returns a conclusion.
Rules of inference:
i. Universal specification: By this rule if the premise (Vx) P(x) is true
then Pc) is true where c is particular member of UD.

(Vx)Plx)
Plc)
ii. Universal generalization : By this rule if Pc) is true for all c in UD
then (vx) Plx) is true.

Pc)
.(Vx)P(x)
x is not free in any of given premises.
ii. Existential specification: By this rule if(lx) Px) is true then Plx) is
true for some particular member of UD.
) Px)
. Pc)
c is some member of UD.
iv. Existential generalization : By this rule if Pc) is true for some
particular member c in UD, then (3 x) P (x) is true
Plc)
x)Plx)
member of UD.
C1s some
v. Universal modus ponens: By this rule if Plx) -Qx) is true for everyy
x and Plc) is true for some particular member c in UD then Q(c) is true.
(V x) Plx)>Q(x)
Plc)
Qc)
vi. Universal modus tollens: By this rule if Plx)-> Qlr) is true for every
x and Qc) is true for some particular c in UD then -Qc) is true.
(V x) Plx)>Qlx)
Qlc)
- Plc)

Que 4.17. Write the symbolic form and negate the following
statements:
a. Everyone who is healthy can do all kinds of work.
b. Some people ure not admired by everyone.
c. Everyone should help his neighbours, or his neighbours will

not help him.


AKTU 2016-17, Marks 10
Discrete Structures & Theory of Logic 4-17C (CS/IT-Sem-3)

Answer
Symbolic form:
Let Plx): x is healthy and Qlr: x do all work
v x(Plx) > Q«)
Negation: -(Vx (Plx) -> Qx)
b. Symbolic form
Let Plx) :x is a person

A(x, y):x admires y


The given statement can be written as "There is a person who is not
admired by some person" and it is (r) 3y)IPx) n P(y) n A(x, y))
Negation :9x)3y) P (x) a Py)a Alz, y))
c Symbolic form :
Let Na, y):x and y are neighbours
Hx,):x should helpy
Px, y):x will helpy
The statement can be written as "For every person x and every person
y, ifx and y are neighbours, then either x should helpy or y will not help
rand it is (Vx) (V y)lN(x, y) > (Hx, y)-Py, z))
Negation: (Vx) (Vy) [Na, y)>H «,y) P(y,x)
Que 4.18. Express the following statements using quantifiers and
logical connectives.
a. Mathematies book that is published in India has a blue cover.
b. All animals are mortal. All human being are animal. Therefore,
all human being are mortal.
There exists a mathematics book with a cover that is not blue.
He eats crackers only if he drinks milk.
e. There are mathematics books th: are published outside India.

Not all books have bibliographies. AKTU 2016-16,Marlks 10


Answer
a. Px): x is a mathematic book published in India

Qx):x is a mathematic book of blue cover

Vx Plx) Qx).
b. Plx):x is an animal

Qx):x is mortal
Vx Px) Qlr)
4-18C (CS/AT-Sem-3) Propositional Logic & Predicate Logic

Rx): x is a human being

Vx Rlx) Plx).
Plx):x is a mathematics book

Qlx): x is not a blue color


, Plx) a Qr).
d. Plx):x drinks milk
Qx):r eats crackers
for x, if Px) then Qx).
or x, Pla)Qx).
e. Plx):x is a mathematics book
Qlr):x is published outside India
ar Plx) n Qlr).
f. Plx):x is a book having bibliography - vx, Plx).

Que 4.19.
i. Express this statement using quantifiers : "Every student in
this class has taken some course in every department in the
school of mathematical sciences".
ii. If vr3yP(x, y) is true, does it necessarily follow that VyPlx, y) is
true ? Justify your answer.

Answer
Vxplx)IVz Qy, z)
where Plx) is student of class.
Qy, 2) is the course from department.
ii. Let Px,y) bex + y =3 and x, y belong to some set of integers Yx3yPx. y) is
true means for all x there exists some y for whichx + y = 3 is true but for
all y we conclude that Plx, y) will not be true.

Que 4.20. Translate the following sentences in quantified


expressions of predicate logic.
i. All students need financial aid.
ii. Some cows are not white.
iii. Suresh will get if division if and only if he gets first div.
iv. If water is hot, then Shyam will swim in pool.
v. All integers are either even or odd integer.

AKTU 2017-18, Marks 07


Discrete Structures & Theory of Logic 4-19C (CS/IT-Sem-3)

Answer
Vx |S(x) = Fa)]
- 3(x) (Cx) a Wlx)]

ii. Sentence is incorrect so cannot be translated into quantified expression.


iv. Wx):x is water
Hx): x
is hot
Slx):x is Shyam
Plx): x will swim in pool
vx I(Wx) n Hlx)) =» (S(x) n
Plx))
Elx):x is even
Ox):x is odd
Vr (E(x) v OCx))

VERY IMPORTANT QUESTIONS


Following questions are very important. These questions
may be asked in your SESSIONALS as well as
UNIVERSITY EXAMINATION.

Q1. Explain the following terms with suitable example:


i. Conjunction
ii. Disjunction
iii. Conditional
iv. Converse
v. Contrapositive
Ans. Refer Q. 4.5.

Q2. ShOw that ((pvq)a - (-pa (-qv -r)) v (-pA -q)v (-pvr) is
a tautology without using truth table.
Ans. Refer Q. 4.10.

Q.3. "If the labour market is perfect then the wages of all persons
in a particular employment will be equal. But it is always
the case that wages for such persons are not equal therefore
the labour market is not perfeet". Test the validity of this
argument using truth table.
Ans. Refer Q. 4.11
Q.4. What is a tautology, contradiction and contingency ? Show
that (p vq)v(pvr)>qv r) is a tautology, contradiction
or contingency.
5 Trees, Graph and
UNIT
Combinatorics

CONTENTS
Part-1 T r e e s : Definition, ..
************************************** 5-2C to 5-4C
Binary Tree

Part-2 Binary Tree Traversal 5-5C to 5-8C

Part-3 Binary Search Tree . *******--*.*..5-8C to 5-12C

Part-4 G r a p h s : Definition.. ..5-12C to 5-15C


and Terminology
Representation of Graph
Part-5 Multigraph Bipartite.. ******************* 5-15C to 5-24C
Graphs, Planar Graph
Isomorphism and
Homomorphism of Graphs

Part-6 Graph Coloring. ******* 5-24C to 5-24C

Part-7 Recurrence Relation and . **** 5-24C to 5-36C


Generating Function
Recursive Definition of
Function, Recursive
Algorithms, Method of Solving
Recurrences, Combinatorics
Introduction, Counting Techniques,
Pigeonhole Principle

5-1 C(CS/IT-Sem-3)
5-2 C(CS/IT-Sem-3) Trees, Graph and Combinatorics

PART 1
Trees: Definition, Binary Tree.

Questions-Answers
Long Answer Type and Medium Answer Type Questions

Que 5.1. Explain the


following terms:
Tree
i. Forest
ii. Binary tree
iv. Complete binary tree
v. Full binary tree

Answer
Tree:
1. Atree is a connected graph that contains no cycle or circuit. It is a
simple graph having no self loop or parallel edges.
2. A tree contains a finite set of elements which are called vertices or
nodes. The vertex can have minimum degree 1 and maximum
degree n.
3. The number of vertices in a tree is called order of tree.
4 Atree with only one vertex is called trivial or degenerate or empty
tree.

Fig. 5.1.1
ii. Forest: A forest is a collection of disjoint tree. It is an undirected,
disconnected, acyclic graph.

Fig. 5.1.2.
iii. Binary tree: Binary tree is the tree in which the degree of every
node is less than or equal to 2. A tree consisting of no nodes is also a
binary tree.
Discrete Structures & Theory
of Logic 6-3C (CS/T-Sem-3)
iv. Complete binary tree: A binary tree is said to complete binary
tree if all its levels, except the last, have maximum number of possible
nodes (i.e., 2), and if all the nodes at the last level appear as far left as
possible.

O0
Fig. 5.1.3.
It is represented as T, where n is number of nodes.
v. Full binary tree: A binary tree is said to be extended or full binary tree
if each node has either 0 or 2 children.

Sa

-
Fig. 5.14

Que 5.2.Consider the tree given below:

Fig. 5.2.1.

Which node is root ?

ii. Which nodes are leaves ?


iis. Name parent node of each ?
iv. List children of each node.
5-4C (CS/T-Sem-3) Trees, Graph and Combinatorics
Trees,
v. List the siblings.
vi. Find depth of each node.
vii. Find level of each node.

Answer
The nodea is the root node.

i. The node g, h, i,j and I are leaves.

Nodes Parent node


b, c

e, f d

g,h

Nodes Children
a b, c
D d
i,k
e,f
g, h

. b and c

e andf
and h
j and k

Nodes Depth

b, c
d,j, k 3
e, f,I
g, h, i 5

Vu. Nodes Level

a 0
b, c
d,j, k 2

e,f,
8, h, i
Discrete Structures & Theory of Logic
5-5 C(CS/IT-Sem-3)

PART2
Binary Tree Traversal.

Questions-Answers
Long Answer Type and Medium Answer Type Questions

Que 5.3. Define preorder, inorder, and postorder tree traversal.


Give an example of preorder, postorder, and inorder traversal of a
binary tree of your choice with at least 12 vertices.
OR
Explain in detail about the binary tree traversal with an example.

AKTU 2016-17,Marks 10
Answer
Tree traversal: A traversal of tree is a process in which each vertex is
visited exactly once in a certain manner. For a binary tree we have three
types of traversal
1. Preorder traversal : Each vertex is visited in the following order :
a Visit the root (N).
b. Visit the left child (or subtree) of root (L).
Visit the right child (or subtree) of root (R).
2 Postorder traversal:
a Visit the left child (subtree) of root.
. Visit the right child (subtree) of root.
C. Visit the root.
3. Inorder traversal:
Visit the left child (subtree) of root.
. Visit the root.
Visit the right child (subtree) of root
A binary tree with 12 vertices:

Fig.5.3.1.
5-6C (CS/IT-Sem-3) Trees, Graph and Combinatorics

Preorder (NLR) :ABDHIEJCFKLG


Inorder (LNR) : HDIBJEA KFLCG
Postorder (LRN): HIDJEBKL FGCA
Que 54. Construct a tree whose inorder and preorder traversal
are as follows:
Inorder B A G C P E
Preorder : G B AP C D

Answer
Root is G.

Fig5.4.1
Element to left of G in inorder traversal are QBA and B comes first in
preorder traversal. Therefore tree will be

A
Pig.542
Now elements on the right of G in inorder traversal are CPEDR and P comes
first. Therefore tree will be

(G)
P

Fig. 543.
Now element to left of P in inorder traversal is C and to the right is EDR
(right subtree) out of DER, D comes first and E and R on its left and right
respectively.
Discrete Structures &Theory of Logic 5-7C (CS/IT-Sem-3)
Therefore, the complete binary will look like

D)

Fi644
Que 5.5.Define a binary tree. A binary tree has 11 nodes. It's
inorder and preorder traversals node sequences are:
Preorder :ABDHIEJLCFG
Inorder: HDIB JE KAFCGG
Draw the tree.
AKTU 2018-19, Marlks 07
Answer
Binary tree : Refer Q. 5.1(ii), Page 5-2C, Unit-5.
Numerical:
Step 1: n preorder sequence, leftmost element is the root of the tree. By
searchingA in 'Inorder Sequence' we can find out all the elements on the left
and right sides of 'A'.

(HDIBJEK (PCC)
Step 2: We recursively follow the above steps and we get

Que 5.8. Given the inorder and postorder traversal of a tree T:


Inorder: HFEABIGDC Postorder: BEHFACDGI
Determine the tree T and it's Preorder.
AKTU2017-18,Marks 07
5-8C (CS/IT-Sem-3) Trees, Graph and Combinatorics

Answer
The root of tree is I.

Now elements on right ofI are D, G, C and G comes last of all in postorder
traversal.

Now D and C are on right of G and D comes last of G and I postorder


traversal so

Now element left ofI are H FEA B in inorder traversal and A comes last of
all in postorder traversal. Therefore tree will be

Now H F E are on left of A in inorder traversal and B comes last of all and
continuing in same manner. We will get final binary tree as

Preorder traversal of above binary tree is CAFHEBDGI

PART-3
Binary Search Tree.

Questions-Answers
Long Answer Type and Medium Answer Type Questions

Que 5.7,What is a binary search tree ? Form a binary search


tree for the words vireo, warbler, egret, grosbeak, nuthatch, and
kingfisher. Explain each step.
Discrete Structures & Theory of Logic 5-9C (CSTT-Sem-3)

Answer
Binary search tree:
1 A binary search tree is a binary tree Tin which data is associated with
the vertices
2. The data are arranged so that, for each vertex u in T, each data item in
the left subtree of v is less than the data item in v and each data itenm
in the right subtree of v is greater than the data item in v.
3. The binary tree T in Fig. 5.7.1, is a binary search tree since every
vertex in Texceeds every number in its left subtree and is less than
every number in its right subtree.

50)
40
(19)
(75
(30 45
12)
Fig. 5.7.1. A binary seareh tree.
Numerical:
To start, create a vertex and place the first item in the list in this vertex
and assign this as the key of the root.

yvireo
2. To add warbler, compare it with vireo. Warbler is greater than vireo,
therefore it will be in the right of vireo. i.e.,

vireo
Cwarbler
3 Similarly bydoing the above steps for rest of words we get the final
binary search tree that is given below :

vireo)

egret) (warblerD

grosbeak

Cnuthatch
kingfisher)
5-10C(Cs/IT-Sem-3) Trees, Graph and Combinatorics

Que 5.8. Write algorithm for following:


Searching and inserting a node in BST
Deletinga node in BST

Answer
i. Searching and inserting a node in BST:
Consider a binary search tree T and we have to insert or search an ITEM in
the tree.
Step I: Compare 1TEM with the root ofthe tree
a. If 1TEM < root, proceed to the left child of N.
b. IfITEM> root, proceed to the right child ofN.
Step I1: Repeat Step I and if
a. We reach a node N such that ITEM = N then search is successful.

b. We reach an empty subtree, which shows the search is successful.


Insert ITEM in place of empty subtree.
ii. Deleting a node in BST:
Consider a binary search tree T and we have to delete an !TEM from the
tree.
StepI:Find the location of node which contain 1TEM and also keep track of
its parent too.

Step II: Find the number of children of the node.


a. If node has no children then simply delete the node.
b. If the node has exactly one child then the node is deleted from tree by
replacing the node from its child.
If the node has two children then
i Fi..'its inorder successor.
Delete the successor from tree using (a) or (b).
i. Replace node by its successor in tree.

Que 5.9. Draw a binary search tree by inserting following


integers 55, 20, 63, 10, 28, 60, 93, 5, 11, 40,68, 25.
Answer 1
1. Insert 55:

2. Insert 20:

65
(20
Discrete Structures & Theory of Logic 5-11C (CS/TT-Sem-3)

3 Insert 63:

Insert 10
63
55)

1
5 Insert 28:
55

6 Insert 60:

20 (63)
(10 28(60
7. Insert93:

55
20) 63

10 (93)
W
8 Insert 5:

55
(20 63)
(10) (93
5-12C (Cs/AT-Sem-3) Trees, Graph and Combinatorics

9. Insert 11

56)
63)

(10 93
(5)
10. Insert 40:

63

28 (60

40
11. Insert 68:

20

10 60

12. Insert 25:

S55)

(10) 2

PART-4
Graphs: Definition and Terminology, Representation of Graph.
Discrete Structures & Theory of Logic 5-13C (CS/IT-Sem-3)

Questions-Answers
Long Answer Type and Medium Answer Type Questions

Que 5.10.| What do you mean by graph ? Also, explain directed and
undirected graph.

Answer
A graph is a non-linear data structure consisting of nodes and edges. A graph
consists of two sets as follows:
1 Set V of nodes or point or vertices of graph G
2 Set E of ordered or unordered pairs of distinct edges of G.
We denote such a graph by G(V, E) and set of vertices as VG) and set of
edges as EG).
For example:
Va

V
Fig. 5.10.l.
Order: IfG is finite then number of vertices in G denoted by | V (G)| is
called order of G.
Size: The number of edges denoted by |E(G)| in a finite graph G is called
size of G.

Directed graph: A graph G(V, E) is said to be directed graph or digraph if


each edgee eE is associated with an ordered pair of vertices as shown
below

Fig. 5.10.2.
Undirected graph: A graph G(V, E) is said to be undirected if each edge
ec Eis associated with an unordered pair of verticesas shown below:

Fig. 5.10.3.
5-14C (CS/IT-Sem-3) Trees, Graph and Combinatorics

Que 5.11. Discuss representation of graph.

Answer

Graph can be represented in following two ways


1. Matrix representation:
Matrices are commonly used to represent graphs for computer
matrix lies in the
processing. Advantages of representing the graph in
fact that many results of matrix algebra can be readily applied to study
the structural properties of graph from an algebraic point of view.

a. Adjacency matrix:
i Representation of undirected graph :

The adjacency matrix of a graph G with n vertices and no

parallel edges is matrix A =la, whose elements are


an xn

given by
between ith vertices
a,
=
1, if there is an edge and h
= 0, if there is no edge between them
ii. Representation of directed graph:
The adjacency matrix of a digraph D, with n vertices is the
matrix
A = la,). in which

a, l
if are (u, v,) is in D
= 0 otherwise

For example:

3
Fig. 5.11.1

,0 1 1 1
A =10 1 o
11 0 1
v,l1 0 1
b. Incidence matrix:
i. Representation of undirected graph
Consider an undirected graph G = (V, E) which has n vertices
and m edges all labelled. The incidence matrix /G) = lb,I. is
then n x m matrix, where

b, =1 when edge e, is ineident with


= 0 otherwise
Discrete Structures & Theory of Logic 5-15C (CS/IT-Sem-3)

ii. Representation of directed graph:


The incidenece matrix ID) = lb,) of digraph D with n vertices
and m edges is the n x m matrix in which.

b= 1 if arej is directed away froma vertex v,


=
- 1 ifarcj is directed towards vertex u,
0 otherwise.
Find the incidence matrix to represent the graph shown in
Fig. 5.11.2.

PA

4 Pa 3
Fig.5.11.2.
The incidence matrix of the digraph ofFig. 5.11.2 is
0 -1
I0 0
ID) =|
0 -1 10
0 0 1

2. Linked representation : In this representation, a list of vertices


adjacent to each vertex is maintained. This representation is also called
adjacency structure representation. In case of a directed graph, a care
has to be taken. according to the direetion of an edge, while placing a
vertex in the adjacent structure representation of another vertex.

PART-5
Multigraph, Bipartite Graphs, Planar Graph,
Isomorphism and Homomorphism of Graphs.

Questions-Answers
Long Answer Type and Medium Answer Type Questions

Que 5.12.Write short notes on:


a.
Simple and multigraph
b. Complete graph and regular graph
5-16C (Cs/IT-Sem-3) Trees, Graph and Combinatorics

Bipartite graph
d. Planar graph

Answer
a. Simple and multigraph :
i. Simple graph: A graph in which there is only one edge between
a pair of vertices is called a simple graph.

Fig. 5.12.1.
ii. Multigraph: Any graph which contains some parallel edges is
called a multigraph.

V3
e2

JV2
Fig. 5.12.2
b. Complete graph and regular graph:
i Complete graph:A simple graph, in which there is exactly one
edge between each pair of distinct vertices is called a complete
graph. The complete graph ofn vertices is denoted by K,. The
graphs K to Kz are shown below in Fig. 5.12.3.

K2
AX
Fig. 5.12.3.
K5

K, has exactly nn-1=nC,edges


2
i. Regular graph (n-regular graph): If every vertex of a simple
graph has equal edges then it is called regular graph.
If the degree of each vertex is n then the graph is called n-regular
graph.

A (a) (a)

Fig. 5.12.4.
(c)
Discrete Structures & Theory of LOgic
5-17C (CS/IT-Sem-3)

The graphs shown in Fig. 5.12.4 are 2-regular graphs.


The graph shown in Fig. 5.12.5 is 3-regular graph.

Fig. 5.12.5.

c. Bipartite graph: set


A (V, E) is bipartite if the vertex
graph G
Bipartite graph:
=
i.
Vcan be partitioned into two subsets (disjoint) V,
and V2 such that
(so that
every edge in E connects a vertex in V and a vertex
V no

edge in G connects either two vertices in V, or two vertices in V2).


(V1.V2) is called a bipartition of G.

which
redrawn
as

2 Y3 Y2
Fig. 5.12.6. Some bipartitegraphs
ii. Complete bipartite graph: The complete bipartite graph on m
and n vertices, denoted K, n is the graph, whose vertex set is
into sets with vertices and V2 with n vertices in
partitioned V, m

which there is an edge between each pair of vertices Vj and v»


where vis in V, and v2 is in V2. The complete bipartite graphs

Ka3 K24. K3,3. K3,5. and Ka6

Fig-5.12.7. Some complete bipartite graphs


d. Planar graph:
A graph G is said to be planar if there exists some geometric
representation of G which can be drawn on a plane such that no two of
its edges intersect except only at the common vertex.
A graph is said a planar graph, if it cannot be drawn on a plane
without a crossover between its edges crossing.
. The graphs shown in Fig. 5.12.8(a) and tb) are planar graphs.
5-18C (CS/AT-Sem-3) Trees, Graph and Combinatorics

(a) (b)
Fig. 5.12.8. Some planar graph.
Que 5.13. Define the following with one example:
i. Bipartite graph
ii. Complete graph
iii. How many edges in K, and K,
iv. Planar graph AKTU 2017-18, Marks 10
Answer
i. Refer Q. 5.12c), Page 5-15C, Unit-5.
ii. Refer Q 5.12(b), Page 5-15C, Unit-5.
ii. Number of edge in Kq : Since, K, is complete graph with n vertices.
Number of edge in K, = -)_1x6 21
2 2
Number of edge in K3, 6*
Since, Kn, m is a complete bipartite graph with ne Vj and me V2

Numberof edge in K3,6=3x6= 18


iv. Refer Q.5.15d), Page 5-18A, Unit-5.

ue 5.14. Explain isomorphism and homomorphism of graph.

Answer
Isomorphism of graph: Two graphs are isomorphic to each other if:
Both have same number of vertices and edges.
i. Degree sequence of both graphs are same (degree sequence is the
sequence of degrees ofthe vertices of a graph arranged in non-increasing
order).
Example:

Fig. 5.14.1
Homomorphism of graph:Two graphs are said to be homomorphic if one
graph can be obtained from the other by the creation of edges in series ti.e.,
by insertion of vertices of degree two) or by the merger of edges in series
Discrete Structures & Theory of Logic 5-19C (CS/IT-Sem-3)

(a) 6) C)

Fig. 5.14.2.
Que 5.15. Prove that K, and K, are planar graphs. Prove that K, is

non-planar.
Answer
The complete Kg graph has 3 edges and 3 vertices
For a graph to be
planar 3v-e 26
3v-e 3 3-3 9-3 62
= x
6 =

K is planar graph
Similarly complete K, graph has 4 vertices and 6 edges.
3-e = 3 x 4-6= 12-6 =626
K is planar graph
The complete K, graph contains 5 vertices and 10 edges.
Now 3v-e 3 = x 15- 5-10 = 10 =526
Hence K5 is non planar since for a graph to be planar 3u-e 2 6.

Que 5.16. What are Euler and Hamiltonian graph ?


OR
Explain the following terms with example:
i. Homomorphism and
Isomorphism graph
ii. Euler graph and Hamiltonian graph
iii. Planar and Complete bipartite graph

AKTU 2014-15, Marks 10


Answer
Refer Q.5.14, Page 5-18C, Unit-5.
ii. Eulerian path :A path of graph G which includes each edge of G
exactly once is called Eulerian path.
Eulerian circuit :A circuit of graph G which include each edge of G exactly
once.

Eulerain graph:A graph containing an Eulerian circuit is called Eulerian


graph.
For example: Graphs given below are Eulerian graphs.
3 B

VV
Fig. 5.16.1.
5-20 C (CS/IT-Sem-3) Trees, Graph and Combinatorics

Hamiltonian graph: A Hamiltonian circuit in a graph G is a closed path


that visit every vertex in G exactly once except the end vertices. A graph Gis
called Hamiltonian graph ifit contains a Hamiltonian circuit.
For example: Considergraphs given below:
Dr C D

E
B B
(a) b)
Fig. 5.16.2.
Graph given is Fig. 5.16.2(a) is a Hamiltonian graph since it contains a
Hamiltonian circuit A -B-C-D-A while graph in Fig 5.15.2(6) is not a
Hamiltonian graph.
Hamiltonian path: The path obtained by removing any one edge from a
Hamiltonian circuit is called Hamiltonian path. Hamiltonian path is subgraph
of Hamiltonian circuit. But converse is not true.
The length of Hamiltonian path in a connected graph of n vertices is
n-1 ifit exists.
ii. Refer Q. 5.12, Page 5-15C, Unit-5.

Que5.17.
a. Prove that a connected graph G is Euler graph if and only if
every vertex of G is of even degree.
b. Which of the following ple graph have a Hamiltonian circuit
or, if not a Hamiltonian path ?
AKVTU 2016-17,Marks 1
o-

of

d
G1 G2 G3
Fig. 6.17.1.

Answer
a.

1. First of all we shall prove that if a non-empty connected graph is


Eulerian then it has no vertices of odd degree.
2 Let Gbe Eulerian.
3 Then G has an Eulerian trail which begins and ends at u.
Discrete Structures & Theory of Logic 5-21 C (CS/IT-Sem-3)

If we travel along the trail then each time we visita vertex. We use
two edges, one in and one out.
5. This is also true for the start vertex because we also end there.
6 Since an Eulerian trail uses every edge once, the degree of each
vertex must be a multiple of two and hence there are no vertices of
odd degree.
7 Now we shall prove that if a non-empty connected graph has no
vertices of odd degree then it is Eulerian.
8. Let every vertex of G have even degree.
9. We will now use a proof by mathematical induction on |E(G)|, the
number of edges of G.
Basis of induction:
Let |EG)| =0, then G is the graph K, and G is Eulerian.
Inductive step:
1 Let Pn) be the statement that all connected graphs on n edges of
even degree are Eulerian.
2 Assume P(n) is true for all n < |E(G)|.
3. Since each vertex has degree at least two, G contains a cycle C.
4 Delete the edges of the cycle C from G.
5. The resulting graph, G' say, may not be connected.
6. However, each of its components will be connected, and will have
fewer than |EG)| edges.
7. Also, all vertices of each component will be of even degree, because
the removal of the cycle either leaves the degree of a vertex
unchanged, or reduces it by two.
8. By the induction assumption, each component of G' is therefore
Eulerian.
9. To show that G has an Eulerian trail, we start the trail at a vertex,
u say, of the cycle C and traverse the cycle until we meet a vertex,
c say, of one of the components of G".
10. We then traverse that component's Eulerian trail, finally returning
to the cycle C at the same vertex,
cC
11. We then continue along the cycle C, traversing each component of
G'as it meets the cycle.
12. Eventually, this process traverses all the edges ofG and arrives
back at u, thus producing an Eulerian trail for G.
13. Thus, Gis Eulerian by the principle of mathematical induction.
b. G1:The graph Gl shown in Fig. 5.17.1 contains Hamiltonian circuit, i.e.,
a -b-c-d-e-a and also a Hamiltonian path,i.e., abede.
G2: The graph G2 shown in Fig. 5.17.1 does not contain Hamiltonian
circuit since every cycle containing every vertex must contain the edge
e twice. But the graph does have a Hamiltonian path a - b - c - d .
5-22C (CSIT-Sem-3) Trees, Graph and Combinatorics

G3: The graph G3 shown in Fig. 5.17.1 neither have Hamiltonian circuit
nor have Hamiltonian path because any traversal does not cover all the

vertiLices.

that simple graph with vertices and k


Que 5.18.| Prove a n

components can have at most (n-k)(n-R*


2
edges.
AKTU 2016-17, Marks 10
Answer
Let the number of vertices in each of the k-components of a graph G be n,
na then we get
n+n2t.. +n = n where n, 21(i=1, 2,.., k)

Now, Zon,-1- 2-1=n-k


= n2 +k2-2nk

or 2n,-1+222(n, -1Xn, - 1) =n* +*-2nk


i1 1

2/non-negative terms) n2 k*-2nk


orn,-1 +
= +

i1

I:n,-120,n,-120]
n, -1 s n?+-2nk

i-1 i-1 i =1

n +k-2n n2+k2-2nk
i

n-n S n2 +k-2nk-k +n
= nln - k +1)- k (n -k+ 1)
= (n - k \ n - k+ 1)) ..5.18.1)
We know that the maximum number of edges in the i" component of

G= "C, = " , - 1 )
2
Therefore, the maximum number of edges in G is:
Discrete Structures & Theory of Logic 5-23 C (CS/IT-Sem-3)

s n-kMn -k +1) by using eq. (5. 18.1)

Que 5.19.What are different ways to represent a graph ? Define


Euler circuit and Euler graph. Give necessary and sufficient

conditions for Euler circuits and paths.


AKTU 2018-19, Marks 07
Answer

Representation of graph: ReferQ.5.11, Page 5-14C, Unit-5.


Eulercircuit and Euler graph: Refer Q.5.16, Page 5-19C, Unit-5.
Necessary and sufficient condition for Euler circuits and paths :
1 Agraph has an Euler circuit if and only if the degree of every vertex is
even.
2. A graph has an Euler path if and only if there are at most two vertices
with odd degree.

Que 5.20.Define and explain any two the following:

2
BFS and DFS in trees
Euler graph
3. Adjacency matrix of a graph AKTU 2017-18, Marks 07
Answer
1.Breadth First Search (BFS) : Breadth First Search (BFS) is an
algorithm for traversing or searching tree or graph data structures. It
starts at the tree root and explores the neighbour nodes first, before
moving to the next level neighbours.
Algorithmic steps :
Step 1: Push the root node in the queue.
Step 2: Loop until the queue is empty.
Step 3: Remove the node from the queue.
Step 4: If the removed node has unvisited child nodes, mark them as
visited and insert the unvisited children in the queue.
Depth First Search (DFS):
Depth First Search (DFS) is an algorithm for traversing or searching
tree or graph data structures. One starts at the root (selecting some
arbitrary node as the root in the case of a graph) and explores as far as
possible along each branch before backtracking.
Algorithmic steps:
Step 1: Push the root node in the stack.
Step2:Loop until stack is empty
Step3:Pick the node of the stack.
Step 4: If the node has unvisited child nodes, get the unvisited child
node, mark it as traversed and push it on stack.
-24 C (Cs/AT-Sem-3) Trees, Graph and Combinatorics

Step 5:If the node does not have any unvisited child nodes, pop the
node from the stack.
2 Refer Q.5.16, Page 5-19C, Unit-5.
3. Refer Q. 5.11, Page 5-14C, Unit-5.

PART6

Graph Coloring.

Questions-Answers
Long Answer Type and Medium Answer Type Questions

Que 5.21. Write a short note on graph coloring

Answer
1. Suppose that G (V, E) is a graph with no muitiple edges, a vertex colouring
of Gis an assignment ofcolours.
2 A graph G is m-colourable if there exists a colouring of G which uses m
colours.

3. Colouring the vertices such a way such that no two adjacent vertices
have same colour is called proper colouring otherwise it is called
improper colouring.

PART 7
Recurrence Relation and Generating Function: Recursive
Definition of Function, Recursive Algorithms, Method of
Solving Recurrences, Combinatorics: Introduction,
Counting Techniques, Pigeonhole Principle.

Questions-Answers
Long Answer Type and Medium Answer Type Questions

Que 5.22.Write a short note on recurrence relation.

Answer
For a sequence of numbers or numeric function (ag, a, G.. a, an
equation relating a,, for any r, to one or more of the as, i <r is called
Discrete Structures & Theory of Logic 5-25 C (C/IT-Sem-3)

recurrence relation. Recurrence relat ions are also called difference equations
because they can be written in terms of the difference between the
consecutive terms of a sequence.
a, = 4a, r2l
Forexample: r22
a, , 1 2 , - 2
are recurrence relations.
Order of recurrence relation: The difference between the highest and
lowest subscripts ofa, or fr) or y, is called the order of recurrence relation.

For
1.
example:
The equation 13a, + 12a,1 = 0 is of order 1 (i.e., r - ( r - 1) = 1).

2. The equation 8 lx)+ 2 flx + 1) + flx + 2) klx) is of order 2


(i.e., a +2) - x = 2).

Degree of recurrence relation: The highest power of a, or fx) or y, is


called degree of recurrence relation.

For example:
The equation y'.2 +2y.1-Y, = 0 has the degree 3 as the highest
1
power of y, is 3.
the
equation as, 2a3,+3a2,-2+ 4a,- 0 has the degree 4,
= as
The
2 +

highest power of a, is4.


? Solve the
Que5.23. What do you mean generating function
recurrence relation:
2a1-"-n2 2 given a, =
3, a, =-2
using generating function.

Answer
Generating function: The generating function for the sequence a ,

a. of real numbers is infinite series given by


+a* + =2a,x
= ag +4,x +ax+
. . .

Gx) . . .

indeterminate and it is not variable, which


x is considered just a symbol called
numbers belonging to same domain.
is replaced by
The given recurrence relation is,
(5.23.1)
2a,--,2 22
a n

and take summation from n = 2 to o , we get


Multiply by x"
.5.23.2)
-2 -2

GGx) = 24,r=4, t 4,X +a,X +a,x+.. .(5.23.3)


We know,
n

From eq. (5.23.2), we have

(a+ a, r't...) 2 (art a, r'+...)- (a, x +a,r"+ ...)


=

(ax+ a,r..)= 2x (a,r+ a, rt..)- (a, +a, a


+
5-26C (CS/AT-Sem-3) Trees, Graph and Combinatorics

Using eq. (5.23.3), we get


Glx)--a,x = 2r (Gx)-a,)-x* Gr)
Gx)-3+ 2x 2x (Gx) - 3) - r Gx)

Gx1-2x + r = 3-&
3-8x 3-8x 3-8x 8x
Gx) x-2x+1 (x-1 (1-x¥(1-x* 1-z
a,= 3n + 1)-8n = 3- 5n

Que 5.24. Solve the recurrence relation y,.2-5, ^it 6, = 5"


subject to the condition y, = 0, y, = 2.
AKTU 2016-17, Marks 10
Answer

Let Gt) = 2 , " be generating function of sequence la,.


n-0

Multiplying given equation by t" and summing from


n = 0 to o, we have

-5..6a,
n-0
"-5 n=0

Gt)- G_5)=%|+ 6G()= ;


Put a 0 and a, = 2

t
G)-2t5tG() +61 G) =

1-5t

G)-5t G) +6t G) =

2
G) (1-5t +6t) = + 2t
1-5

(62-5t +1) G) = +2t


1-5t

2
G) = 1)
(1-5tM3t -

12t -

(3t 1(2 -

1)

2
1-5X1-3tM1 -2t) (1-3tX1-2)
Let
A B C

(1-5t1-3tM1 2) (1-5t) (1 3) 1-2t)


Discrete Structures & Theory of Logic 5-27C (CS/IT-Sem-3)

A -1-5tX1-3tX1-2t)-1/5

(1-3tX1-Zt)|,=1/5
1/25
(1-3/5X1-2/5)

B
(1-3t1-5tX1-3tM1-2t)|, - 1/3

1/9
d-5/1-2).-1
2
2
C
(1-Zt1-50X1-3tX1-2) -1/2
1/4

(1-5tX1-3t),-1/2 (2-5) (2-3)


2

3
Again,
2t D E
(1-3tX1-2t) (1-3t) (1-2t)
2t
D 1-3t 1-3tN1-20)-1/3
2t 2/3 2
(3-2)
(1-2-1/3 3
2t
E =
(1-Z13tX1-2t), =1/2
2 2/2- -2
1-30 -1/2 2-3
2
1/6 1/2 1/3 2
G) =
(1-50) (1-3) (1-20) (1-3t) (1-2)
Trees, Graph and Combinatorics
5-28 C (CS/AT-Sem-3)

1/6 3/2 5/3


1-5t (1-3) 1-2

o,-50 n=0
ar-2r n-0
n-0 n-

, (5 3 -(2
the relation by the method of
Que 5.25.|Solve recurrence

generating function:
3.
a,-7a+10a,, =0, r 2 2.
Given a, =3 and a, =

AKTU 2014-15, Marks 10


OR
Solve the recurrence relation using generating function:
a-7a-1+ 10a,- =0 with a,
=3, a, =3.
AKTU 2015-16, Marks 10
Answer
0, 22
a,-7a, +
10 a, = r

Multiply by x and take sum from 2 to .

o,-72 +10 a , - 0
2

ax +ag +a r
+-7 (a,*+a, r* +.

+10 (a, X +a, x° +....) = 0

We know th

Gx)= 2a, x = a +a Xt
r0

Gx)-4-a, x -
7x (Gx)-a,) + 10r Ga) =0
Gx)11-7 x + 10 :-] = a, + a, x- 7a,*
= 3+ 3r -21x = 3- 18x
3-18x 3- 18x
Gx)=
10x-7x +1 10x-5x 2x+1
3-118x 3-118x
5x (2x-1) -1(2x -1) 5x - 102 x - 1)

Now,
3 18x A B
(5x-1) (2x 1) 5x-1 2x-1
Discrete Structures & Theory of Logic 5-29 C (CSs/IT-Sem-3)

3- 18x =A (2x- 1)+ B (5 x - 1)

put
2

3-9 B -6= B -B = -4

put 5

A =1»A =1|
4 1
Gx)

a
=5x-1 2x-11-21-5
= 4.2-5

Que 5.26. Solve the recurrenee relation a , 5 + 6 a , = (r+ 1)

AKTU 2014-15, Marks 10


Answer
2-5a1 +6a, =(r+ 1% =+2r +1 .5.26.1)
Now the characteristicequation is
- 5 x +6= 0
r -3) (x -2) = 0 >x =3,2
The homogeneous solution is:

a= C2 +C23
Let the particular solution be :

a, =AtA,r +A
From eq. (5.26.1)
A+A,r+2) + A, r +2- 5 14, +A, (r+ 1M +A, (r+ 1
+iA+iA,r + 64, r

= P+2r +1
A,+2A, + 4A, -5A,-5A, -5A, + 6A)+r(A, + 44 - 54 - 104, + 64,

+(A-54, 64,) + = + 2r +1
Comparing both sides, we get,

2A-3,-A,=1 .(5.26.2)
..5.26.3)
2A,-6,=2
2A, = 1 A = 1/2

From eq. (5.26.3), 2A, -3 =2


A2
Combinatorics
5-30 C (CS/AT-Sem-3) Trees, Graph and

From eq. (5.26.2)

2A215 2 1
9
2A-8 1 > A

a D=9

The final solution is, a,


=
a+a,P =C, 2 +C, 3 +r+ 2

8, and a, 1.
r.4', given a,
=

a - 6a,, 8a,
=

Que 5.27. Solve + =

AKTU 2017-18, Marks 07

Answer
a,-6a,-1+8,-2= r4" 0
The characteristic equation is, x- 6x + 8 =
0, x- 2x- 4x +8 =

(x-2) (x -4) = 0, x = 2, 4
recurrence relaion is,
The solution of the associated non-homogeneous
ah= B,2y + B,(4Y .(5.27.1)D
Let particular solution of given equation is, a,P' = r(Ag +A4r)4'
Substituting in the given equation, we get

A +A,r)4' 6(r 1 (Ag A,(r 1))4-


+ -

-
-

+8(r 2) Ag +A,(r- 2)4-2 r4


=

rA+A-tA-24pr +A)+ lA,-A, -34, +34,}1


+ 44,)+(As-84, -64,+ 124,r) r
=

+IA-4rA
4

rA *A-A+34-A-A A
A-AA-24+24
A-4A -34,-64r=r
24-A- A A A Ar=r
Comparing both sides, we get

...5.27.2)
24 A-1
...(5.27.3)
Ag+ 5A 0 =

10
Solving equation (5.27.2) and (5.27.3), we get A = A
17
To find the value of B, and B, put r = 0 and r = 1 in equation (5.27.1)
Discrete Structures & Theory of Logic 5-31 C (CS/IT-Sem-3)

r=0 4=B, + B, B, +Ba = 8 (5.27.4)


r= 1 a = 2B, + 4B, 2B, + 4B, = 1
(5.27.5)
Solving equations (5.27.4) and (5.27.5), we get B, = 31
- 15
B, =
Complete solution is, a, =
ah) + a,P
a,

Que 5.28. Solve the recurrence


relation:a, + 4a,_, + 4a,.-1 r =

AKTU 2017-18, Marks 07


Answer 1
a,+ 4a,-1t 4a,-2 =r
The characteristic equation i1s,
x+4x+4 0
(x+2) = 0
* = -2,-2

The homogeneous solution is, ah = A +A,r)-2


The particular solution be, a'P = (Ag +Ar) r
Put a,, a,-1 and a, -2 from a'P' in the given equation, we get
rAg +Ar+ 4A,r- 1 + 4A,r-1 + 44,r - 2)2 + 44,r-2 =
A r + 4r2- 8r + 4 + 4r2 - 16r + 16) +

Ar+4-4-12r2+12r + 4r3-32-24+ 48r)=r?


A9-24r + 20) +A,(93- 482 +60r 36) = 2
Comparing the coefficient of same power of r, we get
9A-484, = 1
.5.28.1)
20A-364, =0 ..(5.28.2)
Solving equation (5.28.1) and (5.28.2) A = A, =
b3 159
The complete solution is,

a, =a,Da, =
Ag+Ar) -2 l5
Que 5.29. | Suppose that a valid codeword is an n-digit number in
decimal notation containing an even number of O's. Leta, denote
the number of valid codewords of length n satisfying the recurrence
relation a, 8a,., + 10 and the initial condition a, = 9. Use
generating functions to find an explicit formula for a,.

AKTU 2018-19, Marks 07


5-32 C (CS/IT-Sem-3) Trees, Graph and Combinatorics

Answer

Let Ga)= 2 a, *" be the generating function ofthe sequencedgG1 G2


=0

we sum both sides of the last equations starting with n = 1. To find that

10-1 ")
Glx) -

1= 24," > (8a,-1x"


= +

=8-1"+10
n-1 n=1

8x- +x10-1-l
n=1 n=l

8x,x" +x10""
n=0 n=0
= 8xG(x) + x/(1 - 10x)

Therefore, we have
Glt)-1 &rGx) + x/1 - 10x)
Expanding the right hand side of the equation into partial fractions gives

Gx) +
21-8x1-10x)
This is equivalent to

n=0 n=

(8+ 10" )x"


n=0

4,(8+10")
Que 5,30. Define permutation and combination. Also, write
difference between them.

Answer
Answer
1. Permutation refers to different ways of arranging a set of object in a
sequential order.

2 The number of permutations ofn different things taken r (s n) at a


time is denoted by pín, r) or "P,
3. Combination refers to several ways of choosing items from a large set
of object.
Discrete Structures & Theory of Logic 5-33 C (CS/IT-Sem-3)

The number of combinations of n different thing taken r (S n) at a time


is denoted by Cln, r) or
"C,
The selection of two letters from three letters a, b, c are ab be ca and thus,
the number of combinations of 3 letters taken 2 at a time is C(3, 2) =3
Difference between a permutation and combination:

S.INo. Permutation Combination


1. Both selection and arrangement | Only selection is made.
are made.

2. Ordering of the selected object Ordering of the selected object is


is essential. not essential.

3. Multiple permutations can be Single combination is derive from


derive from combination. single permutation.
n n!
+.
P,(n-r) nC, ! ( n r )

Que 531. Suppose that a cookie shop has four different kinds of
cookies. How many different ways can six cookies be chosen?

AKTU 2016-17, Marks 15


Answer
As the order in which each cookie is chosen does not matter and each kind of
cookies can be chosen as many as 6 times, the number of ways these cookies
can be chosen is the number of 6-combination with repetition allowed from
a set with 4 distinct elements.
The number of ways to choose six cookies in the bakery shop is the number
of 6 combinations of a set with four elements.
C(4 +6-1, 6) =C(9, 6)
Since C(9, 6) = C(9,3) = (9 8 7)/(1 2 3) = 84
Therefore, there are 84 different ways to ehoose the six cookies.

Que 5.32. Write short notes on the following


i. Recursive algorithms ii. Pigeonhole principle

Answer
i. Recursive algorithm:
A function is called recursively defined if the function refers to itself.
and satisfies the following step:
a. There must be certain arHuments for which the funetion does not
refer to itself, these arguments are called initia! viulues(Base values).
5-34 C (CS/AT-Sem-3) Trees, Graph and Combinatorics

b. These base values are used to define the other values of the function
by using the funetion recursively.
Example a, = 3 a 1 r 2 1, a,= 1

then a = 3a=3

a 3a, = 3 (3a,) = 3 a = 3*
and so on.
a, =3', r2 0
ii. Pigeonhole principle:
The pigeonhole principle is sometime useful in counting methods.
Ifnpigeons are assigned to m pigeonholes then at least one pigeonhole
contains two or more pigeons (m < n).
Proof:
1. Let m pigeonholes be numbered with the numbers 1 through m.
2. Beginning with the pigeon 1, each pigeon is assigned in order to the
pigeonholes with the same number.
Since m < n i.e., the number of pigeonhole is less than the number of
pigeons, n-m pigeons are left without having assigned a pigeonhole.
4. Thus, at least one pigeonhole will be assigned to a more than one pigeon.
5. We note that the pigeonhole principle tells us nothing about how to
locate the pigeonhole that contains two or more
pigeons.
6. It only asserts the existence of a pigeon hole containing two or more
pigeons.
7. To apply the principle one has to decide which objects will play the role
of pigeon and which objects will play the role
of pigeonholes.
Que 5.33.Find the number of integers between 1 and 250 that are
divisible by any of the integers 2, 3, 5, and 7.

Answer
1, 2, 3, - - .
250
Number ofintegers between 1 and 250 that are divisible by 2
Quotient of last number +2- quotient of first number +2
(250 2)-(1+2) = 125-0 125
Number of integers between 1 and 250 that are divisible by 3
(250+3)-(1 +3) = 83-0 83
Number of integers between 1 and 250 that are divisible by 5
(250+5) (1+5) =50-0 50
Number of integers between 1 and 250 that are divisible by 7
(250+7)-(1+7) =35-0 =5
Total number of integers divisible by only 2, 3, 5, 7, individually are
125 + 83+50+ 35 293
Number of integers divisible by (2 and 3) = 411
Discrete Structures & Theory of Logic 5-35 C (CS/IT-Sem-3)

Number of integers divisible by (2 and 5) = 25


Number of integers divisible by (2 and 7) = 17
Number of integers divisible by (3 and 5) = 16

Number of integers divisible by (3 and 7) = 11


Number of integers divisible by (5 and 7) = 7

Number of integers divisible by (2, 3 and 5) = 8

Number ofintegers divisible by (2,3, and 7) = 5


Number ofintegers divisible by (2,5, and 7) = 3
Number of integers divisible by (3, 5 and 7) = 2

135
Number of integers between 1 and 250 that are divisible by any of the
integer (2, 3, 5 and 7) = 293 135 = 158.

Que 5.34.| How many different rooms are needed to assign 500
classes, ifthere are 45 different time periods during in the university
time table that are available?

Answer
Using pigeonhole principle:
Here n= 500, m =45 = 500-1 1
45
At least 12 rooms are needed.

Que 5.35.A total of 1232 student have taken a course in Spanish,


879 have taken a course in French, and 114 have taken a course in
Russian. Further 103 have taken courses in both Spanish and
French, 23 have taken courses in both Spanish and Russian, and 14
have taken courses in both French and Russian. If 2092 students
have taken least one of Spanish, French and Russian, how many
students have taken a course in all three languages ?

AKTU 2018-19, Marks 07


Answer
Let S be the set of students who have taken a course in Spanish, F be the set
of students who have taken a course in French, and R be the set of students
who have taken a course in Russian. Then, we have
S | = 1232, |F| = 879, |R| = 114, |S nF| = 103, 1S n R| = 23,
|SnR| = 14, and |SuFUR| = 23.
Using the equation
SuFURI = |S|+ |F|+ |R| - |SnF| - | S o R | - 18aR| + |Su

FuR
5-36 C (CS/AT-Sem-3) Trees, Graph and Combinatorics

2092 1232 +879+ 114-103-23-14 +|SnFnR|,


SnFoR| =7.
=
103
=? doF|
SFnR

IS = 1232
F 879

S R =23
FoRI = 14

R = 114 ISnFoR| = 2092

Fig. 6.36.1

VERY IMPORTANT QUESTIONS


Following questions are very important. These questions
may be asked in your SESSIONALS as well as
UNIVERSITY EXAMINATION.

Q.1. Explain in detail about the binary tree traversal with an


example.
Aaa Refer Q. 5.3.

Q2. Define a binary tree. A binary tree has 11 nodes. It's inorder
and preorder traversals node sequences are:
Preorder:ABDHIEJLCFG
Inorder:HDIB JEKAFCG
Draw the tree.
AB Refer Q. 5.5.

Q.3. Given the inorder and postorder traversal of a tree T:


Inorder: HFEABIGDC Postorder: BEHFACDGI
Determine the tree T and it's Preorder.
Ans. Refer Q. 5.6.

You might also like