-2

are a*b* and (ab)* the same language? I am trying to make nfa for a*b*

einpoklum
  • 118,144
  • 57
  • 340
  • 684

2 Answers2

2

These two regular expressions define different languages.

a*b* matches any number of repetitions (including zero) of a followed by any number of repetitions (including zero) of b. For example aaabb.

(ab)* matches any number of repetitions (including zero) of the ab sequence, for example abab.

The empty string and ab are the only two words that match both regular expressions.

axiac
  • 68,258
  • 9
  • 99
  • 134
-1

a*b* is the same of (a+b)* but not the (ab)*

Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92