Question

Show a pushdown machine that will accept each of the following language {anbmcmdn}m, n > 0

Show a pushdown machine that will accept each of the following language

{anbmcmdn}m, n > 0

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Explanation:

I flow 4 Scenario While Drawing the pushdown machine They are

3 for {anbmcmdn}m, n > 0

Final Scenario is for {anbmcmdn}m, n >= 0

  • Scenario-1: m = 0 – In this Scenario, the input language will be of the form {ancn}. In this Scenario, keep on push a’s into the stack until we encounter with c. On receiving c check if the top of the stack is a, then pop it (a) from the stack. Pop a’s until all the c's of the input string are processed. If we reach to the end of the input string and stack becomes empty, then reach to final state i.e. accept the input string else move to the dead state.
  • Scenario-2: n = 0 – In this Scenario, the input string will be of the form {bmcm }.In this Scenario, keep on push b’s into the stack until we encounter with c. On receiving c check if the top of the stack is b, then pop it (b) from the stack. Keep on pop b’s until all the c’s of the input string are processed. If we reach to the end of the input string and stack becomes empty, then reach to final state i.e. accept the input string else move to the dead state.
  • Scenario-3: m, n>0 – In this Scenario the input string will be of the form {anbmcmdn }. In this Scenario, keep on push a’s and b's into the stack until we encounter with c. On receiving c check if the top of the stack is b, then pop it (b) from the stack. Keep on pop b’s until all the c’s of the input string are processed. Then on receiving d check if the top of the stack is a, then pop it (a) from the stack. Pop a’s until all the d’s of the input string are processed. If we reach to the end of input string and stack becomes empty, then reach to final state i.e. accept the input string else move to dead state.

This case for {anbmcmdn}m, n >= 0 if you not requred eleminate it.

  • Scenario-4: m = 0, n = 0 – In this case the input string will be empty. Therefore directly jump to the final state.
Add a comment
Know the answer?
Add Answer to:
Show a pushdown machine that will accept each of the following language {anbmcmdn}m, n > 0
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT