Mealy machine for binary identity output

December 4, 2026 · Team EasyExamNotes · 1 min read (est.) · 0 comments

Share on WhatsApp

← RGPV CS-501 Theory of Computation December 2025 Solved Question Paper

Question

Design a Mealy machine producing output 1 for input 1 and output 0 for every other input symbol.

Asked in: CS-501 | December 2025 | 1(b)

Answer

Assume the binary input alphabet {0,1}. The output depends only on the current input symbol, so no previous input needs to be remembered. A single state q suffices.

Define M=({q},{0,1},{0,1},δ,λ,q), with δ(q,0)=δ(q,1)=q, λ(q,0)=0 and λ(q,1)=1.

State Input Next state Output
q 0 q 0
q 1 q 1

Example

For input 10110, the successive transition labels are 1/1, 0/0, 1/1, 1/1, 0/0. The output is 10110. Empty input produces empty output. By induction on input length, each new symbol is copied and the machine stays in q; therefore every binary string is copied correctly. One state is minimal because a machine must have an initial state. If a larger alphabet is intended, add a self-loop x/0 for every symbol x other than 1.

Mealy machine for binary identity output diagram
Mealy machine for binary identity output — original illustration

← RGPV CS-501 Theory of Computation December 2025 Solved Question Paper

Discussion

Ask a question, share your thoughts or report an error.

Sign in to participate in the discussion.

Join the discussion