Unit I
Unit I
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 ∑*.
• The finite state system is very good design tool for the programs such
as TEXT EDITORS and LEXICAL ANALYZERS.
Definition of Finite Automata
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
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.