← RGPV CS-501 Theory of Computation November 2023 Solved Paper
Question
Design a DFA accepting binary representations of multiples of 3.
Asked in: CS-501 | November 2023 | 1(b)
Answer
Use residues r0,r1,r2; start and accept r0. On 0,1 respectively: r0→r0,r1; r1→r2,r0; r2→r1,r2. Reading a bit b changes residue to (2r+b) mod 3. Example 110 represents 6 and reaches r0. If empty input is not considered a binary numeral, add a nonaccepting initial state with transitions 0→r0 and 1→r1.
← RGPV CS-501 Theory of Computation November 2023 Solved Paper
Discussion
Ask a question, share your thoughts or report an error.
Sign in to participate in the discussion.
Join the discussion