TOC U1
TOC U1
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
Theory of Computation
Text Processing
Compilers
Programming Languages
Artificial Intelligence
Genetic Programming
Neural Networks
Robotics
Models
Models
Introduction to Formal Proof
1. Deductive Proof
2. Reduction Proof
3. Other theorem forms
4. Theorems that appear not to be if then
statement.
Deductive Proof
1. Alphabets
2. Strings
3. Languages
Basic Mathematical Notation Techniques
1. Alphabets
Eg:
Σ={a,b} is an alphabet of two symbols
Basic Mathematical Notation Techniques
2. Strings
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
Eg:
W={a,b,c,d}
Then |W|=4
Basic Mathematical Notation Techniques
Operations on Strings
2. Empty or Null
Eg:
W={ }
Basic Mathematical Notation Techniques
Operations on Strings
3. Concatenation
Eg:
W={a,b,c}
V={d,e}
WV={a,b,c,d,e}
Basic Mathematical Notation Techniques
Operations on Strings
4. Reverse
Eg:
W={a,b,c}
R
W ={c,b,a}
Basic Mathematical Notation Techniques
Operations on Strings
5. Powers of an alphabet
6. Kleen Closure
Eg:
Σ ={a}
* ={Ɛ, a, aa, aaa,….}
Basic Mathematical Notation Techniques
Operations on Strings
7. Palindrome
Eg: W=123
Prefix={1,12,123}
Suffix={3,32,321}
Basic Mathematical Notation Techniques
3. 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:
Where,
Where,
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