问题
I am wondering are all infinite languages undecidable?
They must be right, as the TM trying to decide an infinite language would just loop forever, which makes it a recgonizer, not a decider.
Thanks guys.
回答1:
No, there are many infinite languages that are decidable. One trivial example is the language {n € N | a^n}
, i.e. the language of words that only contain the letter "a". This language can be matched by the regular expression a*
. so it is a regular language and thus decidable.
回答2:
As sepp2k points out, a*
is a regular language, hence decidable.
All finite languages are regular. Some infinite languages are regular. Only infinite languages can be undecidable.
To be undecidable, there must be individual strings in the language that cause the TM to fail. Indeed, there must be infinitely many such strings (otherwise, the poorly behaved ones could be handled by special-case logic).
That a language be infinite is therefore necessary, but not sufficient, for undecidability.
来源:https://stackoverflow.com/questions/14857316/are-all-infinite-languages-undecidable