2

I have an odd PDA problem that I cant seem to construct. I haven't come across one like this before.

$L = \{w\in\{a,b\}^{*} : 3\#_{a}(w) \leq 5\#_{b}(w) \leq 4\#_{a}(w)\}$

Could I get some pointers on how to tackle such a problem like this so I can be more familiar with the approaches here.

  • $3n_a(w)$ means the number of $a$'s in the string? I saw a different notation, where # means the number of characters, e.g. 3#a $\le$ 5#b. – Evil Oct 29 '16 at 02:07
  • Yes you are correct. – James Combs Oct 29 '16 at 02:07
  • I cant seem to find a pattern that always works. Much less turn this into a grammar to construct a PDA from. In order to initially satisfy the constraints, there must either be 0 $a$'s and $b$'s or at least 3 $a$'s and 2 $b$'s. But then afterwards, I cant find a steady pattern. – James Combs Oct 29 '16 at 02:16
  • it looks like a pattern emerges. once you have 3 $a$'s and 2 $b$'s, increases both by 1 works until you have 5 $a$'s. Then you must increase the $a$'s by 2 before you increase the $b$'s by 1. Then increase both by 1 again until reaching 10 $a$'s. At which point you increase the $a$'s by 2 before increasing the $b$'s by 1 again. Im not sure if it continues this way. Not enough room to try more lol. – James Combs Oct 29 '16 at 02:25
  • I have spent too much time on this haha. Moving on – James Combs Oct 29 '16 at 02:59
  • http://cs.stackexchange.com/q/18524/755 – D.W. Oct 29 '16 at 04:18

1 Answers1

1

It's your exercise, so you should solve it yourself... but I will give you two hints.

  1. Study the methods used in Grammar for a language with 1/3 of a's. They are helpful.

  2. Use non-determinism. Build a non-deterministic PDA. (How do you think non-determinism might help here?)

D.W.
  • 159,275
  • 20
  • 227
  • 470