Why is {a^nb^n | n >= 0} not regular?

前端 未结 5 554
野趣味
野趣味 2020-12-01 14:38

In a CS course I\'m taking there is an example of a language that is not regular:

{a^nb^n | n >= 0}

I can understand that it is not regu

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-01 15:30

    What you're looking for is Pumping lemma for regular languages.

    Here is an example with your exact problem:

    Examples:
    Let L = {ambm | m ≥ 1}.
    Then L is not regular.
    Proof: Let n be as in Pumping Lemma.
    Let w = anbn.
    Let w = xyz be as in Pumping Lemma.
    Thus, xy2z ∈ L, however, xy2z contains more a’s than b’s.

提交回复
热议问题