Docsity

Computation two marks, Study notes of Theory of Automata

Toggle sidebar
bg1
SRI RAMAKRISHNA INSTITUTE OF TECHNOLOGY, COIMBATORE-10
(Approved by AICTE, New Delhi – Affiliated to Anna University,
Chennai)
(Accredited by NAAC with ‘A’ Grade and All UG Engineering
Programmes are Accredited by NBA)
Department of Computer Science and Engineering
CS6503-THEORY OF COMPUTATION
UNIT-1 TWO MARKS
1. Why are switching circuits called as finite state systems?
A switching circuit consists of a finite number of gates, each of which can be in
any one of the two conditions 0 or 1.Although the voltages assume infinite set
of values, the electronic circuitry is designed so that the voltages
corresponding to 0 or 1 are stable and all others adjust to these values. Thus
control unit of a computer is a finite state system.
2. Give the examples/applications designed as finite state system.
Text editors and lexical analyzers are designed as finite state systems. A
lexical analyzer scans the symbols of a program to locate strings
corresponding to identifiers, constants etc, and it has to remember limited
amount of information.
3. Define: (i) Finite Automaton(FA) (ii)Transition diagram
FA consists of a finite set of states and a set of transitions from state to
state that occur on input symbols chosen from an alphabet Σ. Finite
Automaton is denoted by a 5- tuple(Q,Σ,δ,q0,F), where Q is the finite set of
states , Σ is a finite input alphabet, q0 in Q is the initial state, F is the set of
final states and δ is the transition mapping function Q * Σ to Q.
Transition diagram is a directed graph in which the vertices of the graph
correspond to the states of FA. If there is a transition from state q to state p on
input a, then there is an arc labeled “a “ from q to p in the transition diagram.
4. What are the applications of automata theory?
In compiler construction.
In switching theory and design of digital circuits.
To verify the correctness of a program.
Design and analysis of complex software and hardware systems.
Robotics.
Artificial Intelligence.
5. What is Moore machine and Mealy machine?
A special case of FA is Moore machine in which the output depends on the
state of the machine. An automaton in which the output depends on the
transition and current input is called Mealy machine.
6. What are the components of Finite automaton model?
pf3
pf4
pf5

Partial preview of the text

Download Computation two marks and more Study notes Theory of Automata in PDF only on Docsity!

SRI RAMAKRISHNA INSTITUTE OF TECHNOLOGY, COIMBATORE-

(Approved by AICTE, New Delhi – Affiliated to Anna University, Chennai) (Accredited by NAAC with ‘A’ Grade and All UG Engineering Programmes are Accredited by NBA) Department of Computer Science and Engineering CS6503-THEORY OF COMPUTATION UNIT-1 TWO MARKS

  1. Why are switching circuits called as finite state systems? A switching circuit consists of a finite number of gates, each of which can be in any one of the two conditions 0 or 1.Although the voltages assume infinite set of values, the electronic circuitry is designed so that the voltages corresponding to 0 or 1 are stable and all others adjust to these values. Thus control unit of a computer is a finite state system.
  2. Give the examples/applications designed as finite state system. Text editors and lexical analyzers are designed as finite state systems. A lexical analyzer scans the symbols of a program to locate strings corresponding to identifiers, constants etc, and it has to remember limited amount of information.
  3. Define: (i) Finite Automaton(FA) (ii)Transition diagram FA consists of a finite set of states and a set of transitions from state to state that occur on input symbols chosen from an alphabet Σ. Finite Automaton is denoted by a 5- tuple(Q,Σ,δ,q0,F), where Q is the finite set of states , Σ is a finite input alphabet, q0 in Q is the initial state, F is the set of final states and δ is the transition mapping function Q * Σ to Q. Transition diagram is a directed graph in which the vertices of the graph correspond to the states of FA. If there is a transition from state q to state p on input a, then there is an arc labeled “a “ from q to p in the transition diagram.
  4. What are the applications of automata theory? In compiler construction. In switching theory and design of digital circuits. To verify the correctness of a program. Design and analysis of complex software and hardware systems. Robotics. Artificial Intelligence.
  5. What is Moore machine and Mealy machine? A special case of FA is Moore machine in which the output depends on the state of the machine. An automaton in which the output depends on the transition and current input is called Mealy machine.
  6. What are the components of Finite automaton model?

The components of FA model are Input tape, Read control and finite control. (a) The input tape is divided into number of cells. Each cell can hold one i/p symbol. (b) The read head reads one symbol at a time and moves ahead. (c) Finite control acts like a CPU. Depending on the current state and input symbol read from the input tape it changes state.

  1. Differentiate NFA and DFA NFA or Non Deterministic Finite Automaton is the one in which there exists many paths for a specific input from current state to next state. NFA can be used in theory of computation because they are more flexible and easier to use than DFA. Deterministic Finite Automaton is a FA in which there is only one path for a specific input from current state to next state. There is a unique transition on each input symbol. (Write examples with diagrams).
  2. What is Є-closure of a state q0? Є-closure (q0) denotes a set of all vertices p such that there is a path from q to p labeled Є. Example: Є-closure(q0)={q0,q1}
  3. What is a: (a) String (b) Regular language A string x is accepted by a Finite Automaton M=(Q,Σ,δ.q0,F) if δ(q0,x)=p, for some p in F.FA accepts a string x if the sequence of transitions corresponding to the symbols of x leads from the start state to accepting state. The language accepted by M is L(M) is the set {x | δ(q0,x) is in F}. A language is regular if it is accepted by some finite automaton.
  4. What is a regular expression? A regular expression is a string that describes the whole set of strings according to certain syntax rules. These expressions are used by many text editors and utilities to search bodies of text for certain patterns etc. Definition is: Let Σ be an alphabet. The regular expression over Σ and the sets they denote are: ▲ Φ is a r.e and denotes empty set. ▲ Є is a r.e and denotes the set {Є} ▲ For each “a‟ in Σ , a+ is a r.e and denotes the set {a}. ▲ If “r‟ and “s‟ are r.e denoting the languages R and S respectively then (r+s), ▲ (rs) and (r) are r.e that denote the sets RUS, RS and R respectively.
    1. Differentiate L* and L+ L* denotes Kleene closure and is given by L* =U example : 0* ={Є ,0,00,000,…………………………………} Language includes empty words also. L+ denotes Positive closure and is given by L+ =U Li example : 0+ ={0,00,000,…………………………………} Li
    2. Write a regular expression to denote a language L which accepts all the strings which begin or end with either 00 or 11.

For eg identifier can be expressed as a regular expression as: (letter)(letter +digit)* If anything in the source language matches with this reg exp then it is recognized as an identifier.The letter is{A,B,C,………..Z,a,b,c….z} and digit is {0,1,…9}.Thus reg exp identifies token in a language. Text editors: These are programs used for UNIX text editors uses the reg exp for processing the text. For example substituting the strings such as: S/bbb*/b/ Gives the substitute a single blank for the first string of two or more blanks in a given line. In UNIX text editors any reg exp is converted to an NFA with Є -transitions, this NFA can be then simulated directly.

  1. Regular expression for the language that accepts all strings in which “a‟ appears tripled over the set Σ ={a} regular expression = (aaa)*
  2. What are the applications of pumping lemma? Pumping lemma is used to check if a language is regular or not. (i) Assume that the language (L) is regular. (ii) Select a constant „n‟. (iii) Select a string (z) in L, such that |z|>n. (iv) Split the word z into u,v and w such that |uv|<=n and |v|>=1. (v) You achieve a contradiction to pumping lemma that there exists an “i‟ Such that uviw is not in L. Then L is not a regular language.
  3. What is the closure property of regular sets? The regular sets are closed under union, concatenation and Kleene closure. r1Ur2= r1 +r r1.r2= r1r ( r )=r The class of regular sets are closed under complementation, substitution, homomorphism and inverse homomorphism.
  4. Regular expression for the language such that every string will have atleast one “a‟ followed by atleast one “b‟. R=(a+b)
  5. Write the exp for the language starting with a and has no consecutive b‟ s Regular expression = (a+ab)*

24.Define Theory of computation Theory of computation describes the basic ideas and models underlying computing.It suggests various abstract models of computation,represented mathematically.

25.what are the rules for pumping lemma. Pumping lemma is used to check if a language is regular or not. A. Assume that the language(L) is regular. B. Select a constant n. C. Select a string (z) in L,such that |z|>n. D. Split the word z into u,v,w such that |uv|<=n and |v|>=1. E. Achieve a contradiction to pumping lemma that there exists an I such that uvw,w is not in L.then L is not a regular language.

26.what are the three methods of conversion of DFA to RE? A. Regular expression equation method or transitive closure method B. Arden’s method C. State elimination method.