regex - Find the regular expression for the language on E={a,b} -


l = w : (na(w) - nb(w)) mod 3 /= 0

how can go finding regular expression language?

i understand means number of minus number of bs cannot multiple of 3. - b cannot 3,6,9,12, etc.

but still having trouble putting regular expression. tried first making dfa or nfa couldn't either.

any appreciated!

i go dividing list of words on {a,b} 3 cases:

  • l1 = w : (na(w) - nb(w)) mod 3 = 1
  • l2 = w : (na(w) - nb(w)) mod 3 = 2
  • l3 = w : (na(w) - nb(w)) mod 3 = 3

l l1 u l2, , should able create expressions relating l1, l2, , l3. should able eliminate things , end regular expression on {a,b}.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -