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.
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
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:...
Show that the language ?={?^??^??^?:?≥0,?≥0}is not regular.
Show that the language ?={?^??^??^?:?≥0,?≥0}is not regular.
JAVA Language: Write a program that prompts the user to enter a positive integer n (0...
JAVA Language: Write a program that prompts the user to enter a positive integer n (0 up to 232 -1). You must write a function that takes as input n and returns a string s representing the number n in binary. For this assignment, you must use the method of successive division by 2 to convert the number to binary. Your main program must print out s. Example: If the user enters the number 66, your program must print out...
Consider the following languages over {0, 1}: L3 = {w : does not begin and end...
Consider the following languages over {0, 1}: L3 = {w : does not begin and end with same symbol and |w| £ 3} L4 = {w : w = wR, |w| £ 3} Enumerate the first 8 strings in the L-ordering of the following: L3 L4 L3 – L4 L4 – L3 L3L4 L4L3 L33 L4*
Write a program in python language, which accepts 2 numbers and a + sign (for addition)...
Write a program in python language, which accepts 2 numbers and a + sign (for addition) A sign - (for subtraction) A sign * (for multiplication), / (for division) Then calculate and to display the result of the operation he chose with the two numbers. Displaying the appropriate message
R programming language A) Create a function that accepts two arguments, an integer and a vector...
R programming language A) Create a function that accepts two arguments, an integer and a vector of integers. It returns the count of the number of occurrences of the integer in the input vector. 1]Input: num_count <-function ??? 2]Input: num_count(2,c(1,1,2,2,3,3)) 2] Output: 2 3] Input: num_count(1,c(1,1,2,2,3,1,4,5,5,2,2,1,3)) 3] Output : 4 B) Create a function that accepts 3 integer values and returns their sum. However, if an integer value is evenly divisible by 3, then it does not count towards the...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT