• edited by
28,320 views
71 71 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)^*$

9 Answers

Best answer
40 40 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
37 37 votes

 if you like the soln pls upvote :)

7 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.
7 7 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

4 4 votes

All string Div by 3={epsilon,0,11,110,1001,1100,1111.....}

Option A : it generates all binary string which div by 3 and also generate epsilon.

Option B: it generates all binary string which div by 3 and also generate epsilon.

Option C: Option A and Option C are same.

Option D: Option D is not generate 1001 which is div by 3 then this is wrong.

Answer is Option A,B,C.

Answer:
Position:
Show:

Related questions

47 47 votes
3 answers 3 answers
16.8k
16.8k views
Arjun asked Feb 18, 2021
16,824 views
For a string $w$, we define $w^R$ to be the reverse of $w$. For example, if $w=01101$ then $w^R=10110$.Which of the following languages is/are context-free?$\{ wxw^Rx^R \...
45 45 votes
3 answers 3 answers
21.8k
21.8k views
Arjun asked Feb 18, 2021
21,833 views
Let $L_1$ be a regular language and $L_2$ be a context-free language. Which of the following languages is/are context-free?$L_1 \cap \overline{L_2}$$\overline{\overline{L...
46 46 votes
3 answers 3 answers
16.6k
16.6k views
Arjun asked Feb 18, 2021
16,562 views
Suppose the following functional dependencies hold on a relation $U$ with attributes $P,Q,R,S$, and $T$:$P \rightarrow QR$$RS \rightarrow T$Which of the following functio...
72 72 votes
5 answers 5 answers
24.7k
24.7k views
Arjun asked Feb 18, 2021
24,702 views
​​​​​​Consider the following multi-threaded code segment (in a mix of C and pseudo-code), invoked by two processes $P_1$ and $P_2$, and each of the processes spawns two t...