×
DREAM IT. BELIEVE IT. ACHIEVE IT.
--Your friends at LectureNotes
Close

Note for Theory Of Computation - TC by Dr. D. Jagadeesan

  • Theory Of Computation - TC
  • Note
  • Sreenivasa Institute of Technology and Management Studies -
  • Computer Science Engineering
  • B.Tech
  • 5 Topics
  • 42350 Views
  • 518 Offline Downloads
  • Uploaded 1 year ago
0 User(s)
Download PDFOrder Printed Copy

Share it with your friends

Leave your Comments

Text from page-2

SITAMS – B.Tech – III Year - II Sem CSE 13CSE 321 – Theory of Computation Dr. D. Jagadeesan, B.E., M.Tech., Ph.D., Professor in CSE, Unit – I  There is a finite control which determines the state of the automaton and also controls the movement of the head. Basic Definitions  Symbol : Symbol is a character. Example : a,b,c,… , 0,1,2,3,….9 and special characters.  Alphabet : An alphabet is a finite, nonempty set of symbol. It is denoted by ∑. Example : a) ∑ = {0,1}, the set of binary alphabet. b) ∑ = {a,b……..z}, the set of all lowercase letters. c) ∑ = {+, &,…..}, the set of all special characters.  String or Word : A string is a finite set sequence of symbols chosen from some alphabets. Example : a) 0111010 is a string from the binary alphabet ∑ = {0,1} b) aabbaacab is a string from the alphabet ∑ = {a,b,c}  Empty String : The empty string is the string with zero occurrences of symbols (no symbols). It is denoted by є.  Length of String : The length of a string is number of symbols in the string. It denoted by |w|. Example : w = 010110101 from binary alphabet ∑ = {0,1} Length of a string |w| = 9 2 / 28

Text from page-3

SITAMS – B.Tech – III Year - II Sem CSE 13CSE 321 – Theory of Computation Dr. D. Jagadeesan, B.E., M.Tech., Ph.D., Professor in CSE, Unit – I  Power of an Alphabet:  If ∑ is an alphabet, we can express the set of all strings of certain length from that alphabet by using an exponential notation. It is denoted by ∑k is the set of strings of length k, each of whose symbols is in ∑. Example : ∑ = {0,1} has 2 symbols i) ∑1 = {0,1} ( 21 = 2) ii) ∑2 = {00, 01, 10, 11} ( 22 = 4) iii) ∑3 = {000,001,010,011,100,101,110,111} ( 23 = 8)  The set of strings over an alphabet ∑ is usually denoted by ∑*. For instance, ∑* = {0,1}* = {є,0,1,00,01,10,11} (∑*=∑0∑1∑2……) - with є symbol.  The set of strings over an alphabet ∑ excluding є is usually denoted by ∑+. For instance, ∑+ = {0,1}+ = {0,1,00,01,10,11} (∑+=∑*- {є} or ∑1∑2∑3…..…) - without є symbol.  Concatenation of String Join the two or more strings. Let x and y be two strings. Concatenation of strings x and y is appending symbols of y to right end of x. x = a1a2a3……………an and y = b1b2b3……………bn Concatenation of String xy = a1a2a3……an b1b2b3….…bn Example : s = ababa and t = cdcddc Concatenation st = ababacdcddc  Languages: If Σ is an alphabet, and L  Σ* then L is a language. Examples: o The set of legal English words o The set of legal C programs o The set of strings consisting of n 0's followed by n 1's { ϵ, 01,0011,000111, …}  Operations on Languages  Complementation Let L be a language over an alphabet Σ. The complementation of L, denoted byL, is Σ*–L.  Union Let L1 and L2 be languages over an alphabet Σ. The union of L1 and L2, denoted by L1L2, is {x | x is in L1 or L2}.  Intersection Let L1 and L2 be languages over an alphabet Σ. The intersection of L1 and L2, denoted by L1L2, is { x | x is in L1 and L2}. 3 / 28

Text from page-4

SITAMS – B.Tech – III Year - II Sem CSE 13CSE 321 – Theory of Computation Dr. D. Jagadeesan, B.E., M.Tech., Ph.D., Professor in CSE, Unit – I  Concatenation Let L1 and L2 be languages over an alphabet Σ. The concatenation of L1 and L2, denoted by L1L2, is {w1w2| w1 is in L1 and w2 is in L2}.  Reversal Let L be a language over an alphabet Σ. The reversal of L, denoted by Lr, is {wr| w is in L}.  Kleene’s closure Let L be a language over an alphabet Σ. The Kleene’s closure of L, denoted by L*, is {x | for an integer n  0 x = x1 x2 … xn and x1, x2 , …, xn are in L}. ∞ * L = U Li (e.g. a* ={,a,aa,aaa,……}) i=0  Positive Closure Let L be a language over an alphabet Σ. The closure of L, denoted by L+, is { x |for an integer n  1, x = x1x2…xn and x1, x2 , …, xn are in L} ∞ + L = U Li (e.g. a* ={a,aa,aaa,……}) i=1 Finite Automaton Automaton is an abstract computing device. It is a mathematical model of a system, with discrete inputs, outputs, states and set of transitions from state to state that occurs on input symbols from alphabet Σ.  It representations: o Graphical (Transition Diagram or Transition Table) o Tabular (Transition Table) o Mathematical (Transition Function or Mapping Function)  Formal Definition of Finite Automata A finite automaton is a 5-tuples; they are M=(Q, Σ, δ, q0, F) where Q is a finite set called the states Σ is a finite set called the alphabet δ : Q ×Σ → Q is the transition function q0 ∈ Q is the start state also called initial state F ⊆ Q is the set of accept states, also called the final states  Transition Diagram (Transition graph) It is a directed graph associated with the vertices of the graph corresponds to the states of the finite automata. (or) It is a 5-tuple graph used state and edges represent the transitions from one state to other state. 1 Example: 0 1 1 q0 Start or Initial State 0 q1 qq22 Final or Accepting State 4 / 28

Text from page-5

SITAMS – B.Tech – III Year - II Sem CSE 13CSE 321 – Theory of Computation Dr. D. Jagadeesan, B.E., M.Tech., Ph.D., Professor in CSE, Unit – I  Transition Table. It is the tabular representation of the DFA. For a transition table the transition function is used. Example: States {q0} {q1} *{q2} Input 0 {q1} - 1 {q0} {q2} -  Transition Function. - The mapping function or transition function denoted by δ. - Two parameters are passed to this transition function: (i) current state and (ii) input symbol. - The transition function returns a state which can be called as next state. δ ( current_state, current_input_symbol ) = next_state Example: δ ( q0, a ) = q1  Computation of a Finite Automaton o The automaton receives the input symbols one by one from left to right. o After reading each symbol, M1 moves from one state to another along the transition that has that symbol as its label. o When M1 reads the last symbol of the input it produces the output: accept if M1 is in an accept state, or reject if M1 is not in an accept state.  Applications o It plays an important role in complier design. o In switching theory and design and analysis of digital circuits automata theory is applied. o Design and analysis of complex software and hardware systems. o To prove the correctness of the program automata theory is used. o To design finite state machines such as Moore and mealy machines. o It is base for the formal languages and these formal languages are useful of the programming languages.  Types of Finite Automata o Finite Automata without output o Deterministic Finite Automata (DFA) o Non-Deterministic Finite Automata (NFA or NDFA) o Non-Deterministic Finite Automata with ε move (ε-NFA or ε-NDFA) o Finite Automata with output o Moore Machine o Mealy Machine 5 / 28

Lecture Notes