0

I understand that regular languages are languages which can be computed by Finite Automata however i am having some trouble understanding how one can identify a regular from non-regular.

I know that 0*1* is regular because the machine just needs to make sure the 0s and 1s are in order

I know that 0^n 1^nis non regular because the machine needs to keep count to make sure there is an equal number of 0s and 1s

But why is (01)^n considered regular? Doesn't the machine have to keep track to make sure that there are n amount of 01?

How about {0^m 1^n | n>m}?

What is the general rule for quickly figuring out if something is regular or not in layman terms?

mali30
  • 1
  • 2
    Why would you expect that there is a "quick" general rule. The only general rule is to apply the definition of a regular language or one of the several statements equivalent to it. In general, knowing whether some arbitrary set theoretic expression corresponds to a regular language can be arbitrarily complicated, e.g. ${0\mid RH}\cup{0^n1^n\mid n\in\mathbb N\land \neg RH}$ where $RH$ stands for the Riemann Hypothesis is regular if $RH$ is provable and not if it's refutable. – Derek Elkins left SE May 12 '19 at 18:28
  • 2
    You don't need to count anything to decide ${(01)^n\ |\ n\geq 0}$, all you need is to remember whether the last symbol you saw was a $0$ or a $1$. Remembering $n$ is not needed to check whether the next symbol is OK. – chi May 12 '19 at 19:43
  • 1
    With practice such simple examples will become obvious. – Yuval Filmus May 13 '19 at 07:50

1 Answers1

0

the way to test if something is non regular is to use the pumping lemma for regular languages. It can prove that a language is non regular, but it will not necessarily prove that a language is regular. To prove that some language is regular, you can create a finite automata for that language.

  • 1
    You can’t prove that a language is regular using the pumping lemma, since not all languages satisfying its conditions are regular. – Yuval Filmus May 13 '19 at 05:13