I was following this video, and wonder why {anbn | n≥1} is not a regular language?
Asked
Active
Viewed 155 times
0
-
This is probably a better fit on [cs.se] – Apr 06 '15 at 19:46
-
You are confused if you think that the diagram you show recognizes a^nb^n – Pascal Cuoq Apr 06 '15 at 19:51
-
sorry...my bad. I will close it now.. – Blake Apr 06 '15 at 19:51
-
@Blake After two fellow StackOverflow users have spent time answering? How unneighborly! – Pascal Cuoq Apr 06 '15 at 19:52
-
@PascalCuoq that is to avoid more users spending time reading my mistake – Blake Apr 06 '15 at 19:55
-
@Blake read [What is basically a regular language? And why an infinite language `a*b*` is regular whereas languages like `{ anbn | n > 0 }` are not regular](http://stackoverflow.com/questions/16723185/is-ab-regular/16730707#16730707) – Grijesh Chauhan Apr 07 '15 at 11:53
-
1Why not accept one of the answers; this will save more users from answering also.... – Brian Tompsett - 汤莱恩 May 20 '15 at 13:25
2 Answers
0
Regular language must be recognized by finite automaton. As n
is not bounded by any constant the automaton cannot be finite.

Grzegorz Żur
- 47,257
- 14
- 109
- 105
0
If you take the definition of “regular language” as “recognized by a finite automaton”, let m be the number of states of such an automaton. If the automaton is to recognize a1b1, a2b2, …, am+1bm+1, the states of the automaton cannot be the same after it has read a1, a2, …, am+1, leading to a contradiction.

Pascal Cuoq
- 79,187
- 7
- 161
- 281