TOA Mid - II Question and Answers
TOA Mid - II Question and Answers
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.
Γ: a stack symbol which can be pushed and popped from the stack
δ: mapping function which is used for moving from current state to next state.
NOTE Go through this link for this question and prepare notes on your own
https://www.youtube.com/watch?v=NEhCALWlfLY
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.
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. 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.
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).
https://www.youtube.com/watch?v=7yBBv5rA-XM