A simple game to help you understand the pumping lemma for regular languages. (See notes at the bottom of the page.)
Exercise: | Random | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
Here we go: The computer claims that the language L={akbn∣k is even or n is odd} over the alphabet Σ={a,b} is regular. It also claims it can build a finite automaton accepting L using 18 states (or alternatively a regular grammar defining L with 17 nonterminal symbols).
It's your turn now. Please enter a word belonging to L that's at least 18 characters long, then press the "Continue" button.
When you're entering your initial word, you can type something like, say, a5
as a shorthand for aaaaa
. More complicated expressions like (a3b5)2
will also work as expected. Characters other than a
and b
(including whitespace) will simply be ignored.
Note that some of the languages presented here are regular and the computer should always win in these cases. It is part of your task to figure out which are which …
And please also note that above zero is always a natural number and all variables like m or n are implicitly understood to be natural numbers. Finally, wR is the word w reversed.
Copyright (c) 2014–2023, Prof. Dr. Edmund Weitz. Impressum, Datenschutzerklärung