0% found this document useful (0 votes)
12 views48 pages

TOC U1

The document provides an overview of the Theory of Computation, covering key concepts such as computability, automata theory, and complexity theory. It explains various proof techniques, including deductive proof, proof by contradiction, and mathematical induction, as well as basic terminologies related to alphabets, strings, and languages. Additionally, it details finite automata, including deterministic and non-deterministic types, and their applications in recognizing patterns and processing inputs.
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)
12 views48 pages

TOC U1

The document provides an overview of the Theory of Computation, covering key concepts such as computability, automata theory, and complexity theory. It explains various proof techniques, including deductive proof, proof by contradiction, and mathematical induction, as well as basic terminologies related to alphabets, strings, and languages. Additionally, it details finite automata, including deterministic and non-deterministic types, and their applications in recognizing patterns and processing inputs.
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/ 48

AUTOMATA AND REGULAR

EXPRESSIONS

Mrs.M.NITHYA AP/CSE
Theory of Computation
• The Theory of Computation is a branch of
Computer Science and Mathematics
Combined.
• Deals with how efficiently problems can be
solved on a model of computation, using an
algorithm.
Theory of Computation

Theory of Computation

Computablity Automata Theory+ Complexity


Theory Formal Language Theory
Theory
Theory of Computation

Theory of Computation

Computablity Automata Theory+ Complexity


Theory Formal Language Theory
Theory

1. Decidable 1. Turing Machine 1. Time


2. Undecidable 2. Linear Bound 2. Space
Automata
3. Push Down
Automata
4. Finite Automata
Application


Text Processing

Compilers

Programming Languages

Artificial Intelligence

Genetic Programming

Neural Networks

Robotics
Models
Models
Introduction to Formal Proof

• The four ways of Theorem Proving (or)


Methods of formal proof.

1. Deductive Proof
2. Reduction Proof
3. Other theorem forms
4. Theorems that appear not to be if then
statement.
Deductive Proof

• A deductive proof consists of a sequence of


statements whose truth leads us from some
initial statement called the hypothesis or the
given statement(s) to a conclusion statement.
• “If H then C”, C is deducted from H.
• Hypothesis may be true or false depending on
values of its parameters.
Reduction to definitions

• Convert all the terms in hypothesis to their


definitions.
Other Theorem Forms
• Ways of saying “if – Then”
1. H implies C
2. H only if C
3. C if H
4. whenever H holds, C follows.
• If – And – only – If statements :
• A if and only if B is actually two if – then
statements.
1. if A then B and
2. if B then A
Theorems that appear not to be if – then
statements

• Sometimes we find a theorem that appear not


to have a hypothesis.
• An example is the well-known fact from the
trigonometry.
Additional Forms of Proof

• Proofs about Sets


• Proofs by Contradiction
• Proofs by Counter Example
Proving Equivalences about sets

• If E and F are two sets, then the statement


E=F means the 2 sets represented are the
same
• Every Element in the set represented by E is
in the set represented by F and vice-versa.
Proof by Contradiction

• Another way to prove a statement of the


form
• “if H then C is to prove the statement. H and
not C implies false hood.
• Start by assuming both the hypothesis H and
the negation of the conclusion C
• Complete the proof by showing that
something known to be false follows
logically from H and C.
Proof by Counter Example

• Statements that have no parameters or that


apply to only a finite number of values of its
parameter called observations.
Inductive Proofs
• Theorems can be proved by mathematical induction
involves 4 steps.

1. Basis: Starting point for an induction, result is true


for some n=0 or 1.
2. Induction Hypothesis: Assume the result is true for
n=k
3. Induction Step: Prove that the result is true for
same n=k+1
4. Proof of Induction Step: Actual Proof.
Basic Terminologies
• There are 3 basic mathematical notations and
techniques

1. Alphabets
2. Strings
3. Languages
Basic Mathematical Notation Techniques

1. Alphabets

It is a set of finite Symbols


It is denoted by Σ

Eg:
Σ={a,b} is an alphabet of two symbols
Basic Mathematical Notation Techniques

2. Strings

It is a finite sequence of Symbols

Eg:
If Σ={a,b} then ab, abb, aabb,…. are strings over
the alphabet a and b.
Basic Mathematical Notation Techniques

Operations on Strings

1. Length
2. Empty or Null
3. Concatenation
4. Reverse
5. Power of an Alphabet
6. Kleen Closure
7. Palindrome
8. Prefix and Suffix
Basic Mathematical Notation Techniques
Operations on Strings

1. Length

 Let W be the string then the length of the


string is the number of symbols present in
the string.

Eg:
W={a,b,c,d}
Then |W|=4
Basic Mathematical Notation Techniques
Operations on Strings

2. Empty or Null

 String consist of zero symbols or length of


the string is 0.
 It is denoted by Ɛ

Eg:
W={ }
Basic Mathematical Notation Techniques
Operations on Strings

3. Concatenation

 Concatenation of two strings W and V is


obtained by joining the symbols of V to W.

Eg:
W={a,b,c}
V={d,e}
WV={a,b,c,d,e}
Basic Mathematical Notation Techniques
Operations on Strings

4. Reverse

 The reverse of a string is obtained by writing


the symbols in reverse order.

Eg:
W={a,b,c}
R
W ={c,b,a}
Basic Mathematical Notation Techniques
Operations on Strings

5. Powers of an alphabet

 Let Σ be an alphabet.  m denotes set of all


strings over the alphabet of length m.
Eg:
Σ ={0,1}
 0 ={Ɛ}
1 ={0,1}
 2 ={01,10,11}
 3 ={010,011,110}
Basic Mathematical Notation Techniques
Operations on Strings

6. Kleen Closure

 Let Σ be an alphabet. The Kleen Closure


* denotes set of all strings including empty
string.

Eg:
Σ ={a}
* ={Ɛ, a, aa, aaa,….}
Basic Mathematical Notation Techniques
Operations on Strings

7. Palindrome

 A palindrome is a string which is same


whether written in forward or backward.
Eg: madam

8. Prefix and Suffix

Eg: W=123
Prefix={1,12,123}
Suffix={3,32,321}
Basic Mathematical Notation Techniques

3. Languages

Set of strings from an alphabet is called languages.

Eg:
English is a language over the alphabets a to z.
Basic Mathematical Notation Techniques

Operations on Languages

1. Complementation
2. Union
3. Intersection
4. Concatenation
5. Reversal
6. Kleen Star or Kleen Closure
7. Kleen Plus or Positive Closure
Automata
• An Automaton (pl. Automata) is an abstract model
of a digital computer.
• It has a mechanism for reading an input (string over
a given alphabet) from an input file (divided into
cells each cell holding one symbol).
• It can produce output of some form
• It may have a temporary storage device (consists of
unlimited number of cells each holding one symbol).
• Finally, it has a control unit (can be in any one of a
finite number of internal states, & can change state
in some manner).
Example: An Electric Switch
Finite State Machine
• An Automaton with a finite number of states is called a
Finite Automaton (FA) or Finite State Machine(FSM).
• Finite Automata are used to recognize patterns.
• It takes the string of symbol as input and changes its
state accordingly. When the desired symbol is found,
then the transition occurs.
• At the time of transition, the automata can either move
to the next state or stay in the same state.
• Finite automata have 2 states, Accept state or Reject
state.
• When the input string is processed successfully, and
the automata reached its final state, then it will accept.
Model of Finite Automata
• Input Tape
 It is a linear tape having some number of cells.
Each input symbol is placed in each cell.

• Finite Control
 It decides the next state on receiving particular
input from input tape.

• Tape Reader
 It reads the cells one by one from left to right, and
at a time only one symbol is read.
Model of Finite Automata
Finite Automata
• A Finite Automaton consists of:

 A finite set S of N states.


 A special start state.
 A set of final or accepting states.
 A set of transitions T from one state to another,
labeled with chars in C.
Finite Automata
• Execution of FA on an input sequence as follows:

 Begin in the start state.


 If the next input char matches the label on a
transition from the current state to a new state, go to
that new state.
 Continue making transitions on each input char
• If no move is possible, then stop.
• If in accepting state, then accept.
Finite Automata
• Finite Automata can be classified into two types:

 Deterministic Finite Automata(DFA).

 Non-Deterministic Finite Automata(NDFA/NFA)


Deterministic Finite Automata(DFA)
• Deterministic refers to the uniqueness of the
computation.
• For each input symbol, one can determine the state to
which the machine will move, as the machine will
move to a particular state.
• DFA does not accept the null move.
Deterministic Finite Automata(DFA)
• Formal Definition of DFA

 DFA is defined as 5 tuples : M = (Q,Σ,δ,q0,F)

Where,

Q-> Set of states


Σ -> set of input symbols
δ > is a transition function mapping from Qx Σ-> Q
qo -> an initial state
F -> set of final states F<Q
Deterministic Finite Automata(DFA)
• Example of DFA
Non-Deterministic Finite Automata(NFA)
• Non-Deterministic refers to the non uniqueness of the
computation. ie, it can be in several states at once.
• For a particular input symbol, one cannot determine
the exact state to which the machine will move, as the
machine can move to any combination of the states.
Non-Deterministic Finite Automata(DFA)
• Formal Definition of NFA

 NFA is defined as 5 tuples : M = (Q,Σ,δ,q0,F)

Where,

Q-> Set of states


Σ -> set of input symbols
δ > is a transition function mapping from Qx Σ-> 2Q
qo -> an initial state
F -> set of final states F<Q
Non-Deterministic Finite Automata(DFA)
• Example of NFA
Graphical Representation of DFA/NFA
• The vertices represent the states.
• The arcs labeled with an input alphabet show the
transitions.
• The initial state is denoted by an empty single
incoming arc.
• The final state is indicated by double circles.
DFA vs NFA

DFA NFA
Deterministic Finite Automata Non-Deterministic Finite Automata

For each input symbol, one can For a particular input symbol, one
determine the state to which the machine cannot determine the exact state to
will move, as the machine will move to which the machine will move, as the
a particular state. machine can move to any combination
of the states.
Empty string transitions are not seen. Permits empty string transitions

Backtracking is allowed Backtracking is not always possible.

Requires more space Requires less space.

A string is accepted by a DFA, if it A string is accepted by a NFA, if at least


transits to a final state. one of all possible transitions ends in a
final state.
Advantages of Automata Theory

• Implement a system with a fixed set of resources.

• Implement a system within a hardware circuit.

• Complementing a system using software with a finite


set of codes.
Thank You..

You might also like