0% found this document useful (0 votes)
44 views

CSE437 Assignment 2

The document discusses deterministic finite automata (DFAs) and non-deterministic finite automata (NFAs). It defines the components of a DFA and NFA, provides examples of how to trace strings through each type of automaton, and notes that NFAs can be simpler but DFAs are more computationally efficient.

Uploaded by

2130734
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views

CSE437 Assignment 2

The document discusses deterministic finite automata (DFAs) and non-deterministic finite automata (NFAs). It defines the components of a DFA and NFA, provides examples of how to trace strings through each type of automaton, and notes that NFAs can be simpler but DFAs are more computationally efficient.

Uploaded by

2130734
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Ikram Hossain Akif, ID - 2130734

Finite Automata and Computability, Sec-3


Assignment 2

A discrete finite automaton (DFA) is a 5-tuple (Q, Σ, δ, q0, F) where,


● Q represents a finite set of all the possible states,
● Σ is an alphabet (set of symbols),
● δ: Q × Σ → Q is a transition function that allows us to map where we can go from any given state,
depending on the symbol given as input
● q0 ∈ Q is the initial state
● F ⊆ Q is a set of accepting states (or final states).

The language of a DFA is defined as the set of all strings over Σ that, starting from q 0 and
following the transitions as the string is read left to right, will reach an accepted state.

For example, if a simple DFA is constructed to accept all strings that contain 1 as a substring,

Created using FSM Simulator[1].

then we can trace the states for any string. E.g. if 0001 is the input string,
(qe, 0001) → qe
(qe, 001) → qe
(qe, 01) → qe
(qe, 1) → q1
(q1, ε); As qe ∈ F, this string is accepted.

If another DFA were constructed that only accepts strings that begin with 1,

Created using FSM Simulator[1].

we can see when the state “die” is reached, it is impossible to reach a final state. This is known
as a dead state.
H/W: Construct a DFA over the alphabet {0, 1} that accepts all strings that end in 101.

Created using FSM Simulator[1].

DFAs are referred to as deterministic because the transition is predetermined and definite.
There is no room for ambiguity and the paths are fixed. Non-deterministic finite automata
(NFAs) are simple machines that allow us to make guesses and allow for a different
computational approach.

They differ from DFAs as the transition function δ can go into several states simultaneously and
it allows ε-transitions, which can allow us to be present in multiple states and move between
them without reading any part of a string.

A non-deterministic finite automaton (NFA) is a 5-tuple (Q, Σ, δ, q0, F) where,


● Q represents a finite set of all the possible states,
● Σ is an alphabet (set of symbols),
● δ: Q × (Σ ∪ {ε}) → subsets of Q is a transition function that allows us to map where we can go
from any given state, depending on the symbol given as input
● q0 ∈ Q is the initial state
● F ⊆ Q is a set of accepting states (or final states).

Similar to DFAs, the language of an NFA is the set of all strings that the NFA accepts.
Looking at the NFA below as an example,

Created using FSM Simulator[1] [2].

if we give the string 110 as input,


(q0, 110)
⇒({q0, q2}, 110)→ {q0, q2}
⇒({q0, q2}, 10)→ {q0, q2}
⇒({q0, q2}, 0)→ {q0, q1, q2}
⇒({q0, q1, q2}, ε); As q1 ∈ F, this string is accepted.

NFAs may sometimes result in simpler designs but are computationally more expensive than
DFAs, as every possible state is accounted for each step of the way.

References:
[1] Developed by Ivan Zuzak and Vedrana Jankovic, under the Apache License v2.0.
[2] The $ sign is used to represent ε, the empty string, inside the diagrams.

You might also like