DFA and NFA with examples

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

← RGPV CD-501 Theory of Computation December 2024 Solved Question Paper

Question

Explain DFA and NFA with examples.

Asked in: CS-501 | December 2025 | 2(a)

Write a short note on NFA (any two of Q8).

Asked in: CD-501 | December 2024 | 8(c)

Answer

Both machines recognize regular languages. A DFA has exactly one successor for each state-symbol pair; an NFA may have zero, one or several successors. An epsilon-NFA may additionally change state without consuming input.

A DFA uses δ:Q×Σ→Q. An NFA uses δ:Q×Σ→2Q (or includes ε for epsilon transitions). A DFA accepts when its unique computation ends in a final state. An NFA accepts when at least one computation consumes the entire input and ends in a final state.

Example: strings ending in 1

For a DFA, start in q₀, with q₁ accepting. From either state, input 0 leads to q₀ and input 1 leads to q₁. For an NFA, start in p₀ with loops on both symbols; on 1 it may also enter accepting p₁, which has no outgoing transitions. The successful path guesses the last 1.

Aspect DFA NFA
Successors Exactly one Any subset
Execution Single path Set of possible paths
Expressiveness Regular Regular

Subset construction converts any NFA to an equivalent DFA with at most 2ⁿ states for an n-state NFA. Nondeterminism can simplify design but does not increase expressive power.

DFA and NFA with examples diagram
DFA and NFA with examples — original illustration

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

← RGPV CD-501 Theory of Computation December 2024 Solved Question Paper

Discussion

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

Sign in to participate in the discussion.

Join the discussion