0% found this document useful (0 votes)
44 views8 pages

ATLC CIE 2

Guru

Uploaded by

Definite Time
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)
44 views8 pages

ATLC CIE 2

Guru

Uploaded by

Definite Time
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/ 8

4. List out, in how many ways, PDA can be accepted ?

ANS-A pushdown automaton (PDA) can accept a string in three ways:


By empty stack
The PDA accepts the string when its stack is empty after reading the entire string.
By final state
The PDA accepts a string when it reaches its final state after completely reading the string.

By both empty stack and accepting state


This is the most preferred method because it leaves little room for ambiguity.

5. Write any four applications of PDA.

ANS

1.Context-Free Languages: PDAs are used to define and analyze context-free languages,
which are more expressive than regular languages. Context-free grammars and languages are
crucial in syntax analysis for programming language.

2.Parsing: PDAsplay a vital role in parsing algorithms for context-free grammars.They can
recognize whether a given input string adheres to a specific grammar and generate a valid parse
tree.

3.Compiler Design: PDAs are used in syntax analysis during the compilation process to
determine the structure of the source code based on a context-free grammar.

4.Natural Language Processing: Context-free grammars and PDAs are utilized in natural
language processing for tasks such as syntax parsing and generating sentence structures.

6.What is Instantaneous Description of a PDA ?


ANS - An instantaneous description (ID)of a pushdown automaton (PDA) is a triple that
describes the current state of the PDA, the remaining input, and the contents of the stack:
q: The current state
w: The remaining input string
s: The contents of the stack, with the topmost symbol written first
UNIT-5 (ATLC)
TURING MACHINE

1.Differentiate Recursive and Recursively Enumerable Language?

ANS: A recursive language (also called a decidable language) is a type of formal language
that can be decided by a Turing machine.A language L is recursive if there exists a Turing
machine M such that:

M accepts any string in L.


M rejects any string not in L.
M always halts (terminates) on every input.
A recursively enumerable language (also called recognizable language) is a broader class
than recursive languages. It can be recognized by a Turing machine but not necessarily
decided.A language L is RE if there exists a Turing machine Msuch that:
M accepts any string in L.
Meither rejects or loops forever for strings not in L.
2. What is a Counter Machine?

ANS: A Counter Machine is a simplificd computational model used in automata theory and
formal languages to study the capabilities of computation. It is a type of register machine that
uses a finite set of counters to store and manipulate non-negative integers.
3. List the extensions to the basic Turing Machine.

ANS:

1.Multi-tape Turing Machine:


It has multiple tapes and is controlled by a single head.
The Multi-tape Turing machine is different from k-track Turing machine but expressive
power is the same.
Multi-tape Turing machine can be simulated by single-tape Turing machine.
2.Multi-Track Turing Machine

A single tape is divided into multiple tracks, where each track holds a separate symbol.
Asingle head reads/writes across all tracks simultaneously.
Useful for simulating multiple tapes within a single tape structure.
Equivalent to a single-tape Turing machine.

3.Non-Deterministic Turing Machine (NDTM)

Can make multiple choices at any point during computation.


Explores all branches simultaneously (conceptually) and accepts if any branch leads to
an accepting state.
Models nondeterministic algorithms and aids in complexity theory (e.g., P vs NP
problem).
Equivalent to a deterministic Turing machine in terms of computational power, but may
be exponentially faster in some cases.
4. Universal Turing Machine (UTM)

Simulates any other Turing machine by reading its description (encoded as input).
Proves the concept of programmability and serves as a foundation for modern computers.
Computationally equivalent to other Turing machines, but demonstrates the idea of a
general-purpose computer.
|m-1
be
he Language oill àaa bbbbbb - 3
aabbbb,
L= abb,
Lalalblb
Lala
let he sA ing isQenioush bl el 6nto
we have
to Ohe more
for singte
stack)
80 the tansitin funcion is

a , a) = (2%,aa an) STACK


6 (0, 4
8(o, by, ) = (4, 6)
6 (9, b, a) =(,,)
&(,, é, zo) =(23,)
have to change
the trte

for the first b the remainin


we
stack toy
and pop the a from the
the state
need to Change
fop cperati on not

Trancrtion diag am b,ale


a,zolaazo
b, ale (2
a,a<aaaa
when ue StacK ts emnply then we Kno w tuat
Si is actepted
PDA thoct
uConverd the folousing CfG 4o a
CFG
ateepts he language by enply Stack
S > a Sa b Sbl c
Soludion - The contert fvee Girammar detined fhe
4 tuples 61 - (v, T, P, 5) ohere
V Set of Va iables O8 men- terminals, T= set of tesminals
gmbols S= Start ymbo, P= Produebon Reule.
Here in the
-the Aiven granma y

from Rule l. foY tNon - terrrinal ifA , then.


foy Non
-termimals ,tan stion funchon will be,
S( e, s) =(2, aSa)
&(9, 6,s) = (2, 6SE) Rule
$(9, é ) = (9, c)

(12
toy ey minal mbo, transitian hunchon ul be

6l4, a, )- (9,)
82,b, b) - (3,) Rule 2
612, , )= (9,6)
bampl2 : Design a Tiing mathine ohich regngas
language L . Obtnin computatóy
Sq uence M jor pncuating input shmng
00||

(B,B,L)
-(0,0,R)

(Ö,01)
booIb o,x, R) (o,0, R)
bxoiib
2

(o,0,bOt
(89,8)
bayyb3bayb
page8
talting oblem o Tusiug Mochine -
Tnput : A Tusing machine aud an yp string w.
poblem: Does the tiung machine tinish
buite nunber o}computig
stey?
The augwer mst be eitkes yes or no

At bist ,we ol assme tat such a Tisig


machne exists to solre tis problem audten
boe uotll sloo t is cowtraclchiug telk. We
uotll coll tis Tut ong machne as a taltiug
machne that podutus yes' or no iy a

I the haltug machine hiniskes in a


amount tine,the output comes a húib
otaroise a no'
- Tae bollouoing
Halliag madune
Yes(Hm halts on yp u)
Machine ’No thM doesuot halt

- Nouo we oll desigy an inventd haltiug machine


CttM) as
L I7 HM vetuans yES, en
loop boreve.
-The
bTHM vetuns NO,ten halt -g
bollooia (s tte block diagran of
haltiug machne inead

Haltiug.
macin No
Here, uoe have got a coutadcon Heuce, e
Lalting Proam
s protNe hot usith tuo lists
%= (ol,I,), 8= (o, to,) hoo no
Solution.
6otuion foy each

1 1

10

Heuee the
Siring uerated an
Subotrtnge of is shorter

Cae Hhare is soluion

said that tis post Correpondee


Neuee H Can be
Proem is Lndecdlale.
cOnstruef the turing machi na for te

Solutian - X y y yh 2 z 2
X X

Trancrhon- Diagram (arai)


(Y,
Y,R) (21Z,R) (YY)
(aiaR)
Syr
Direchn (z,2,L)
Rea Cb;y, 8) (C,Z,)
ta,x, R)

(,y,8))

(ze6)d,oddnj
(6,6,)

Transion- Table,
Tape Symbols. B
Cstate C X
b

a4,8)| (b, ,)
6,b,)(2,)
Aabbi) ,)(2.26,8

You might also like