0% found this document useful (0 votes)
39 views3 pages

Toc Summer 2017

The document describes a test paper for the Theory of Computation subject. It contains 5 questions assessing different topics related to formal languages and automata theory like definitions of DFAs, NFAs, regular expressions, context-free grammars, pushdown automata, Turing machines and properties of formal languages. Students are asked to define concepts, draw diagrams, prove statements using pumping lemmas and design automata.

Uploaded by

Jayraj Rajput
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views3 pages

Toc Summer 2017

The document describes a test paper for the Theory of Computation subject. It contains 5 questions assessing different topics related to formal languages and automata theory like definitions of DFAs, NFAs, regular expressions, context-free grammars, pushdown automata, Turing machines and properties of formal languages. Students are asked to define concepts, draw diagrams, prove statements using pumping lemmas and design automata.

Uploaded by

Jayraj Rajput
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Seat No.: ________ Enrolment No.

___________

GUJARAT TECHNOLOGICAL UNIVERSITY


BE - SEMESTER–VI (NEW) - EXAMINATION – SUMMER 2017
Subject Code: 2160704 Date: 03/05/2017
Subject Name: Theory of Computation
Time: 10:30 AM to 01:00 PM Total Marks: 70
Instructions:
1. Attempt all questions.
2. Make suitable assumptions wherever necessary.
3. Figures to the right indicate full marks.
4. In the questions the symbol Λ denotes the null string, i.e., the string of length zero.

MARKS
Q.1 Answer the following questions:
1 Define onto and one-to-one functions. 02
2 Give recursive definition of a tree. 03
3 Define reflexivity, symmetry, and transitivity properties of relations. 03

4 Consider the relation R = {(1,2), (1,1), (2,1), (2,2), (3,2), (3,3)} defined 03
over {1, 2, 3}. Is it reflexive? Symmetric? Transitive? Justify each of
your answers.
5 Draw truth table for following logic formula: P  (¬P V ¬Q). Is it a 03
tautology? A contradiction? Or neither? Justify your answer.

Q.2 (a) Define DFA and NFA and NFA- Λ 03


(b) Give recursive definitions of the extended transition functions, δ̂ ̂(i.e., 04
for strings) for DFA and NFA.
(c) Minimize the DFA shown in Fig. 1. 07
OR
(c) Consider the NFA-Λ depicted in following table: 07
Λ a b c
p Φ {p} {q} {r}
q {p} {q} {r} Φ
*r {q} {r} Φ {p}

(i) Compute the Λ-closure of each state.

(ii) Convert the NFA-Λ to a DFA.

Q.3 (a) Explain ‘finite state machines with outputs’. Discriminate between 03
Mealy and Moore machines.
(b) Convert the Moore machine shown in Fig. 2 into an equivalent Mealy 04
machine.
(c) Use Pumping Lemma to show that L = {x Є {0,1}* | x is a palindrome} 07
is not a regular language.
OR
Q.3 (a) Give recursive definition of regular expressions. State the hierarchy of 03
the operators used in regular expressions.
(b) Using constructive approach determine NFA- Λ for the regular 04
expression (0 + 1)*1(0 + 1).
(c) Fig. 3 shows two DFAs M1 and M2, to accept languages L1 and L2, 07
respectively. Determine DFAs to recognize L1 U L2.
1
Give formal definition of PDA. Give mathematical description of
Q.4 (a) ‘acceptance of a string by a PDA by empty stack’. 03
(b) Give the recursive definition of the iterated derivation (i.e., derivation 04
in zero or more steps), denoted as =>̽. Give mathematical description of
the language of a CFG.

(c) Consider following grammar: 07


S  A1B
A  0A | Λ
B  0B | 1B | Λ
Give leftmost and rightmost derivations of the string 00101. Also draw
the parse tree corresponding to this string.
OR
Q.4 (a) Define CFG. When is a CFG called an ‘ambiguous CFG’? 03
(b) Consider following grammar: 04
S  ASB | Λ
A  aAS | a
B  SbS | A | bb
i. Eliminate useless symbols, if any.
ii. Eliminate Λ productions.
(c) Convert the following grammar to a PDA: 07
I  a | b | Ia | Ib | I0 | I1
E  I | E * E | E + E | (E)
Q.5 (a) Give definition of Turing Machine. What do you mean by an 03
instantaneous description of a Turing Machine?
(b) Describe recursive languages and recursively enumerable languages. 04
(c) Design a Turing machine to accept the language {0n1n | n ≥ 1}. 07
OR
Q.5 (a) Briefly describe following terms: (1) halting problem (2) undecidable 03
problem
(b) Using pumping lemma for CFL’s, show that the language L = {ambmcn | 04
m ≤ n ≤ 2m} is not context free.
(c) Design a Turing machine for the language over {0,1} containing 07
strings with equal number of 0’s and 1’s.

**********

2
Note: In Fig.3 for Q:3 (c) consider transition from A -> B having symbol 0.

You might also like