Give a state diagram for an NFA whose language L = ...

298 Views Asked by At

L = {w ∈ {0,1,2} *: w is a ternary representation of an integer that is a multiple of 3 but not a multiple of 9}

I've written a DFA accepting multiples of 3, but I'm not sure how I should proceed. Any help would be very much appreciated, thank you.

enter image description here

1

There are 1 best solutions below

0
On

Since you are asking for a NFA, and taking into account the comments by Wuestenfux and Peter Leupold, three states should suffice:

Note that there are three initial states in this automaton.