0% found this document useful (0 votes)
20 views21 pages

Unit I

1. Finite automata are mathematical models that process input in a series of states to produce an output. They are useful for modeling hardware and software systems. 2. The document introduces the key concepts of finite automata theory including alphabets, strings, languages, and problems. It also defines deterministic and non-deterministic finite automata. 3. Deterministic finite automata have a single path for each input-state combination, while non-deterministic automata can have multiple paths. Deterministic automata cannot use empty string transitions unlike non-deterministic automata.

Uploaded by

K.Jyothi Swaroop
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
20 views21 pages

Unit I

1. Finite automata are mathematical models that process input in a series of states to produce an output. They are useful for modeling hardware and software systems. 2. The document introduces the key concepts of finite automata theory including alphabets, strings, languages, and problems. It also defines deterministic and non-deterministic finite automata. 3. Deterministic finite automata have a single path for each input-state combination, while non-deterministic automata can have multiple paths. Deterministic automata cannot use empty string transitions unlike non-deterministic automata.

Uploaded by

K.Jyothi Swaroop
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 21

THE METHODS AND

THE MADNESS
Introduction to Finite Automata
Finite automata are a useful model for many important kinds of
hardware and software.
• Software for designing and checking the behavior of digital circuits.
• The lexical analyzer of a typical compiler that is the compiler
component that breaks the input text into logical units such as
identifiers, keywords and punctuation.
• Software for scanning large bodies of text such as collections of Web
pages to find occurrences of words phrases or other patterns.
• Software for verifying systems of all types that have a finite number
of distinct states such as communications protocols or protocols for
secure exchange of information.
Introduction to Formal Proof
1. Deductive Proofs:
A deductive proof consists of a sequence of statements whose truth
leads us from some initial statement called the hypothesis or the given
statements to a conclusion statement.

2. Reduction to Definitions:
If you are not sure how to start a proof convert all terms in the
hypothesis to their denitions.
Ex: A set S is finite if there exists an integer n such that S has exactly n
Elements. We write ||S|| = n where ||S|| is used to denote the
number
of elements in a set S.
Introduction to Formal Proof
3. Other Theorem Forms:
The “if then” form of theorem is most common in typical areas of
mathematics.
if H then C form but are in fact saying the same thing if hypothesis H is
true for a given value of the parameters then the conclusion C is true
for the same value.
If-And-Only-If Statements
“A if and only if B”
1. The if part: “if B then A” and
2. The only if part: “if A then B”, which is often stated in the equivalent
form “A only if B”.
Additional Forms of Proof
1. Proving Equivalences About Sets:
If E and F are two expressions representing sets the statement E = F
means that the two sets represented are the same.
RUS=SUR

2. The Contrapositive:
The contrapositive of the statement “if H then C” is “if not C then not H”.
A statement and its contrapositive are either both true or both false so
we can prove either to prove the other.
Additional Forms of Proof
3. Proof by Contradiction:
“if H then C” is to prove the statement.
“H and not C implies falsehood”

4. Counterexamples:
It often is easier to prove that a statement is not a theorem than to
prove it is a theorem.
if S is any statement then the statement “S is not a theorem” is itself a
statement without parameters.
INDUCTIVE PROOFS
1. Inductions on Integers:
Suppose we are given a statement S(n) about an integer n, to prove.
One
common approach is to prove two things:
i) The basis, where we show S(i) for a particular integer i. Usually i=0
or i =1.
ii) The inductive step, where we assume n >= i, where i is the basis
integer, and we show that “if S(n) then S(n+1)”.
INDUCTIVE PROOFS
2. More General Forms of Integer Inductions:
i) We can use several basis cases. That is, we prove S(i), S(i+1),…, S(j)
for some j > i.
ii) In proving S(n+1), we can use the truth of all the statements
S(i), S(i+1),....., S(n)
3. Structural Inductions:
❖ There are several recursively defined structures about which we
need to prove statements.
❖ All recursive definitions have a basis case, where one or more
elementary structures are defined.
❖ An inductive step, where more complex structures are defined.
THE CENTRAL CONCEPTS OF AUTOMATA THEORY
1. Alphabets:
An alphabet is a finite and non empty set of symbols.
The example of alphabet is, S={a, b, c,……..
z}
The elements a, b, c, …….z are alphabets.

If W={0,1}
Here 0 and 1 are alphabets, denoted by W.
THE CENTRAL CONCEPTS OF AUTOMATA THEORY
2. Strings:
A string (or sometimes word) is a finite sequence of symbols chosen
from some alphabet.
Example: 01101 is a string from the binary alphabet ∑ = {0,1}.
i) The Empty String: The empty string is the string with zero
occurrences of symbols.
This string denoted as ϵ.
ii) Length of a String: the number of positions for symbols in the string.
Ex: 01101 has length 5.
The standard notation for the length of a string w is |w|.
|011| = 3 and |ϵ| = 0.
THE CENTRAL CONCEPTS OF AUTOMATA THEORY
iii) Powers of an Alphabet: If ∑ is an alphabet, we can express the set
of all strings of a certain length from that alphabet by using an
exponential notation.
We define ∑k to be the set of strings of length k, each of whose
symbols is in ∑.
Ex: If ∑ = {0,1}, then ∑1 = {0,1}, ∑2 = {00,01,10,11}
The set of all strings over an alphabet is conventionally denoted ∑*.

iv) Concatenation of Strings: Let x and y be strings. Then xy denotes


the concatenation of x and y, that is the string formed by making a
copy of x and following it by a copy of y.
Ex: Let x = 01101 and y = 110. Then xy = 01101110.
THE CENTRAL CONCEPTS OF AUTOMATA THEORY
3. Languages:
A set of strings all of which are chosen from some ∑*, where ∑ is a
particular alphabet, is called a language.
i) The language of all strings consisting of n 0’s followed by n 1’s for
some n >=0: {ϵ,01, 0011, 000111}
ii) The set of strings of 0’s and 1’s with an equal number of each:
{ϵ, 01, 10, 0011, 0101, 1001…}
iii) ∑ is a language for any alphabet ∑*
iv) ф the empty language, is a language over any alphabet ∑
v) {ϵ} the language consisting of only the empty string, is also a
language over any alphabet.
THE CENTRAL CONCEPTS OF AUTOMATA THEORY
4. Problems:
A problem is the question of deciding whether a given string is a
member of some particular language.

Given a string w in ∑*, decide whether or not w is in L.


Examples
1. The set of all strings over {a,b,c} that have ac as substring can be
written as {xacy | x,y ∈{a,b,c}∗}.
This can also be written as {x∈{a,b,c}∗ ||x|ac ≥1},
stating that the set of all strings over {a,b,c} in which the
number of occurrences of substring ac is at least 1.
2. The set of all strings over some alphabet Σ with even number
of a’s is {x∈Σ∗ ||x|a = 2n, for some n∈N}.
Equivalently, {x∈Σ∗ ||x|a ≡ 0 mod 2}.
3. The set of all strings over some alphabet Σ with equal number
of a’s and b’s can be written as {x∈Σ∗ ||x|a =|x|b}.
4. The set of all palindromes over an alphabet Σ can be written as
{x∈Σ∗ | x = xR}, where xR is the string obtained by reversing x.
Finite State Machine
• The finite state machine represents a mathematical model
of a system with certain input.

• The model finally gives certain output.

• The input is processed by various states, these states are


called as intermediate states.

• The finite state system is very good design tool for the programs such
as TEXT EDITORS and LEXICAL ANALYZERS.
Definition of Finite Automata

• A finite automata is a collection of 5-tuple(Q,Σ,δ,q0,F) Where , Q is


finite set of states, which is non empty.
Σ is input alphabet, indicates input set.
δ is transition function or mapping function. We can
determine the next state using this function.
q0 is an initial state and is in Q F is set of final states.
Finite Automata Model
• The finite automata can be represented as follows:
Input Tape
A B A B A B A B A B

Tape
Reader
❖ Input Tape: It is a linear tape
having some number of cells.
Each input symbol is placed in
Out put each cell.
❖ Finite Control: The finite control
Finite
Control
decides the next state on
receiving particular input from
input tape.
Types of Automata

Finite Automata

Deterministic Non Deterministic


Finite Automata Finite Automata
Types of Automata
• Deterministic Finite Automata: The Finite Automata is called
Deterministic Finite Automata if there is only one path for a specific
input from current state to next state.
It can be represented as follows:
• A machine M = (Q,Σ,δ,q0,F) Where ,
Q is finite set of states, which is non empty.
Σ is input alphabet, indicates input set.
δ is transition function or mapping function. We can determine
the next state using this function.
q0 is an initial state and is in Q F is set of final states.

Where δ:Q X Σ ->


Types of Automata
• Non Deterministic Finite Automata: The Finite Automata is called
Non Deterministic Finite Automata if there are more than one path
for a specific input from current state to next state.
It can be represented as follows:
• A machine M = (Q,Σ,δ,q0,F) Where ,
Q is finite set of states, which is non empty.
Σ is input alphabet, indicates input set.
δ is transition function or mapping function. We can determine
the next state using this function.
q0 is an initial state and is in Q F is set of final states.

Where δ:Q X Σ -> 2Q


Difference between DFA & NFA

Deterministic Finite Automata Non Deterministic Finite Automata


For Every symbol of the alphabet, there is only one We do not need to specify how does the NFA react
state transition in DFA. according to some symbol.

DFA cannot use Empty String transition. NFA can use Empty String transition.

DFA can be understood as one machine. NFA can be understood as multiple little machines
computing at the same time.
DFA will reject the string if it end at If all of the branches of NFA dies or rejects the string,
other than accepting state. we can say that NFA reject the string.
Backtracking is allowed in DFA. Backtracking is not always allowed in NFA.

DFA is more difficult to construct. NFA is easier to construct.

You might also like