-1

What is the language expressed by these expressions and why aren't they equal?

Wiktor Stribiżew
  • 484,719
  • 26
  • 302
  • 397

1 Answers1

3

L1 = (ab)* stands for ab repeated 0 or more times.
L2 = a*b* stands for a repeated 0 or more times followed by b repeated 0 or more times.

Those languages aren't equal because word abab is in language L1 but it's not in language L2.
Those languages aren't equal because word a is in language L2 but it's not in language L1.

There is a very useful service web service used for comparing regular expressions. Once you type in the regular expression, it describes it and let's you test it.

Examples of words in those languages:

L1:

  • ""
  • "ab"
  • "abab"
  • "ababab"

L2:

  • ""
  • "a"
  • "aa"
  • "bbbb"
  • "ab"
  • "aaaabbbbbbb"
xenteros
  • 14,275
  • 12
  • 47
  • 81