Question

In: Computer Science

Define a PDA that accepts language L3 = { anbm | n > 0 and n...

Define a PDA that accepts language L3 = { anbm | n > 0 and n > m }.

Implement that PDA in JFLAP. Must use JFLAP

Solutions

Expert Solution

The strings accepted by the given language are as follows:-

L3 = {a, aa, aaa, ......, aab, aaab, aaaab, ......, aaabb, aaaabb, aaaaabb,......}

The PDA for the given language L3={anbm | n>0 and n>m} is as follows:-

First we push all the a's into the stack, then for every 'b' pop the 'a' from the stack, when all the 'b' gets readed then on reading if the top of the stack is a then go to the state q2 by accepting the string, otherwise not. also afte reading all the a's if their is no 'b' present then also go to the state q2 by accepting the string.

Let us take an input string "aaaabb" to check whether the above PDA works or not.

Present state Input Stack top symbol Operation Next state
q0 a z push q0
q0 a a push q0
q0 a a push q0
q0 a a push q0
q0 b a pop q1
q1 b a pop q1
q1 a read q2

Since all the b's get exhausted and the stack still have a's therefore, reach to final state q2 by accepting the string.

--------------------------------------------------

Please give me a UPVOTE. Thank you :)


Related Solutions

Construct a pda that accepts the language defined by the grammar S → aSSSab | λ...
Construct a pda that accepts the language defined by the grammar S → aSSSab | λ . This has already been answered using software with no explanation. I am not interested in the answer so much. I just want an explanation. or at least a step by step formula.
Define a Turing machine TM3 that decides language L3 = { w | w ∈ Σ*,...
Define a Turing machine TM3 that decides language L3 = { w | w ∈ Σ*, #a(w) = #b(w) } over the alphabet Σ = {a, b}. IMPLEMENT USING JFLAP NO PAPER SOLUTION
Let INFINITE PDA = {<M>|M is a PDA and L(M) is an infinite language}. Show that...
Let INFINITE PDA = {<M>|M is a PDA and L(M) is an infinite language}. Show that INFINITE PDA is decidable.
Prove  {0n1n, n≥0} is a computable language
Prove  {0n1n, n≥0} is a computable language
Given the following Scheme definition: (define x '(define (fac n) (if (= n 0) 1 (*...
Given the following Scheme definition: (define x '(define (fac n) (if (= n 0) 1 (* n (fac (- n 1)))))) (This does not define the factorial function fac, but the variable x.) Write Scheme expressions in terms of x that would have the effect of extracting the following expressions: (fac n) 0 (- n 1) The second occurrence of fac. The last occurrence of n. E.g., the expression (car x) would extract define.
give a PDA for the language {a1a2: where the length of a1 equals the length of...
give a PDA for the language {a1a2: where the length of a1 equals the length of a2, a1 contains an odd amount of 0’s and a2 contains an odd amount of 0′s} a1, a2 ∈ {0, 1}*
Construct an NPDA that accepts the language defined by the given grammar and give the language...
Construct an NPDA that accepts the language defined by the given grammar and give the language in a formal expression (including a regular expression). S -> AA|a, A-> SA|ab
Give a CFG and (natural) PDA for the language { ai bj ck ef: i +...
Give a CFG and (natural) PDA for the language { ai bj ck ef: i + j = k + f, i, j, k, f ≥ 0 }
Using the pumping lemma for regular languages, show that language is not regular. b) L3= {0n...
Using the pumping lemma for regular languages, show that language is not regular. b) L3= {0n 1m, m = n+2 } Language= {0,1}
Draw PDA transition diagram for the following language: The set of strings over the alphabet {x,...
Draw PDA transition diagram for the following language: The set of strings over the alphabet {x, y} where 2 * (# of x's) = 3 * (#y's) That is, if we let nx be the number of x's and ny be the number of y's, then the strings in these language are those where 2nx = 3ny Try to find a PDA that is as simple and elegant as possible (do not convert from CFG). ------------------------------------------------------------------------------------------------------------------ USE Notation between transition:...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT