You are on page 1of 86

Theory of

Theory of Computation
Computation
(2160704)
(2160704)
Prof. Dixita Kagathara
dixita.kagathara@darshan.ac.in

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 11 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Examination Scheme
Examination Marks Total
Theory Marks Practical Marks Marks
ESE(E) PA (M) ESE (V) PA (I)
PA ALA ESE OEP

70 20 10 0 0 0 100

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 22 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
GTU Syllabus
Unit Content Total Hrs. % Weightage
1 Review of Mathematical Theory: Sets, Functions, Logical 10 16
statements, Proofs, relations, languages, Mathematical
induction, strong principle, Recursive definitions

2 Regular Languages and Finite Automata: Regular 12 20


expressions, regular languages, applications, Automata
with output-Moore machine, Mealy machine, Finite
automata, memory requirement in a recognizer,
definition, union, intersection and complement of
regular languages. Non Determinism Finite Automata,
Conversion from NFA to FA, ^ - Non Determinism Finite
Automata Conversion of NFA - ^ to NFA and equivalence
of three Kleene’s Theorem, Minimization of Finite
automata Regular And Non Regular Languages –
pumping lemma.

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 33 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
GTU Syllabus
Unit Content Total Hrs. % Weightage
3 Context free grammar (CFG): Definition, Unions 12 20
Concatenations And Kleene’s of Context free language
Regular grammar, Derivations and Languages,
Relationship between derivation and derivation trees,
Ambiguity Unambiguous CFG and Algebraic Expressions
Bacus Naur Form (BNF), Normal Form – CNF
4 Pushdown Automata, CFL And NCFL: Definition, 12 20
deterministic PDA, Equivalence of CFG and PDA,
Pumping lemma for CFL, Intersections and
Complements of CFL, Non-CFL
5 Turing Machine (TM): TM Definition, Model Of 12 20
Computation And Church Turning Thesis, computing
functions with TM, Combining TM, Variations Of TM,
Non Deterministic TM, Universal TM, Recursively and
Enumerable Languages, Context sensitive languages and
Chomsky Hierarchy

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 44 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
GTU Syllabus
Unit Content Total Hrs. % Weightage
6 Computable Functions: Partial, total, constant functions, 2 4
Primitive Recursive Functions, Bounded Mineralization,
Regular function, Recursive Functions

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 55 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Reference Books
 Introduction to Languages & Theory of Computation by John C.
Martin (Textbook)
 An introduction to automata theory and formal languages By
Adesh K. Pandey, Publisher: S.K.Kataria & Sons
 Introduction to computer theory By Deniel I. Cohen , Joh Wiley &
Sons, Inc
 Computation: Finite and Infinite By Marvin L. Minsky Prentice-Hall
 Compiler Design By Alfred V Aho, Addison Weslley
 Introduction to the Theory of Computation By Michael Sipser
 Automata Theory, Languages, and Computation By John Hopcroft,
Rajeev Motowani, and Jeffrey Ullman

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 66 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Unit wise Weightage

No. UNIT S-16 W-16 S-17 W-17 Total Avg.

1 Review of mathematical theory 14 14 14 14 56 14

2 Regular language & finite automata 28 42 14 35 119 30

3 Context free grammar 7 14 25 10 56 14

4 PDA, CFL & Non CFL 7 14 11 4 36 9

5 Turing Machine 14 21 10 14 59 15

6 Computable Function 7 7 4 7 25 6

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 77 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Unit– 1– 4
Unit
Pushdown
Review of Mathematical
Theory
Automata
Prof. Dixita Kagathara
dixita.kagathara@darshan.ac.in

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 88 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Set

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 99 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Sets
• A set is a collection of objects.
• The objects in a set are called elements of the set.
• Examples:
 A = {11, 12, 21, 22}
 B = {11, 12, 21, 11, 12, 22) Roster Notation
 C = {x | x is odd integer greater than 1}
 D = {x | x is a two digit integer, each of whose digits is 1 or 2}
 E = {3i + 7j | i, j Є N} Set-builder
 F = {x | x Є B and x ≤ 11} Notation

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 10
10 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Operations on Sets
 Operations on the sets are:
1. Complement
2. Union
3. Intersection
4. Set Difference
5. Symmetric Difference
6. Cartesian product

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 11
11 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Operations on Sets
Complement
 The complement of a set A is the set A’ of everything that is not an
element of A from Universal Set U.

U
 Example:
U = {1,2,3,4,5} A
A = {1,2}
A’ = {3,4,5}

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 12
12 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Operations on Sets
Union
 The Union is a collection of all distinct elements from both the set
A and B.

Example
A = {1, 3, 5, 7, 9}
B = {1, 2, 3, 4, 5}
U
A U B = {1, 2, 3, 4, 5, 7, 9}
A B

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 13
13 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Operations on Sets
Intersection
 The intersection A ∩ B of two sets A and B is the set that contains
all elements of A that also belong to B (or equivalently, all
elements of B that also belong to A), but no other elements.

Example
A = {1, 3, 5, 7, 9} U
B = {1, 2, 3, 4, 5}
A ∩ B = {1, 3, 5}
A B

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 14
14 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Operations on Sets
Set Difference
 The set difference A - B of two sets A and B is the set of everything
in A but not in B.

Example
A = {1, 3, 5, 7, 9} U
B = {1, 2, 3, 4, 5}
A - B = {7, 9} A B

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 15
15 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Operations on Sets
Symmetric Difference
 The symmetric difference A ⊖ B of two sets A and B is the set of
everything in A but not in B or the set of everything in B but not
in A.

Example U
A = {1, 3, 5, 7, 9} A B
B = {1, 2, 3, 4, 5}
A ⊖ B = {7, 9, 2, 4}
Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 16
16 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Operations on Sets
Cartesian Product
 The Cartesian product A x B of two sets A and B is the set of all
ordered pairs (a,b) where a ∈ A and b ∈ B.
 Ordered means that the pair (a, b) is different from the pair (b, a)

Example
A = {1, 3, 5}
B = {2, 4}
A x B = {(1,2), (1,4), (3,2), (3,4), (5,2), (5,4)}

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 17
17 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Set of Identities
 Commutative laws

 Associative laws

 Distributive laws

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 18
18 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Set of Identities
 Idempotent laws

 Absorptive laws

 De Morgan laws

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 19
19 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Set of Identities
 Other complements laws  Other empty set laws

 Other universal set laws

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 20
20 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Logic

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 21
21 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Propositions
 Declarative statement that is sufficiently objective, meaningful
and precise to have a truth value (true or false) is known as
proposition.
 Examples:
• p : Fourteen is an even integer.
• r:0=0
• q : Mumbai is the capital city of India.
• s : a2+b2=4

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 22
22 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Logical Connectives
 Logical Connectives are:
1. Conjunction (^) (AND)
2. Disjunction (v) (OR)
3. Negation () (NOT)
4. Conditional Connective ()

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 23
23 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Logical Connectives
1) Conjunction (^)
 The logical connective Conjunction (And) is true only when both of
the propositions are true.
 Example
• p : It is raining
• q : It is warm
• r : It is raining AND it is warm
 Truth table
p q r=p^q
True True True
True False False
False True False
False False False

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 24
24 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Logical Connectives
2) Disjunction (v)
 The logical disjunction, or logical OR, is true if one or both of the
propositions are true.
 Examples
• p:2+2=5
• q:1<2
• r : 2 + 2 = 5 OR 1 < 2
 Truth table
p q r=pvq
True True True
True False True
False True True
False False False

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 25
25 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Logical Connectives
3) Negation ()
 p, the negation of a proposition p, is also a proposition
 Examples:
• p : John studies.
• p : John does NOT study.
 Truth table
P P
True False
False True

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 26
26 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Logical Connectives
4) Conditional connective
 The proposition p q is commonly read as “if p then q”.
 Example:
• P I will win the lottery.
• Q I will buy car for you.

I win the I will buy Promise kept/ Truth Table


lottery car for you broken p q pq
Yes Yes Kept True True True
Yes No Broken
True False False
No Yes Not broken
False True True
No No Not broken
False False True

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 27
27 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Logical Connectives
 The statement pq can be read as following:
1. “if p then q”
2. “q if p”
3. “ p only if q”
 Consider following two statements
1) “p if q”(qp)
2) “p only if q”(pq)
 If we make conjunction of (1) & (2) then,
(pq)^(qp)=pq (biconditional) "p only if q, and p if q“
 Often read as "p if and only if q"

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 28
28 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Tautology and Contradiction
 A Compound proposition is called tautology if it is true in every
case.
 Example:

P P P v P Tautology
T F T
T F T
F T T
 A contradiction
F T T is opposite.

 If p is tautology, P is contradiction.

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 29
29 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Exercise
 Check whether (p v q) ^ (pq) is tautology?

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 30
30 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Logical Quantifiers
1) Universal Quantifier
 Represented by an upside-down A:  (“for all”)
 Example:
• Let P(x) = x+1 > x, x P(x)
• English translation: “for all values of x, P(x) is true”
• English translation: “for all values of x, x+1>x is true”

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 31
31 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Logical Quantifiers
2) Existential Quantifier
 Let P(x) = x+1 > x
• There is a numerical value for which x+1>x
• In fact, it’s true for all of the values of x.
• Thus, x P(x) is true

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 32
32 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Functions

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 33
33 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Functions
 A function is a relation in which each element of the domain is
paired with exactly one element of the codomain.
 Another way of saying it is that there is one and only one output
(y) with each input (x).

 Example:
x y

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 34
34 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Function Notation
 Domain: What can go into the function is called domain.
 Codomain: What may possibly come out of a function is
codomain.
 Range: What actually come out of a function is range. The range of
function is subset of codomain
 Example:
1
1 2
• f(1)=2(1)+1= 3 2
3
4
• f(2)=2(2)+1= 5 Range 5
3 6
• f(3)=2(3)+1= 7 7
4 8
• f(4)=2(4)+1= 9 9
10
• The range of function f(x) = {3, 5, 7, 9}
Domain Codomain

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 35
35 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Onto Function
 If the range of function and codomain of function are equal or
every element of the codomain is actually one of the values of the
function, then function is said to be onto or surjective or
surjection.
 Let us define function where A = {-2,-1,1,2,3,4} and B =
{1,4,9,16} -2
A B
• f(-2) = 4 1
-1
• f(-1) = 1
1 4
• f(1) = 1
• f(2) = 4 2
9
• f(3) = 9 3
• f(4) = 16 16
4
 The range of function f(A) = {1, 4, 9, 16} = B

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 36
36 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
One-to-One Function
 A function for which every element of the range of
the function corresponds to exactly one element of the domain is
known as One-to-One or injective or injection.
 Let us define function where A = {1,2,3,4} and B =
{1,4,9,16,25,36} A B
• f(1) = 1 1 1
• f(2) = 4 4
2
• f(3) = 9
• f(4) = 16 9
3
16
4
25

36

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 37
37 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Bijection Function
 If function is both one-to-one and onto then function is called
Bijection function.
 Let us define function where A = {1,2,3,4} and B =
{1,4,9,16}
• f(1) = 1 A B
• f(2) = 4 1 1
• f(3) = 9 4
2
• f(4) = 16
9
3
16
4

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 38
38 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Prove that f: R → R, f(x) = x2 is not one-to-one and not onto function

 The range and codomain of are not equal, So function is not onto
function.
 The function is not one to one because elements of are
connected with more than one elements of .
f(-2) = 4
f(-1) = 1
f(1) = 1 A -2.0 B -2.0
f(2) = 4 -1.0 -1.0
f(3) = 9 1.0 1.0
f(4) = 16 2.0 4.0
3.0 9.0
16.0
4.0

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 39
39 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Prove that f: R → R+, f(x) = x2 is not one-to-one and onto function

 The range and codomain of are equal So, function is onto function.
 The function is not one to one because elements of are
connected with more than one elements of .
f(-2) = 4
f(-1) = 1
f(1) = 1
f(2) = 4 A -2.0 B
-1.0
f(3) = 9
f(4) = 16 1.0 1.0
2.0 4.0
3.0 9.0
16.0
4.0

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 40
40 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Prove that f: R+ → R, f(x) = x2 is one-to-one and not onto function

 The range and codomain of are not equal So, function is not onto
function.
 The function is one to one because elements of are connected
with single element of .
f(1) = 1
f(2) = 4
f(3) = 9 A B -2.0
f(4) = 16 -1.0
1.0 1.0
2.0 4.0
3.0 9.0
16.0
4.0

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 41
41 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Prove that f: R+ → R+, f(x) = x2 is one-to-one and onto function
(bijection)
 The range and codomain of are equal So, function is onto
function.
 The function is one to one because elements of are connected
with single element of .
 The function is onto function as well as one-to-one function. So, it
is called as bijection function.
f(1) = 1
f(2) = 4
f(3) = 9 A B
f(4) = 16 1.0 1.0
2.0 4.0
3.0 9.0
16.0
4.0

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 42
42 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Compositions of Function
 Let and , the range of f is a subset of B1, then makes sense for
each and the function defined by is called the composition of
and .
 It is written as
 Example

A B C
a 1 @
b 2 #
c 3 !

d 4

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 43
43 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Inverse of Function
 Let be a function whose domain is the set , and whose range is
the set . Then is invertible if there exists a function with domain
and range , with the property:

 To be invertible a function must be both an injection and a


surjection.

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 44
44 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Relations

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 45
45 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Relations
 A relation on a set A is defined as subset of .
 The relation is denoted as where and pair .
 Example
• The ‘=‘ relation on is the set {(1,1), (2,2),…}
where 1 = 1, 2 = 2 and so on
• The ‘<‘ relation on is the set {(1,2), (1,3)…}
where 1 < 2, 1 < 3 and so on

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 46
46 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Properties of Equivalence Relations
 Assume that is a relation on a set , in other words, , where to
indicate is related to via Relation .
1. is reflexive if for every
2. is symmetric if for every and in , if , then
3. is transitive if for every and in , if and , then
4. is an equivalence relation on , if is reflexive, symmetric and
transitive.

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 47
47 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Example: Equivalence Relation
 Example : A={a, b}, R={(a, a), (b, b), (a, b), (b, a)}
• Reflexive: {(a, a),(b, b)}
• Symmetric: {(a, b), (b, a)}
• Transitive: {(a, a), (a, b), (a, b)
(b, b), (b, a), (b, a)
(a, b), (b, b), (a, b)
(b, a), (a, b), (b, b)
(b, a), (a, a), (b, a)}
 Above relation is Equivalence relation because it is Reflexive,
symmetric and transitive.

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 48
48 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Exercise
1. A={1, 2, 3}, R={(1, 2), (1, 1), (2, 1), (2, 2), (3, 2), (3, 3)} is equivalent
relation?
2. A={1, 2, 3, 4}, R={(1, 1), (2, 2), (2, 3), (3, 2), (4, 2), (4, 4)} is
equivalent relation?
3. A={0, 1, 2}, R={(0, 0), (1, 1), (2, 2), (1, 0), (2, 1)} is equivalent
relation?

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 49
49 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Proof

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 50
50 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Proof
 A proof of a statement is essentially just a convincing argument
that the statement is true.
 A typical step in proof is to derive some statement from:
1. Assumptions or hypotheses
2. Statements that have already been derived
3. Other generally accepted facts
 There are several methods for establishing a proof, some of them
are:
1. Direct proof
2. By contradiction
3. By mathematical induction

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 51
51 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Prove: Product of Two Odd Integers is Odd
 To prove: For any integer and , if and are odd, then is odd.
 Proof:
 Assumption: An integer is odd if there exists an integer so
that .
 Let and be any odd integers.
 Then according to definition, there is an integer so that and
there is an integer so that
 To show that there is an integer so that

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 52
52 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Prove: Product of Two Odd Integers is Odd
  Therefore

 Since we have shown that there is a so that .


 Hence we proved that “The product of two odd integers is
odd”.

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 53
53 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Rational & Irrational numbers
 A rational number is a number that can be in the form m/n
where m and n are integers and n is not equal to zero.
 Examples:
1.5 = 3/2
6 = 12/2 Rational
5 = 15/3 Numbers

π=22/7= 3.14159265 3589793238462643383279502884197..…

Irrational
Numbers

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 54
54 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Prove: is Irrational
 Definition: A real number is rational if there are two integers and
so that .
 Proof:
 Suppose for the sake of contradiction that is rational.
 Then there exists some integers and such that .
 By dividing both and by all the factors that are common to both,
we obtain , for some integers and having no common factors.
 Since , . Squaring both sides of this equation, we obtain , and
therefore is even.

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 55
55 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Prove: is Irrational
 If and are odd, then is odd. Since a conditional statement is
logically equivalent to its contra positive, we may conclude that for
any and , if is not odd, then either is not odd or is not odd.
 However, an integer is not odd if and only if it is even, and so for
any and , if is even, or is even.
 If we apply this when , we conclude that since is even, must be
even.
 This means that for some , . Therefore, .
 Simplifying and cancelling from both sides, we obtain . Therefore
is even and therefore for some .

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 56
56 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Prove: is Irrational
 We have shown that and are both divisible by 2. This contradicts
the previous statement that and have no common factor.
 The assumption that is rational therefore leads to a contradiction,
and the conclusion is that is irrational.

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 57
57 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Languages

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 58
58 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Language
 Language comprises of
• Set of characters –
• Set of strings (words) defined from set of character -
• Language L is defined from , and because contains many string which may
not satisfy the rules of language.
 Example
• = {a, b}
• = {^, a, b, aa, ab, ba, bb, aaa, aab, aba, abb, baa, …}
• Few languages over are
• {^, a, aa, aab}
(| | indicates length of string)
• {}
• {}
• {}
(indicates number of a in string x)
Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 59
59 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Language
 A set of strings all of which are chosen from some , where is a
particular alphabet, is called a language. If is an alphabet, and ,
then is said to be language over alphabet .

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 60
60 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Operations over Language
 Operations over the language are:
1. Concatenation
2. Union
3. * (Kleene closure)
4. +

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 61
61 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Operations over Language
 Concatenation
If then concatenation is defined as

Example
= {hope, fear} and = {less, fully}

hope less

hopeless
= {hopeless, hopefully, fearless, fearfully}
Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 62
62 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Operations over Language
 Union
If then union is defined as

Example
= {hope, fear} and = {less, fully}

= {hope, fear, less, fully}

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 63
63 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Operations over Language
 Kleene Closure (Zero or more occurrences)
If is a set of words then by we mean the set of all finite strings
formed by concatenating words from S, where any word may be
used as often we like, and where the null string is also included.

Example = {ab}

^ ab abab ababab abab ab ab ……


* = {^, ab, abab, ababab, abababab, ….}
Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 64
64 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Operations over Language

If is a set of words then by we mean the set of all finite strings
formed by concatenating words from L, where any word may be
used as often we like, and where the null string is not included.

Example = {ab}

ab abab ababab abababab ……


= {ab, abab, ababab, abababab, ….}
Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 65
65 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Principle of Mathematical
Induction

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 66
66 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Principle of Mathematical Induction
 Suppose is a statement involving an integer . Then to prove that
is true for every , it is sufficient to show these two things:
1. is true.
2. For any , if is true, then is true.

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 67
67 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Prove using PMI
 Let be the statement

 To prove: is true for every


Proof:
 Basic Step:
– We must show that is true. is the statement and this obviously
true.
 Induction Hypothesis:
– and

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 68
68 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Prove using PMI
 To prove: is true

 Proof of Induction
=
=
= (by induction hypothesis)
=

=
= (Hence Proved)

Hence by principle of mathematical induction,

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 69
69 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Prove 7+ 13+19+…..+(6n+1)= n(3n+4) using PMI, n>=1

 Step-1: Basic
We must show that p(1) is true.
P(1)= 6n+1=(6(1)+1)=7
P(1)= n(3n+4) =1(3(1)+4)=7
And, this is obviously true.
 Step-2: Induction Hypothesis
k >= 0 and
p(k) = 7+13+19+…..+(6k+1)=k(3k+4)

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 70
70 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Prove 7+ 13+19+…..+(6n+1)= n(3n+4) using PMI, n>=1

 Step-3: Proof of Induction


P(k+1) = 7+13+19+…..+(6k+1)+(6(k+1)+1)
= k(3k+4)+(6(k+1)+1)
= k(3k+4)+(6k+6+1)
= 3k2+4k+6k+7
= 3k2+10k+7
= 3k2+3k+7k+7
= 3k(k+1)+7(k+1)
= (k+1)(3k+7)
= (k+1)(3k+3+4)
= (k+1)(3(k+1)+4)

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 71
71 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Prove 1 +3 +5 + … +2n-1 = n2 using PMI, n>=1
 Step-1: Basic
We must show that P(1) is true.
P(1) = 2(1)-1= 1
P(1) = (1)2 = 1
And, this is obviously true.
 Step-2: Induction Hypothesis
k >= 0 and
p(k) = 1+3+5+…..+(2k-1)=k2
 Step-3: Proof of Induction
P(k+1) = 1+3+5+….+(2k-1)+(2(k+1)-1)
= k2 + (2(k+1)-1)
= k2 + (2k+2-1)
= k2 + 2k+1
=(k+1)2

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 72
72 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Prove using PMI
 Step-1: Basic
We must show that p(1) is true.
P(1)=(1)2=1
P(1)= =1
And, this is obviously true.
 Step-2: Induction Hypothesis
k >= 0 and
P(k) = 1+4+9+….k2 =

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 73
73 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Prove using PMI
 Step-3:Proof of Induction
P(k+1) = + (k+1)2
=
=
=
=
=
=
=
=
=
=

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 74
74 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Prove using PMI
 Step-1: Basic
We must show that p(1) is true.
P(1)=
P(1) =
And, this is obviously true.
 Step-2: Induction Hypothesis
k >= 0 and
p(k)=

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 75
75 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Prove using PMI
 Step-3: Proof of Induction
p(k+1) =
=
=
=
=
=
=
=

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 76
76 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Prove 1+ using PMI
 Step-1: Basic
We must show that p(1) is true.
P(1)= 1+(1*1!)=1+1=2
P(1)= (1+1)! =(2)! = 2
And, this is obviously true.
 Step-2: Induction Hypothesis
k >= 0 and
p(k) = 1+(1+4+18+…..+(k*k!)) = (k+1)!

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 77
77 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Prove 1+ using PMI
 Step-3: Proof of Induction
P(k+1) = 1+(1+4+18+…..+(k*k!) + (k+1)*(k+1)!)
= (k+1)! + (k+1)(k+1)!)
= (k+1)! (1+(k+1))
= (k+1)! ((k+1)+1)
= ((k+1) + 1)!

Note:
5!=5*4!
6!=6*5!
(K+1)!=(k+1)*k!

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 78
78 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Prove that 2n>n3 where n>=10, Using PMI
 Step-1: Basic step
We must show that p(10) is true.
210=1024 and 103=1000
So,1024>1000
And, this is obviously true.
 Step-2: Induction Hypothesis
For k>=10
P(k)= 2k>k3
Statement to be shown in Induction step is,
P(k+1)=2k+1>(k+1)3

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 79
79 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Prove that 2n>n3 where n>=10, Using PMI
 Step-3: Proof of Induction
2k+1>(k+1)3
Where, 2k+1=(2k )(2)>2k (1.331)
>2k (1.1)3
>2k (1+0.1)3
>2k (1+)3
>2k(1+)3 for k>=10
>()3 (2k)
>()3 (k3) ,because 2k>k3
(2k )(2)>(k+1)3
2k+1>(k+1)3 ;k>=10

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 80
80 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Prove n(n2+5) is divisible by 6 using PMI
 Step-1: Basic step
We must show that p(1) is true.
P(1)=1(12+5)=1+5/6=1
And, this is obviously true.
 Step-2: Induction Hypothesis
For k>=0 and
P(k)=k(k2+5) is divisible by 6.
Statement to be shown in Induction step is,
P(k+1)=(k+1)[(k+1)2+5] is divisible by 6.

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 81
81 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Prove n(n2+5) is divisible by 6 using PMI
 Step-3: Proof of Induction
(k+1)[(k+1)2+5]
= (k+1)(k2+2k+1+5)
= (k+1)(k2+2k+6)
=k3+2k2+6k+k2+2k+6
=k3+3k2+8k+6
=k3+3k2+5k+3k+6
=k(k2+5)+3k(k+1)+6
= k(k2+5)+3k(k+1)+6
 Here, k(k2+5) is divisible by 6 ,given in induction hypothesis.
 In Second term k and k+1 are consecutive. So, one number is even and
one is odd. So, even number is always multiple of 2 and here 3 is also
present .So, second term having (2*3) is also divisible by 6.
 Last term 6 is obviously divisible by 6.Hence proved.

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 82
82 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Strong Principle of Mathematical Induction
 Suppose is a statement involving an integer . Then to prove that
is true for every , it is sufficient to show these two things:
1. is true.
2. For any , if is true for every satisfying , then is true.

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 83
83 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Prove that Integer Bigger than 2 have prime
factorization using strong PMI
 To prove: is true for every , where is the statement: is either a
prime or a product of two or more primes.
 Basis Step:
– is the statement that is either prime or a product of two or more
primes. This is true because 2 is a prime.
 Induction Hypothesis:
– , and for every with , is either prime or a product of two or more
primes.
 To prove: is either prime or a product of two or more primes.

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 84
84 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
Prove that Integer Bigger than 2 have prime
factorization using strong PMI
 Proof of Induction
– We consider two cases.
1. If is prime, the statement is true.
2. By definition of a prime, , for some positive integer and , neither
of which is or .
It follows that and . Therefore, by the induction hypothesis, both
and are either prime or the product of two or more primes.
Therefore, their product is the product of two or more primes,
and is true.

Hence by strong principle of mathematical induction, Integer bigger


than 2 have prime factorization
Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 85
85 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology
End of Unit - 1

Unit
Unit –– 1:
1: Review
Review of
of Mathematical
Mathematical Theory
Theory 86
86 Darshan
Darshan Institute
Institute of
of Engineering
Engineering &
& Technology
Technology

You might also like