-1

I am trying to convert the follow language

$$L = \{0^m1^n \ | \ 0 \le m \le n \le 2m\}$$

We have an exam in 2 days and the professor didn't teach us much about PDA's. They will be on the test though and I am freaking out because I have no idea how to do them. Could anyone give me a hint or get me started on this example?

Banach Tarski
  • 1,208
  • 9
  • 20
bob afro
  • 117
  • 1
  • 7

1 Answers1

1

If you've seen nondeterministic PDAs then this is a fairly easy construction. The key idea here is that for every string in your language, each $0$ must be matched with either a single $1$ or two $1$s, so when reading the input, nondeterministically place one or two markers on the stack for each $0$ seen. Then, for every $1$ seen, pop a marker off the stack and accept if the stack is empty after processing all the characters in the string. If the input is in your language, there will be at least one sequence of moves that will leave you in the final state, which is all you need.

Rick Decker
  • 15,016
  • 5
  • 43
  • 54