Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In JFLAP, the PDA will need to be able to handle input strings of length up to about 80 symbols using at most 4GB of
In JFLAP, the PDA will need to be able to handle input strings of length up to about 80 symbols using at most 4GB of memory.
Construct a PDA that accepts {a=ba,b in {x,y} such that a=b and ai=bi for some i,1imin(a,b)} For your PDA to work correctly it will need to be non-deterministic. You can assume that you will always be given a valid string - that is, the input will always contain one \# and a and b will be strings over {x,y}. My PDA has 31 states and and is broken into two major sections, one for a=b and one for a=b. For the case where we assume that a=b, you need to find a symbol that matches at the same index of a and b(ai=bi for some i) and a symbol that does not match at the same index of a and b(aj=bj for some j). One way that this can be accomplished is by finding an index i such that ai=bi and ai+1=bi+1 or ai+1=bi+1 and ai=bi. As in programming assignment 3 , you can store the index in the stack and the values of ai and ai+1 in the state. For the case where we assume that a=b, you need to find an index i where ai=bi. Since the lengths are different, we get that a=b without finding an index j in which aj=bj. For this case, you can simply check that a1=b1. If a1=b1, then the other portion of the code (where we assume that a=b ) will accept the stringStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started