Moore Machine MCQs: 10 Solved Questions on Outputs, States and Patterns

Solve 10 Moore machine questions with fresh explanations based on output rules, transition traces and state invariants. The set includes MCQs, a NAT and short-answer checks.

KnowledgeGate Team

Exam prep & CS education

Updated 26 Aug 20267 min read

Many learners know the definition of a Moore machine but still put output on an edge, forget the initial state's output, or guess a diagram's pattern without tracing its states. This set gives you 10 worked published-bank questions, moving from definitions and output length to suffix detectors, state counting and a Moore-versus-Mealy contrast. Answer each one first, and reveal the explanation only after writing one line of reasoning.

KnowledgeGate has over 10 published questions in Basics & Moore Machine. This collection contains seven MCQs, one NAT and two short-answer checks within CS Fundamentals. For further study, continue with the Basic of Moore vs Mealy Machine lesson.

Moore-machine rules to fix before solving

A Moore machine is a finite-state machine with output function lambda: Q -> Delta. Output belongs to the current state, and the initial state emits before the first input symbol is read. Therefore, an input of length n produces n + 1 output symbols. A Mealy machine instead places output on transitions. The Moore vs Mealy Machines: GATE Conversion and Minimization guide develops that contrast.

Calibrate the rule with states A/0 and B/1, starting at A/0. Let A --0--> A, A --1--> B, B --0--> A, and B --1--> B. On input 10110, the visited states at epsilon, 1, 10, 101, 1011, 10110 are A, B, A, B, B, A. Reading their outputs gives 010110.

The input length is 5 and the output length is 1 + 5 = 6. Omitting the first 0 is the standard error. This one habit separates output-length reasoning from output-value tracing in every later question.

Moore trace for input 10110. Draw start state A/0 and state B/1. Show transitions A on 0 to A, A on 1 to B, B on 0 to A, and B on 1 to B. Under the machine show columns labelled epsilon, 1, 10, 101, 1011, 10110; state row A, B, A, B, B, A; output row 0, 1, 0, 1, 1, 0. Add the exact labels "input length = 5" and "Moore output length = 6 = n + 1".

Moore Machine MCQs 1-3: definition and output length

Question 1

Moore Machine is an application of:

  • (a) Finite automata without input

  • (b) Non- Finite automata with output

  • (c) Finite automata with output

  • (d) None of the mentioned

Answer: (c).

A Moore machine keeps a finite state set and transition function, then maps every state to an output symbol. That is precisely finite automata with output. Option (a) wrongly removes input, option (b) wrongly says non-finite, and option (d) fails because (c) is valid.

Question 2

For a give Moore Machine, Given Input=’101010’, thus the output would be of length:

  • (a) |Input|+1

  • (b) |Input-1|

  • (c) |Input|

  • (d) Cannot be predicted

Answer: (a).

101010 has six symbols. The initial state emits once, then six transitions each reach another output-bearing state. The output length is 1 + 6 = 7. A diagram is needed for the values, but not the count, so (d) is wrong.

Question 3 (Beltron Programmer 2025, Shift-2)

Which of the following statements is correct about the output length in a Moore machine processing an input of length n?

  • (a) Output length = n + 1

  • (b) Output length is always 1

  • (c) Output length = n

  • (d) Output length = n - 1

Answer: (a).

For n inputs, the sequence contains the initial state plus n destination states, giving n + 1 outputs. The calibration trace cross-checks this: n = 5 produced six symbols.

Moore Machine MCQs 4-5: reading a language and a suffix detector

Question 4

Consider a Moore machine M whose digraph is

!Three-state Moore machine diagram over {a,b} tracking the number of b symbols

Then L(M), the language accepted by the machine M, is the set of all strings having :

  • (a) two or more b's

  • (b) three or more b's

  • (c) two or more a's

  • (d) three or more a's

Answer: (a).

Treat the states as thresholds: S0 means zero bs, S1 exactly one, and accepting S2 at least two. Thus aabab traces S0 -> S0 -> S0 -> S1 -> S1 -> S2 and is accepted, while aaaab stops at S1. Equivalently, the language is a*ba*b(a|b)*.

Question 5

Which of the following Moore machines accepts strings ending in "011"?

  • (a) Requires 3 states

  • (b) Requires 4 states

  • (c) Requires 5 states

  • (d) Requires 6 states

Answer: (b).

The four states represent the longest useful suffix: q0 for none, q1 for 0, q2 for 01, and q3 for 011. Input 11011 traces q0 -> q0 -> q0 -> q1 -> q2 -> q3. Three states cannot distinguish these four progress conditions.

Moore Machine MCQs 6-8: derive the output-1 invariant

Question 6

Consider the Moore machine shown below.

!Four-state Moore machine diagram over {a,b} with outputs 0 and 1

Which statement correctly describes when it produces output 1?

  • (a) It outputs 1 whenever the processed prefix ends with ab.

  • (b) It outputs 1 once for every occurrence of ab, provided the input string begins with a.

  • (c) It outputs 1 once for every occurrence of ab, regardless of the first input symbol.

  • (d) It outputs 1 exactly when the input string begins with a and the current (or final) symbol is b.

Answer: (d).

An initial b enters the q3/0 trap, so that case never outputs 1. After an initial a, q1/0 means the current symbol is a; reading b enters q2/1, whose b loop retains 1. Hence abb traces q0 -> q1 -> q2 -> q2 with output 0011, while bab remains on output 0. This makes (d) exact; (a) and (b) are too narrow.

Question 7

Consider the Moore machine:

!Moore machine state diagram over {a,b} that detects occurrences of aab

Which of the following option is correct w.r.t. the above Moore Machine

  • (a) The Moore machine counts the number of occurrences of “aab” in any string and print that many time “1”.

  • (b) This Moore machine counts the number of occurrences of “ab” and print that many times “1”.

  • (c) The Moore machine prints “1” whenever it encounters “ab” in a string

  • (d)  None of these

Answer: (a).

State q0/0 has no useful trailing a, q1/0 has one, q2/0 has at least two, and q3/1 marks a following b that completes aab. For aaabaab, the trace is q0 -> q1 -> q2 -> q2 -> q3 -> q2 -> q2 -> q3. Output 00001001 contains two 1s, at positions 4 and 7.

Question 8

Consider the given Moore Machine with states labeled along with their outputs. Analyze the behavior of the machine with respect to input strings over {a,b}.

!Four-state Moore machine diagram over {a,b} with state q3 producing output 1

Determine what function the Moore machine performs. Does it count occurrences of a specific substring or produce output based on a pattern? Justify your answer by explaining the role of each state and transitions.

Answer: This is the aab detector from Question 7. q0 loops on b and takes a to q1. From q1, b returns to q0, while a advances to q2. State q2 loops on a and takes b to q3/1, completing aab. From q3, a goes to q2 to reuse a trailing run, while b goes to q0. The aaabaab trace confirms one 1 per occurrence.

Moore substring detector and exact trace for aaabaab. Draw q0/0 as the start state with b loop and a arrow to q1/0; q1/0 with b arrow to q0/0 and a arrow to q2/0; q2/0 with a loop and b arrow to q3/1; q3/1 with a arrow to q2/0 and b arrow to q0/0. Beneath it show input positions 1 through 7 containing a, a, a, b, a, a, b; visited states q0, q1, q2, q2, q3, q2, q2, q3 including the initial q0; outputs 0, 0, 0, 0, 1, 0, 0, 1. Mark the two aab occurrences at positions 2-4 and 5-7, and label that the 1 symbols occur after inputs 4 and 7.

Moore Machine Question 9: count states for a combined rule

Question 9

Q. Consider a Moore machine over input alphabet Σ = {0,1} and output alphabet Δ = {X,Y} with the following behavior:

  1. The machine outputs X if the total number of 1’s seen so far is divisible by 3; otherwise it outputs Y.

  2. Whenever the last two inputs are ‘01’, the output switches to X for the next input, regardless of the divisible-by-3 condition.

What is the minimum number of states required for this Moore machine?

Answer __________ . (NAT)

Answer: 5.

The intended bank construction needs three residue roles: R0/X for a count of 1s congruent to 0 modulo 3, R1/Y for residue 1, and R2/Y for residue 2. Detecting the 01 exception adds one X-output override role and one helper role that remembers the partial 0. The intended count is 3 + 1 + 1 = 5. Because "for the next input" permits different timing conventions, the wording does not support a stronger minimality proof or a unique transition table.

Moore vs Mealy Question 10: explain the defining difference

Question 10 (UGC NET 2009, Paper 3)

Distinguish between Moore and Mealy finite state machines.

Answer: The models attach outputs differently.

Feature

Moore machine

Mealy machine

Output function

lambda: Q -> Delta

lambda: Q x Sigma -> Delta

Diagram notation

Output appears inside a state

Output appears on a transition

Input length n

Emits n + 1 symbols, including the initial output

Emits n symbols

State count and timing

May need more states because outputs belong to states

Can respond on the transition caused by the current input

For input 10110, the opening's two-state Moore design emits 010110. A one-state Mealy design with transitions 0/0 and 1/1 emits 10110. Moore includes the start-state output, while Mealy emits once per input transition.

Traps, scorecard and the next practice step

Check these five traps:

  • Output on edges: that is Mealy notation. Read Moore output from the current state.

  • Initial output forgotten: the result becomes short. Write the start state before reading input.

  • Symbols counted without a trace: length cannot reveal values. Record every visited state.

  • Substring named from one path: one path proves little. Check loops, fallbacks and counterexamples.

  • Equal state counts assumed: Moore may split output roles. Compare behaviours before counting.

As a study check, 8-10 correct means move to conversion and minimisation. With 6-7, retrace Questions 4-9. With 0-5, rebuild the definition and output-length rule. This is study guidance, not an exam statistic.

Next, use Finite Automata MCQs: 10 Solved DFA and NFA (GATE) to widen your automata practice. If you need the full learning sequence from finite automata through Moore and Mealy machines, continue with the Theory Of Computation / Automata Theory course.