Lightsong
Lightsong

Reputation: 345

Finding a grammar or a pushdown automaton that recognizes { a^i b^j b^i a^j | i,j >= 0 }

I am trying to find either a grammar or a pushdown automaton that recognizes the following language:

{ ai bj bi aj | i,j >= 0 }

Of all the examples that I have seen, I cannot wrap my head around this one!

I first tried using a grammar for it as I think this may be easier recursively, and then a pushdown automaton, with no luck. I don't know what to do with the bj in-between ai and bi.

Upvotes: 0

Views: 568

Answers (1)

rici
rici

Reputation: 241881

Just as i + j = j + i, bibj = bjbi. In other words, two b's are indistinguishable from each other.

Perhaps you will find it easier to see the grammar for { aibibjaj | i,j ≥ 0 }

Upvotes: 2

Related Questions