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

Toc Final PDF

The document discusses various concepts related to Turing machines, including their acceptance criteria, state transitions, and the relationship between different types of grammars and automata. It also touches on the decidability of problems and the capabilities of deterministic versus non-deterministic Turing machines. Additionally, it outlines the process for designing a Turing machine for specific languages and the implications of different production rules.

Uploaded by

PRISHA GUPTA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Toc Final PDF

The document discusses various concepts related to Turing machines, including their acceptance criteria, state transitions, and the relationship between different types of grammars and automata. It also touches on the decidability of problems and the capabilities of deterministic versus non-deterministic Turing machines. Additionally, it outlines the process for designing a Turing machine for specific languages and the implications of different production rules.

Uploaded by

PRISHA GUPTA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 157

Eftfa.

IE WE M
then for
P W BX
aw xx 1

yields
18 scar
where a
a Zo

is not defined
840,111 120
0
1111,9
d 9 11 Zo
1120 8cm 111,120
8 No 11
d a 1,120
8 or 11,1120
8 W E Zo
8 No 1 111202
finalstad
Slovo E 111120
1

IDA
addthis.me te 3oemftyttack
Empty stack

Finalstat I
ffEE.za

192T
accepts L ifandonly if WWI
IDA
PDA
wwR accepted by
wR wrzo
WR wrzo a
Wo w̅ Zo
f
E 2
Wi 0,2 T.wo.zo.fi

0A
d 92,2 0
Pre Final f Wi GZ

f
ww

twf then x
Can t 2
H

wefk.tt
ww
x
ca

18471
a
8 Car se
Two x x

A Am 21m
I
attmf
aefta.ee
T LET
Covo az am ax or am ax

fro IIe
t a.edu

yyR
ifeng.fi contntEII itis accepted by
a PDA

CFG PDA

CFT
PDA v
53
astic

G VUT
CFG VII
PDA M É E Ño Zo Fd
v21
Sasa Ask

Empty Stack
Accept by
Preference
Accept by
Final state

70 Q 0 00
seasa
abseat
I atcha
pop

adf.t
FFfahEFhI

set

1
t. o

fEEOEet
Aba 08
abbacabba

aÉeast szo

Fccla Sa

Echa Esta
cha Eta
I 18 0

1
l
a
a
EZO
S BAIO
B BBI AO BIBBI
FATE
WE

EB
O
NO
GB
ya htionRe s asa bsb c

10 peesa

U6,54 acceptance

fi
as
a arᵗ final state
and
9 c.tt Empty state
0

examplefs B BBI AO AOA E


BA 0

E 011

to
of
fa.FI sr.a zo F0
CFG G V T S P

Qxrxg IVI 191 11 191

Fitresponding to each transition


in'd get the

possibleproduction rule

ttofogprodutinrulefromatransitinl tw
pestffiff x 92 Ex
x
i 8 a a x 92
in 8 91 a x 92 E

x
a x 92,2
tod 8 v1
mieantsheastabs e.FI
acEJ
same E Q
rules are there
so 191 number of production
EI
means no change
8 9 a x 92 x in the stack

e TEES

same E G
rules are there
50 101 number of production

E meanspop
forty 8 V1 a x 2
from the stad
for a

rule is there
only
one production

2
step

Thighthestititider areas list production rules


in the LHS of
the of
the production
rules with any variable
Remove all
RHS
from W'in the the variables
rules for
Remove the production in with terminate
in LHS that can't
result a
string
the productions with thesevariables
Also remove all
whose production rules were removed
in the RHS
in step 2 C
Exactly M 00,93 a b 20
3,9 Zo 0,8 Efferent
Iable dNo a Zo XZo
fngflgqfmaz.at
8 90,9 x 90 90
90 xx 9
S 9 Zoo 9
8 b or 90
As 9 initialstate 9
stack
8 9,6 x 91 t zo Empty
symbol
9,2091
90
8 91 E 20 9 E so
of
902am cartari
p

L1 Productionfuls
90 90 90 90
VoZo 9
a
from
a 90 91 912090
a No Zo d 90,9 Zo 90,12
a 90 90 90209
mi VoZo 91
2 9 a 90 9119,209

a 90 90 90 90
90 90
a 90 91 91 90 from
a
rifax a 90 90 90 91 8 a x 9 xx
9 9
vii
9
9 a a 90 9191
from
ix 90 91 96
91 6 from
9
NIZON
E from
1
s
9 90 9,2 090

8ᵗ
oduction
rule is removed due to 91 90
production rule is removed due to W Z No

is which
m production for 90 90
so remove
terminals
can't end in a
string of
Sᵗ 90 90 in RHS
the production rules with
So MO V is also removed
is removed

of 90 90
SETI there is no production

production of
S 9020 0

so the initial
also removed
is
Remainingproductionfule.ae carozoa
90 91 a 90 91 9 ZOND
or are
90 91 acroxor
190 91
A
B 90 91 6
9 91 6
D
at W Zoar
the resultant G V T S P
so
CFGI v S A BC D

T a b

P A BD B a B C b Gb Dee
S A a
Tw

ÉIdsan the symbol

at the position pointed


the tape head 11fgi
c by

update the symbol


Write
painted
at the position
the tape head
by position left right
Move the tape head one

control unit
the state inside
Change

Fof ET É

90 G F d

states
Q set of
set of ilp symbols
EI be
T set of tape symbols

9 initial state used to


mark
blank
special symbol b
w
the end of symbols
b
in the tape
F set of final states Acett Reject
8 ExF EXETER left
Rs right

Etisalat Reject
Halt
Loop
1
40113
2 0,1 b
4 10 1
1 NET
Ét B_m

t
01m no

EITHYTE
I L
A A
Y YR v
Machine for even palindromes on 0,1
Turing
Accebt
p itinerants
EEtmy.ro's

oxirfV.FI y cXaXiRI

Heard
I L
Echt
A
x

TAccept Agmilsepmhalinthffgja is
ww a

T.on.ca
h a 100100
8 80100 Wu
9 92
1 iR a 9 18 to own
ou
mascot
1004 Eww
a V2
or 9 100
w w.go
9
to
10010
100
w
w
9
400100
9 accepts
Iiii iii iiiit ii t

i
TsyFmp t that can be carried out by
mechanical means can be performed by some

Machine
Turing
the thesis
Arguments for acceptance of
digital
Tythingthatabdonenexisting
Machine
computer can also be done by Turing
has been suggested that
2 Till now no problem Machine
an algorithm
but Turing
is solvable by for the same
not be written
can
program
t

five loop accept


103
halt
L a b c no
aqfbcca.me
a
IE III
Of a
anabb
cc

IXYYCC T
GRFÉIwant
R r
aabbl.cc
x
be
YWR xx
baby

a f
Machine for
Turing
be the start state of TM for yⁿc
accept state will
acceptstate
Y c will be the final
accept state of

Fife
we 1

air GER 42

v4 FY I
O i
I

110
110
yy I
XYX
XX Y YYX
Regular Grammar Finite Automak
Regular Language
PDA
L F G
CF
Unrestricted Machine
Recursivelynumerable
Grammar
Turing

doesnotat
Loop
Decidable

head Multi Tape


ETape Both side infinite

pe11taI1 R
tape
Tape head
left
don't
or right
KT
move

g I Non determinism
0 1 as
Only

IYIIIE.IE
alphabet

Roi
MIKE g
R R3

Kt
EIFFYIIE.IM

a
II II

IIYIII.IE IIII

070 2
19
1
IT
2 0
90
01100110
EWI 811011 11001T
XIIOOT
I 1011
XIIOIYXY1001I
1XYIOIYXYIOOTY XYIOYYXYYOOI.YX
YYOOYYX
YYOYY yyXOYYX
XYY XYY xyy YYX
WWW
0110W
9 051 0 11 xaT1 011 x 19,7011

II xioiaI.fi

907

F
8 at P QxFx IR

a 1
L

7010719in
b GR
b C R

E on
accept One of the paths in the tree leads to

Naccept
All the parts halt and none of them accept
Reject

Loot Atleast does not halt


and none
of
a path
accept
the paths should

n
a.tn

iiiitiit

io at
Effingham
i I 12 24,22
3 1
31 32
12 3 11 2
2H3H11 I2 E 14
1
TE.hn 1IangigePanso
Input string
design TM
For Language
solution to problem
is a
If input to the language
belongs
then string
and TM accepts the string

Church Lambda Calculus

Turing
Machine y

tIcandesignatM
chgchagttm.tt
problem
to the

TM algorithm
we can't design
a
If

IDterminstic
IDterminstic
all KJO

problem is
decided using a Multitake
It a
be
TM in p n then it can
deterministic TM
deterministic
done in a single tape

also in p n

to decide
operations
Non Det TM takes p n

string's

or IX
000
l
Left
k
8
III
and
2h
p
n

II
EE

I.EE

Decide f
if
g

pegi
a I will halt
For some input
Ourproletes
or not tatingProblem

É
I
qfyay pp halts
no

Runaloof
FCF else
Been
F F doesnot halt
IF
Le half
2 9,63
F
abal
a b
BI
Ilp
92cal Initial Config
Fighttransition

eÉ Left transition
Tape symbols
tape splats after
RNIntiff ftp Avaccept

8 i a wj YR
Ef E
921
It

Eviate éxajñ

CEF
transition
right
9 1
3 8 a b 92,4

Iff

Iff r are
B3

EI axY

la D I.C
É EE
a Final state

E
E
i
EE D.CE.E.I.Ed
E 1I THE

FIIII
PCI
É É É
i añ

É É É I
FÉre
É
ÉE É
É É El
EFFIE
É EÉ FILE
ⁿÉ LE
ÉÉ
KEEFFIES
1 CI 5
2 0 1 12
4 40,1100 11,000
to N
correspondence

FThabtic 00,01 10,11000


E 0,1

539101
11,011,111,0011
uncountably Infinite 0,1

00 01110,11 000
E 0,1

2 0,503.413,10 1 3

Fefiniteset
2F
P F
to 2
Assume there is Bijection from

Bijection
Fyfe
Injection
6 403
1
13
its it
N 2
s if Iesi IE
I
te
1.2.4355
T.

39 45 68 3
s
s Si

4 7,5 9,8 54

x 5 E ao F.zo.Fid
gof.IM
8 5 5 Ex FLIR B x
01
to I too tooo
No 9 92 93,95
F
of
too too Foooo

EII
s.EE
ittit
0110010010100100011001s
0
TM 7010010
1 0 00 010

111
Language
Problem
dentifyiusigmulti
tkethting
a1i fq
EI.la d BxQo bw

EI.LI
m rr
Qag

i i w
ang
1 For
Iww
a
li n

111111
014
h IW
W 1
FIAT
rapes tlv_From
I
itt
IFF.
EI

Taft Ñ Taf

iww1 n

item
Ww
Input Digitalcomputer
Iitape
I1
ee

sina.EE IIie

We

wrote F an
a
avg.E.li iE

EFFENDI
or
whether the computation
Computability
decision possible not
or

complexity

DeterministicTI
Multi Single tape
Best Setup
numberof transition
worst case
the problem
complexity
of

h
ftp.t.tt

0 n
9accept

t
RE
complesityclasses mdrelatinmthrec.us
Complexity

Terrible Deterministic
TMI
Non

Teth

Deterministic TM
NPL
atleast as hard
Problems that are
NP Hard in NP
as thehardestplobems
time
reduces to B in Poly
II p
BE A

consideredas the hardest problems


These are
NP Complete
in NP

BENPL CE NP Hard
B p

HovetoshowaproblemisNPI IO
the problem is NP Hardy
To show that
NP
it belongs to
To show
Theorems
SAI cookLevin
xnE 0,1
1_
satisfTII animations of literals
literals IIIT
1 Conjunction

disjunction

CNFSConjunctiveNormalfar
infdause.si

ELF boolean
variables
1 to the satisfies
the values that CNF
need to assign n such
We
i 1,2
ri for
variables
the bookan
decisiona.FI an assignment of
CNF
in poly n whether the
can we
decide
not
satisfies or
Non Deterministic TM takes 001 of
EE
We

É ÉÉÉ 8 ai Wo

É
j

Ét
ÉÉÉiÉi

Y
i
aj wash

ii
I
y

NK
0
nk

01m
want to prove to be
Unknown Problem T we

NPI
Show a reduction
SAT I
Hand
ThispravetEP
of T it
a solution
Show the given whether
in poly IIIPI
can be verified
is correct or not
the solution
ThisprovesTENP

TENPI
Time Complexity for Identifying ww
Problem:

Verify if a string of length nnn is of the form ww, where n=2mn = 2mn=2m (an even length), and both halves are identical.

Steps Involved:

1. Copy the First Half:


○ This step involves copying the first m=n2m = \frac{n}{2}m=2n​symbols from Tape 1 to Tape 2.
○ Time required: O(m)=O(n/2)=O(n)O(m) = O(n/2) = O(n)O(m)=O(n/2)=O(n).
2. Compare the Second Half:
○ Compare the second half of the input (from position m+1m+1m+1 to nnn) with the copied first half on Tape 2.
○ Time required: O(m)=O(n/2)=O(n)O(m) = O(n/2) = O(n)O(m)=O(n/2)=O(n).

Total Time Complexity:

● Copying + Comparing = O(n)+O(n)=O(n).

Thus, the time complexity for identifying ww using a multi-tape Turing machine is O(n).

2. Time Complexity for Identifying ww'


Problem:

Verify if a string of length nnn is of the form ww', where the second half is the reverse of the first half.

Steps Involved:

1. Copy the First Half:


○ Copy the first m=n2m = \frac{n}{2}m=2n​symbols from Tape 1 to Tape 2.
○ Time required: O(n)O(n)O(n).
2. Reverse the First Half:
○ Reverse the copied symbols on Tape 2 to prepare for comparison.
○ Reversing takes O(m)=O(n/2)=O(n)O(m) = O(n/2) = O(n)O(m)=O(n/2)=O(n).
3. Compare the Second Half:
○ Compare the second half of the string on Tape 1 with the reversed first half on Tape 2.
○ Time required: O(m)=O(n/2)=O(n)O(m) = O(n/2) = O(n)O(m)=O(n/2)=O(n).

Total Time Complexity:

● Copying + Reversing + Comparing = O(n)+O(n)+O(n)=O(n)O(n) + O(n) + O(n) = O(n)O(n)+O(n)+O(n)=O(n).

Thus, the time complexity for identifying ww' using a multi-tape Turing machine is O(n)O(n)O(n).

Comparison: Single-Tape vs. Multi-Tape Turing Machine


● In a single-tape Turing machine, the head must frequently move back and forth between the two halves of the string,
leading to a time complexity of O(n2)O(n^2)O(n2) for both ww and ww'.
● In a multi-tape Turing machine, since it can copy and compare in parallel using different tapes, the time complexity is
reduced to O(n)O(n)O(n).

Conclusion
Problem Single-Tape TM Multi-Tape TM

ww O(n2) O(n)

ww' O(n2) O(n)

Thus, a multi-tape Turing machine is significantly more efficient for identifying both ww and ww' compared to a single-tape
Turing machine.

The slide explains two key topics in computational theory:

1. Complexity of Turing Machines (TM):

● Deterministic Turing Machine (DTM):


○ Focuses on the "best setup" (single or multi-tape configuration).
○ Emphasizes the worst-case number of transitions, which is used to determine the complexity of a problem
being solved by the machine.
● Non-Deterministic Turing Machine (NTM):
○ Illustrated as a tree structure where each path represents a different sequence of transitions.
○ Complexity is analyzed by considering all possible computation paths. The branching causes exponential
growth in the number of paths, leading to:
■ Time complexity: O(2n)O(2^n)O(2n) in the worst case for all branches.
■ Higher computational cost compared to DTM.

2. Complexity Classes and Relation with Recursive and RE Languages:

● Shows a Venn diagram of complexity classes:


○ R (Recursive): Problems that can be solved and verified by a DTM.
○ RE (Recursively Enumerable): Problems where solutions can be verified by a DTM, but not necessarily
solved in all cases.
○ Indicates the relationships between these classes:
■ Recursive is a subset of Recursively Enumerable (RE).
■ Points to the inclusion of NP and possibly P within these sets, depending on definitions.

This slide seems to summarize the distinction between deterministic and non-deterministic computation, as well as situating
them within broader computational complexity classes.

The language L={aibjck∣i≠j or j≠k} is context free.

Select one:

True

False
The correct answer is 'True'.
The language L={w∈{a,b}∗∣the number of a is a multiple of the number of b} is context free.

Select one:

True

False
The correct answer is 'False'.
The language L={ambncp∣m,n,p≥0 and m=n or n=p} is context free.

Select one:

True

False
The correct answer is 'True'.
The language L={aibjck∣i,j,k≥0 and i=j+k} is context free.

Select one:
True

False

The correct answer is 'True'.

The language L={w∈{a,b}∗∣w=wR}, where wR is the reverse of w, is:

a. Deterministic context-free

b. Regular

c. Non-deterministic context-free

d. Context-sensitive but not context-free

The correct answer is: Non-deterministic context-free

The language L={anbncndn∣n≥0} is context free.

Select one:

True

False
Feedback
The correct answer is 'False'.
Consider a language L={anb2n∣n≥0}. Which of the following statements is true?

Select one:

a. L is context-free but cannot be recognized by a deterministic PDA.

b. L is context-free and can be recognized by a deterministic PDA.

c. L is regular.

d. L is not context-free.
Feedback
Your answer is incorrect.

The correct answer is: L is context-free and can be recognized by a deterministic PDA.
Cook-Levin's Theorem and Its Details

Statement of Cook-Levin's Theorem:

The Cook-Levin theorem states that the Boolean Satisfiability Problem (SAT) is NP-complete. It was the first problem
proven to be NP-complete and serves as a foundation for NP-completeness proofs for other problems.

Key Concepts:

1. Boolean Satisfiability Problem (SAT):


○ Given a Boolean formula in Conjunctive Normal Form (CNF), determine whether there exists an assignment of
truth values to the variables that makes the entire formula true.
2. Decision Version:
○ This version asks: "Can we decide, in polynomial time, whether a given Boolean formula in CNF is satisfiable?"
3. NP and NP-Completeness:
○ NP: The class of decision problems for which a "yes" answer can be verified in polynomial time by a
non-deterministic Turing Machine.
○ NP-Complete: A problem is NP-complete if:
1. It belongs to NP.
2. Every other problem in NP can be reduced to it in polynomial time.

Proof Outline (Cook-Levin's Theorem):

The proof of Cook-Levin’s theorem establishes that SAT is NP-complete by the following steps:

Step 1: Show SAT is in NP:

● A solution to a SAT problem is an assignment of Boolean variables.


● To verify, substitute the values of the variables into the formula and check if it evaluates to true.
● This verification can be done in polynomial time, proving SAT∈NP\text{SAT} \in \text{NP}SAT∈NP.

Step 2: Polynomial Reduction:

● To show SAT is NP-complete, prove that any problem in NP can be transformed into an instance of SAT in
polynomial time.
● Consider any problem in NP solved by a non-deterministic Turing Machine (NTM).
Encoding the NTM into SAT:

1. Configurations:
○ A configuration of the NTM includes:
1. The state of the machine.
2. The position of the head.
3. The tape contents.
○ Represent these using Boolean variables.
2. Encoding Steps:
○ For each step of the NTM's computation:
1. Encode the machine's state using Boolean variables w1,w2,…,wkw_1, w_2, \ldots, w_kw1​,w2​,…,wk​.
2. Encode the tape contents and head position using additional Boolean variables.
3. Encode transitions between configurations using logical constraints.
3. Conjunctive Normal Form (CNF):
○ Transform the logical constraints into CNF formulas.
○ The resulting SAT formula represents the computation of the NTM.
4. Complexity:
○ The size of the SAT formula is polynomial in the size of the original NTM computation.

Reduction Steps in Detail:

● Any decision problem T∈NPT \in NPT∈NP can be reduced to SAT:


1. Reduction: For any input of TTT, construct a SAT formula that is satisfiable if and only if the answer to TTT is
"yes."
2. Verification: Verify the formula is satisfiable in polynomial time.

Conclusion:

● Since SAT is in NP and every problem in NP can be reduced to SAT in polynomial time: SAT∈NP-complete.

This theorem laid the foundation for computational complexity theory by identifying SAT as a universal problem for
NP-completeness proofs.

You might also like