0
$\begingroup$

I have to construct a pushdown automaton for the following language over alphabet {a,b,c}:

L={ ucv | |u|!=|v|; u,v={a,b}* }

(note: u,v are substrings over alphabet {a,b}, |u| is length of substring u)

My tutor has constructed a PDA using 4 states, however - I believe it's possible to construct this with only 3. Here's what I came up with:

enter image description here

Legend: QO = initial state, QF = final/accepting state. Directed edges are named after transitions in the following form

input_character, highest_element_in_stack | new_highest_element(s)_in_stack

The basic idea behind it is:

QO counts the number of characters in substring u by pushing x's.

Q1 counts the number of characters in substring v by popping x's.

Is my PDA correct or is it missing something crucial that I haven't noticed?

Thank you in advance.

$\endgroup$
  • 1
    $\begingroup$ You can do it using only one state... Questions that require confirmation of given excersise are not in the scope of this site. The "minimal PDA" is not a valid term. $\endgroup$ – Evil Feb 5 '17 at 0:35
  • 1
    $\begingroup$ We discourage "please check whether my answer is correct" questions, as only "yes/no" answers are possible, which won't help you or future visitors. See here and here. Can you edit your post to ask about a specific conceptual issue you're uncertain about? As a rule of thumb, a good conceptual question should be useful even to someone who isn't looking at the problem you happen to be working on. If you just need someone to check your work, you might seek out a friend, classmate, or teacher. $\endgroup$ – D.W. Feb 5 '17 at 1:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.