0% found this document useful (0 votes)
426 views14 pages

Advanced TOC: Dfa, Nfa, TG, GTG

This document defines and provides examples of different types of finite automata: 1. A finite automaton (FA) consists of a finite number of states, transitions between states based on input letters, and designation of initial and final states. 2. A deterministic finite automaton (DFA) has exactly one transition from each state based on each input letter. 3. A nondeterministic finite automaton (NFA) may have multiple transitions from a state based on a single input letter. 4. A transition graph (TG) is similar to an NFA but transitions can be labeled with strings rather than single letters. 5. A generalized transition graph (GTG) allows transitions to

Uploaded by

shawal ali
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)
426 views14 pages

Advanced TOC: Dfa, Nfa, TG, GTG

This document defines and provides examples of different types of finite automata: 1. A finite automaton (FA) consists of a finite number of states, transitions between states based on input letters, and designation of initial and final states. 2. A deterministic finite automaton (DFA) has exactly one transition from each state based on each input letter. 3. A nondeterministic finite automaton (NFA) may have multiple transitions from a state based on a single input letter. 4. A transition graph (TG) is similar to an NFA but transitions can be labeled with strings rather than single letters. 5. A generalized transition graph (GTG) allows transitions to

Uploaded by

shawal ali
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/ 14

Advanced TOC

DFA, NFA, TG , GTG


Finite Automaton
A Finite automaton (FA), is a collection of the followings
Finite number of states, having one initial and some (maybe none) final states.
Finite set of input letters (Σ) from which input strings are formed.
Finite set of transitions i.e. for each state and for each input letter there is a transition
showing how to move from one state to another
Example Σ = {a,b} States: x, y, z where x is an initial state and z is final state.
Transitions:
At state x reading a, go to state z
At state x reading b, go to state y
At state y reading a, b go to state y
At state z reading a, b go to state z
It may be noted that the information of an FA, given in the previous table, can also be depicted by the
following diagram, called the transition diagram, of the given FA

The above transition diagram is an FA accepting the language of strings, defined over Σ = {a, b}, starting
with a. It may be noted that this language may be expressed by the regular expression a(a + b)*
DFA accept even length words

Beginning with and ending in same letters.


Must have substring “aa”

having double 0’s or double 1’s,


having triple a’s or triple b’s.

EVEN-EVEN
Nondeterministic Finite Automaton (NFA)
An NFA is a TG with a unique start state and a property of having single
letter as label of transitions.
An NFA is a collection of three things Finite many states with one initial
and some final states
Finite set of input letters, say, Σ = {a, b, c}
Finite set of transitions, showing where to move if a letter is input at
certain state (∧ is not a valid transition), there may be more than one
transition for certain letters and there may not be any transition for
certain letters.
It may be observed, from the definition of NFA, that the string is
supposed to be accepted, if there exists at least one successful path,
otherwise rejected.
Example

It is to be noted that the above NFA accepts the language consisting of a and ab.

It is to be noted that the above NFA accepts the language of strings, defined over Σ = {a, b},
containing aa.
Transition Graph
A Transition graph (TG), is a collection of the followings
Finite number of states, at least one of which is start state and some
(maybe none) final states.
Finite set of input letters (Σ) from which input strings are formed.
Finite set of transitions that show how to go from one state to another
based on reading specified substrings of input letters, possibly even the
null string (Λ).
Containing double a.

having double a or double b.

beginning and ending in different letters.


EVEN-EVEN
Generalized Transition Graphs
A generalized transition graph (GTG) is a collection of three things Finite
number of states, at least one of which is start state and some (maybe
none) final states.
Finite set of input letters (Σ) from which input strings are formed.
Directed edges connecting some pair of states labeled with regular
expression.
It may be noted that in GTG, the labels of transition edges are
corresponding regular expressions
beginning and ending in different letters.
Some practice questions
Alphabets for following area ∑ = (a, b)
• Build an FA that accepts only the language of all words with b as the second letter.
• Build an FA that accepts only the words baa, ab, and abb and no other strings longer or shorter
• Build a new FA that accepts only the word null.
• Build an FA with three states that accept all words.
• Build an FA that accepts only those words that have an even number of letters total.
• Build an FA that accepts only those words that do not end with ba.
• Build an FA that accepts only those words that begin or end with a double letter.
• Build an FA that accepts only those words that have more than four letters.
• Build an FA that accepts only those words that have fewer than four letters.
• Design a DFA that accepts all strings that have an even length but not divisible by 6.
• Design a DFA that accepts all strings over {a, b} such that the number of as is even and the number of bs is
even.

You might also like