0% found this document useful (0 votes)
45 views30 pages

Automata 3 Slide

The document discusses distinguishable and indistinguishable strings in automata. It begins with an introduction to automata, including definitions of states, alphabets, strings, and languages. It then explains deterministic finite automata (DFA) and non-deterministic finite automata (NFA), providing examples of each. Finally, it discusses how distinguishable and indistinguishable strings can be used to minimize the number of states in an automaton by grouping identical behavioral strings. This optimization reduces repetition and the overall cost of the automaton.

Uploaded by

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

Automata 3 Slide

The document discusses distinguishable and indistinguishable strings in automata. It begins with an introduction to automata, including definitions of states, alphabets, strings, and languages. It then explains deterministic finite automata (DFA) and non-deterministic finite automata (NFA), providing examples of each. Finally, it discusses how distinguishable and indistinguishable strings can be used to minimize the number of states in an automaton by grouping identical behavioral strings. This optimization reduces repetition and the overall cost of the automaton.

Uploaded by

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

DISTINGUISHABLE AND UNDISTINGUISHABLE

STRINGS IN AUTOMATA

GROUP MEMBERS:

M.IKRAM (2213-2019)
M.OSAMA ASHRAF (2253-2019)
Distinguishable and
undistinguishable strings
• First of all we need to understand the
prerequisite’s of the above topic

“distinguishable and undistinguishable”

For better understanding let’s start with


automata.
Introduction to Automata

• Definition :

• The term "Automata" means "self-acting". An


automaton (Automata in plural) is an abstract
self-propelled computing device which follows a
predetermined sequence of operations
automatically.
• .
Cont.
• It is the study of abstract machines and the
computation problems that can be solved using
these machines. The abstract machine is called
the automata. ... Automata is the kind of
machine which takes some string as input
and this input goes through a finite number
of states and may enter in the final state
States of automata
• An automaton with a finite number of states is called a Finite
Automaton (FA) or Finite State Machine (FSM).
• Formal definition of a Finite Automaton
• An automaton can be represented by a 5-tuple (Q, ∑, δ, q0, F),
where −
• Q is a finite set of states.
• ∑ is a finite set of symbols, called the alphabet of the automaton.
• δ is the transition function.
• q0 is the initial state from where any input is processed (q0 ∈ Q).
• F is a set of final state/states of Q (F ⊆ Q).
Related Terminologies
• Alphabet
• Definition − An alphabet is any finite set
of symbols.
• Example − ∑ = {a, b, c, d} is an alphabet
set where ‘a’, ‘b’, ‘c’, and ‘d’ are symbols.
String
.
• Definition − A string is a finite sequence
of symbols taken from ∑.

• Example − ‘cabcad’ is a valid string on the


alphabet set ∑ = {a, b, c, d}
Length of a String

• Definition − It is the number of symbols


present in a string. (Denoted by |S|).
• Examples −
– If S = ‘cabcad’, |S|= 6
– If |S|= 0, it is called an empty string (Denoted
by λ or ε)
Kleene Star

• Definition − The Kleene star, ∑*, is a unary operator on


a set of symbols or strings, ∑, that gives the infinite set
of all possible strings of all possible lengths
over ∑ including λ.
• Representation − ∑* = ∑0 ∪ ∑1 ∪ ∑2 ∪……. where ∑p is
the set of all possible strings of length p.

• Example − If ∑ = {a, b}, ∑* = {λ, a, b, aa, ab, ba, bb,


………..}
Kleene Closure / Plus

• Definition − The set ∑+ is the infinite set of all


possible strings of all possible lengths over ∑
excluding λ.
• Representation − ∑+ = ∑1 ∪ ∑2 ∪ ∑3 ∪…….
• ∑+ = ∑* − { λ }

• Example − If ∑ = { a, b } , ∑+ = { a, b, aa, ab, ba,


bb,………..}
Language

• Definition − A language is a subset of ∑*


for some alphabet ∑. It can be finite or
infinite.

• Example − If the language takes all


possible strings of length 2 over ∑ = {a, b},
then L = { ab, aa, ba, bb }
Regular expressions
Designing or writing R.E’s.
Formal languages
• In automata theory, a formal language is a set of strings
of symbols drawn from a finite alphabet. A formal
language can be specified either by a set of rules (such as
regular expressions or a context-free grammar) that
generates the language, or by a formal machine that
accepts (recognizes) the language.
Example.
• For formal : W O R K
• And for informal W K R O
• starting with “W” and ends with “o”(in this case informal will
one will be selected.(as per condition)
Finite Automaton (FA)
• Informally, a state diagram that comprehensively
captures all possible states and transitions that a
machine can take while responding to a stream or
sequence of input symbols
• Recognizer for “Regular Languages”

• Deterministic Finite Automata (DFA)


– The machine can exist in only one state at any given time
• Non-deterministic Finite Automata (NFA)
– The machine can exist in multiple states at the same time
Types of Finite Automata

• There are two types of finite automata:


• DFA(deterministic finite automata)
• NFA(non-deterministic finite automata)
TYPES OF AUTOMATA
Deterministic Finite Automata –
(DFA) Definition
• A Deterministic Finite Automaton (DFA) consists of:
• Q ==> a finite set of states
• ∑ ==> a finite set of input symbols (alphabet)
• q0 ==> a start state
• F ==> set of accepting states
• δ ==> a transition function, which is a mapping between
Q x ∑ ==> Q
• A DFA is defined by the 5-tuple:
• {Q, ∑ , q0,F, δ }
RULES OF D.F.A
• Input: a word w in ∑*
• Question: Is w acceptable by the DFA?
• Steps:
• Start at the “start state” q0
• For every input symbol in the sequence w do
• Compute the next state from the current state, given the
current input symbol in w and the transition function
• If after all symbols in w are consumed, the current state
is one of the accepting states (F) then accept w;
• Otherwise, reject w.
D.F.A
• DFA refers to deterministic finite automata.
Deterministic refers to the uniqueness of the
computation. In the DFA, the machine goes to
one state only for a particular input character.
DFA does not accept the null move.
DFA EXAMPLE
NFA
• NFA stands for non-deterministic finite
automata. It is used to transmit any
number of states for a particular input. It
can accept the null move.
Non-deterministic Finite Automata
(NFA)
• A Non-deterministic Finite Automaton (NFA) consists of:
• Q ==> a finite set of states
• ∑ ==> a finite set of input symbols (alphabet)
• q0 ==> a start state
• F ==> set of accepting states
• δ ==> a transition function, which is a mapping between
Q x ∑ ==> subset of Q
• An NFA is also defined by the 5-tuple:
• {Q, ∑ , q0,F, δ }
Some important points about
DFA and NFA:
• Every DFA is NFA, but NFA is not DFA.
• There can be multiple final states in both
NFA and DFA.
• DFA is used in Lexical Analysis in
Compiler.
• NFA is more of a theoretical concept.
Example of N.F.A

NFA for strings containing 01


Regular expression: (0+1)*01(0+1)*

Why is this non-deterministic? • Q = {q0,q1,q2}

0,1 0,1 •  = {0,1}

1 • start state = q0
start 0
q0 q1 q2 • F = {q2}
Final
• Transition table
state symbols
0 1
What will happen if at state q1 q0 {q0,q1} {q0}
states

an input of 0 is received? q1 Φ {q2}


*q2 {q2} {q2}
25
Distinguishable strings
Indistinguishable strings
Conclusion
• We use distinguishable and indistinguishable
strings in automata to minimize the number of
states in which our string is processed by
identifying behavioral strings such as identical
strings are bind with the processor to reduce
the repetition of strings in a particular automata.
Conclusion Cont.
• Thus with the help of distinguishable
and indistinguishable we can optimize
our automata by minimizing it states
and thus it will reduce the cost
also(running cost,time,cost etc)
Any queries?

Thankyou 

You might also like