Menu

© 2025 369 Tesla Private Limited

All Rights Reserved

Finite Automata

DFA Simulator

Simulate and test deterministic finite automata with interactive visualizations

DFA Simulator

Deterministic Finite Automata (DFA) are the simplest computational models with finite memory

Deterministic Finite Automaton (DFA) 🤖

Single path decision making - one clear transition for each input symbol

DFA Definition & Example

5-Tuple Definition

M = (Q, Σ, δ, q₀, F)

Q = {q₀, q₁, q₂, q₃} (finite set of states)

Σ = {0, 1} (input alphabet)

δ = Q × Σ → Q (transition function)

q₀ = q₀ ∈ Q (initial state)

F = {q₂} ⊆ Q (set of final states)

Language Description

L(M) = {w ∈ {0,1}* | w has odd number of 0's and even number of 1's}

Examples: {ε, 0, 011, 101, 110, 000, 01111, 00011, ...}

Transition Table δ(q, a)

StateInput: 0Input: 1
→q₀q₂q₁
q₁q₃q₀
*q₂q₀q₃
q₃q₁q₂

→ = initial state, * = final state

Interactive DFA Simulator

DFA State Diagram

q₀

Even 0's
Even 1's
START

q₁

Even 0's
Odd 1's

q₂

Odd 0's
Even 1's
ACCEPT

q₃

Odd 0's
Odd 1's

Transitions: q₀ --0--> q₂, q₀ --1--> q₁, q₁ --0--> q₃, q₁ --1--> q₀, q₂ --0--> q₀, q₂ --1--> q₃, q₃ --0--> q₁, q₃ --1--> q₂

String Processing: "01111"

0
1
1
1
1
Current State: q0
Position: 0/5

Example Strings

"0"
Accept

One 0 (odd), zero 1's (even)

"011"
Accept

One 0 (odd), two 1's (even)

"101"
Accept

One 0 (odd), two 1's (even)

"110"
Accept

One 0 (odd), two 1's (even)

"10011"
Reject

Two 0's (even), three 1's (odd)

"01111"
Accept

One 0 (odd), four 1's (even)