Back to the 2022 paper

Module 1: Introduction & Regular Languages

20222m

The minimum number of states required to recognize an octal number divisible by 3 is:

(i) 1
(ii) 3
(iii) 5
(iv) 7

Worked SolutionAI Assisted

Answer

Correct Option: (ii) 3

Explanation

To check divisibility by 33, we only need the remainder modulo 3 of the number. Whether the input is binary, decimal, or octal does not change the number of remainders.

For modulus 33, there are exactly 33 possible remainders:

  • r=0r = 0 → number divisible by 3 (accepting state)
  • r=1r = 1 → remainder 1
  • r=2r = 2 → remainder 2

DFA Construction for Octal Alphabet

  • Alphabet: Σ={0,1,2,3,4,5,6,7}\Sigma = \{0,1,2,3,4,5,6,7\}
  • States: q0,q1,q2q_0, q_1, q_2 representing remainder 0,1,20,1,2
  • Start state: q0q_0 (value 0)
  • Accepting state: q0q_0
  • Transition: On reading octal digit dd from state qrq_r,
    δ(qr,d)=q(r×8+d) mod 3 \delta(q_r, d) = q_{(r \times 8 + d) \bmod 3}
    Since 8≡2(mod3)8 \equiv 2 \pmod 3, this simplifies to q(2r+d) mod 3q_{(2r + d) \bmod 3}.

This DFA is complete and minimal – each remainder is distinguishable (Myhill-Nerode equivalence).

Why other options are wrong

  • (i) 1 state: would accept all or no strings, cannot distinguish remainders.
  • (iii) 5 and (iv) 7: unnecessary extra states; ⌈log⁡23⌉\lceil \log_2 3 \rceil is not relevant.

Final Answer

Minimum number of states = 3 (one per residue class mod 3).

Similar questions

Free AppAndroid App

Coursify Android App

Generate AI courses, take quick quizzes between classes, and master complex engineering concepts on the go.