0% found this document useful (0 votes)
41 views5 pages

TOA Mid - II Question and Answers

Uploaded by

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

TOA Mid - II Question and Answers

Uploaded by

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

1) With a neat sketch explain Push Down Automata, formal definition.

Pushdown Automata(PDA)

o Pushdown automata is a way to implement a CFG in the same way we design DFA for a
regular grammar. A DFA can remember a finite amount of information, but a PDA can
remember an infinite amount of information.

o Pushdown automata is simply an NFA augmented with an "external stack memory". The
addition of stack is used to provide a last-in-first-out memory management capability to
Pushdown automata. Pushdown automata can store an unbounded amount of information on
the stack. It can access a limited amount of information on the stack. A PDA can push an
element onto the top of the stack and pop off an element from the top of the stack. To read an
element into the stack, the top elements must be popped off and are lost.

o A PDA is more powerful than FA. Any language which can be acceptable by FA can also
be acceptable by PDA. PDA also accepts a class of language which even cannot be accepted
by FA. Thus PDA is much more superior to FA.

Formal definition of PDA:

The PDA can be defined as a collection of 7 components:

Q: the finite set of states


∑: the input set

Γ: a stack symbol which can be pushed and popped from the stack

q0: the initial state

Z: a start symbol which is in Γ.

F: a set of final states

δ: mapping function which is used for moving from current state to next state.

1) Design a Pushdown Automata for accepting a language L={anbn|n>=1}.

NOTE Go through this link for this question and prepare notes on your own

https://www.youtube.com/watch?v=NEhCALWlfLY

2) A) Explain the steps to Convert Context Free grammar to Push Down


automata that accepts the same language
S->0S1|A
A->1A0|S|€
b) Explain about Pumping lemma for context free grammar.
Here's a high-level process for using the Pumping Lemma to prove that a language is not
contextfree:

1. Assume that the language is context-free and that it satisfies the Pumping Lemma.

2. Choose a string s in the language that is longer than the pumping length p.

3. Divide the string s into three parts, uvw, according to the Pumping Lemma conditions.

4. Choose an i and create the string uv^iw.

5. Show that uv^iw is not in the language, which would be a contradiction.

If you successfully demonstrate this contradiction for any choice of u, v, w, and i, you can
conclude that the language is not context-free. However, if you can't find a contradiction for any
choice, it doesn't prove that the language is context-free; it only shows that the Pumping Lemma
doesn't provide evidence that it's not context-free.

It's important to note that using the Pumping Lemma for Context-Free Languages can be a
challenging process, and it doesn't work for all languages. Some non-context-free languages
might not satisfy the Pumping Lemma, while others might require more advanced techniques for
their proof.

3) What is Turing Machine? Explain its features and formal definition


Turing machine was invented in 1936 by Alan Turing. It is an accepting device which accepts
Recursive Enumerable Language generated by type 0 grammar.

There are various features of the Turing machine:

1. It has an external memory which remembers arbitrary long sequence of input.

2. It has unlimited memory capability.

3. The model has a facility by which the input at left or right on the tape can be read easily.

4. The machine can produce a certain output based on its input. Sometimes it may be required
that the same input has to be used to generate the output. So in this machine, the distinction
between input and output has been removed. Thus a common set of alphabets can be used for the
Turing machine.

Formal definition of Turing machine

A Turing machine can be defined as a collection of 7 components:


Q: the finite set of states

∑: the finite set of input symbols

T: the tape symbol

q0: the initial state

F: a set of final states

B: a blank symbol used as a end marker for input

δ: a transition or mapping function

The mapping function shows the mapping from states of finite automata and input symbol on the
tape to the next states, external symbols and the direction for moving the tape head. This is
known as a triple or a program for turing machine.

1. (q0, a) → (q1, A, R)

That means in q0 state, if we read symbol 'a' then it will go to state q1, replaced a by X and move
ahead right(R stands for right).

q) Construct TM for the language L ={0n1 n } where n>=1.


Follow the below link for this question

https://www.youtube.com/watch?v=7yBBv5rA-XM

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy