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

A Presentation ON Nfa & Dfa: Aman Kumar C.S.E 4 Sem

This presentation provides an overview of non-deterministic finite automata (NFA) and deterministic finite automata (DFA). It defines the key components of finite automata including states, alphabets, transitions, initial states, and final states. It then describes the differences between NFAs and DFAs. Specifically, it notes that NFAs allow multiple transitions from a state for a given input, while DFAs restrict each state to a single transition for each input. The presentation provides several examples of NFAs and DFAs and discusses how any NFA can be converted to an equivalent DFA.

Uploaded by

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

A Presentation ON Nfa & Dfa: Aman Kumar C.S.E 4 Sem

This presentation provides an overview of non-deterministic finite automata (NFA) and deterministic finite automata (DFA). It defines the key components of finite automata including states, alphabets, transitions, initial states, and final states. It then describes the differences between NFAs and DFAs. Specifically, it notes that NFAs allow multiple transitions from a state for a given input, while DFAs restrict each state to a single transition for each input. The presentation provides several examples of NFAs and DFAs and discusses how any NFA can be converted to an equivalent DFA.

Uploaded by

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

A PRESENTATION

ON
NFA & DFA

Aman Kumar
C.S.E 4th sem
Finite Automata

 Collection of states alphabets and transition


 Finite Automata contain of five tuples
(Q,δ,ε,q0,F)
Q=set of states.
Δ=transitions.
Ε=alphabet.
q0=starting states.
F=final state.
DFA

 For every string x, there is a unique path from initial


state and associated with x.
x

x is accepted if and only if this path ends at a final


state.
 For example #1:
1
4
Q = {q0, q1}
0
Σ = {0, 1}
q0 q1 1
Start state is q0
0
F = {q0}

δ:
0 1
q0 q1 q0

q1 q0 q1
 For example #2:
5
a a a/b/c
Q = {q0, q1, q2} c c
q0 q1 q2
Σ = {a, b, c}
Start state is q0 b b

F = {q2}
For example #3:

 Construct DFA to accept 00(0+1)*

0, 1
0 0 0
q s p 0
s p q
1
1

1 Ǿ

0,1
Non Deterministic Finite Automata

 It contain all the properties of finite automata.

 Except one condition that at any state it can take


more than one decision for a particular transition.

 Transition table is feasible but not effective.


What is an NFA

 An NFA is an automaton that its states might have


none, one or more outgoing arrows under a specific
symbol.

 A DFA is by definition an NFA (each state has exactly


one outgoing arrow under each symbol).
Nondeterministic Finite State
9
Automata (NFA)

 An NFA is a five-tuple:

M = (Q, Σ, δ, q0, F)

Q A finite set of states


Σ A finite input alphabet
q0 The initial/starting state, q0 is in Q
F A set of final/accepting states, which is a subset
of Q
δ A transition function, which is a total function
from Q x Σ to 2Q
 Example #1: some 0’s followed by some 1’s
10
0 1 0/1
Q = {q0, q1, q2} 0
q0 q1 1 q2
Σ = {0, 1}
Start state is q0
F = {q2}

δ: 0 1
q0{q0, q1} {}

{} {q1, q2}
q1
{q2} {q2}

q2
 Example #2: pair of 0’s or pair of 1’s

11
0/1 0/1
Q = {q0, q1, q2 , q3 , q4}
Σ = {0, 1} 0 0
q0 q3 q4
Start state is q0
F = {q2, q4} 1 0/1

1
δ: 0 1 q1 q2
q0 {q0, q3} {q0, q1}

q1 {} {q2}

{q2} {q2}
q2
{q4} {}
q3
{q4} {q4}
q4
Equivalence of DFAs and NFAs

All deterministic automata are non deterministic


Given a nondeterministic automaton, it is always
possible to find a an equivalent deterministic
automaton “doing the same”?
That is, given an NFA M = (Q,, ,s,F) does there
exists an equivalent DFA M’ = (Q’,, ’,s’,F’)?

: Q × (  {e}) × (Q) ’: Q’×   Q’

Observation: Every DFA is an NFA.


 Consider the following DFA: 2 or more c’s
13
a a a/b/c
Q = {q0, q1, q2} c
q0 q1 c q2
Σ = {a, b, c}
Start state is q0 b b

F = {q2}

δ: a b c
q0 q0 q0 q1

q1 q1 q1 q2

q2 q2 q2 q2
 An Equivalent NFA:
14
a a a/b/c
Q = {q0, q1, q2} c c
q0 q1 q2
Σ = {a, b, c}
Start state is q0 b b

F = {q2}

δ: a b c
q0 {q0} {q0} {q1}

q1 {q1} {q1} {q2}

q2 {q2} {q2} {q2}


Comparison of DFA and NFA

 DFA is specialization
 NFA is generalization
THANK YOU
QURIES ?

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy