Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Can someone help me construct a pushdown automaton to recognize the following regular expression representing the language $(a^3+a^5)$* using as few states as possible? How can this be done using a stack?

share|improve this question
    
Is that a regular expression for the language? –  Dustan Levenstein May 30 '12 at 12:08
    
Yes, thank you! –  Jack Kobil May 30 '12 at 12:08
3  
You can do it with an empty stack ... –  Monoide May 30 '12 at 12:20
1  
I see how this can be done using a finite automaton but not sure how to implement it with a pushdown automaton. –  Jack Kobil May 30 '12 at 12:36
2  
because it's a regular language, you can just write a finite automaton which accepts it, and that is the same as a pushdown automaton which doesn't use the stack. But if you want to minimize the number of states, you have to use the stack. –  Dustan Levenstein May 30 '12 at 12:37
show 5 more comments

2 Answers

You can do it with a single state -- just shove the states of the obvious no-stack finite automaton into the stack alphabet and use the first element of the stack to remember the state. You then never need a stack depth of more than one.

(Of course this is subject to the details of how you formalize PDA's. If your formalization don't allow you to pop a symbol off the stack and push a new one onto it in the same transition, then this construction won't help).

share|improve this answer
add comment

Hint (assuming this might be homework -- please tell us if not) -- think of how you'd recognize, say $(a^k)^*$ for a fixed $k$ (try $k=2, 3, 4 \text{ or } 5$) using a single state and a pushdown store, with acceptance by empty stack. Now, how can you pick $k$ and combine that with a finite-state automaton a having minimal number of states to recognize the language in question?

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.