edited by
12,321 views
26 votes
26 votes

Which of the following regular expressions represent(s) the set of all binary numbers that are divisible by three? Assume that the string $\epsilon$ is divisible by three.

  1. $(0+1(01^*0)^*1)^*$
  2. $(0+11+10(1+00)^*01)^*$
  3. $(0^*(1(01^*0)^*1)^*)^*$
  4. $(0+11+11(1+00)^*00)^*$
edited by

5 Answers

Best answer
16 votes
16 votes

The above is the minimal DFA for the given language.

From the given DFA we can see all options except D are correct.

selected by
7 votes
7 votes
The catch is that if you use numbers with no asterisk in their powers, you will receive a number that is divisible by three.
3 votes
3 votes

After this dfa is constructed, then by state elimination method we will directly get regular expression same as option A →  (0+1(01*0)*1)* and now as per property (a+b)*=(a*b*)* , considering a as 0 and b as 1(01*0)1 we will get option c) (0* (1(01*0)1)*)*  and now for option b and d we will check directly by checking the strings that will be accepted and from that we can observe that 1001(i.e.9) will not be accepted in option d) 

Hence the ans A,B,C

Answer:

Related questions