100% found this document useful (1 vote)
118 views8 pages

Chapter Wise Question Bank (1)

Uploaded by

Riya Kaku
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
118 views8 pages

Chapter Wise Question Bank (1)

Uploaded by

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

CE-CSE THEORY OF COMPUTATION (3160704)

Let f be a function from the set 𝐴 = {1,2,3,4} to 𝐵 = {𝑝, 𝑞, 𝑟, 𝑠}


CHAPTER-1

such that, 𝑓 = {(1, 𝑝)(2, 𝑝)(3, 𝑞)(4, 𝑠)}. Is 𝑓 −1 a function?


Question 1 3 Marks

𝐿 is defined recursively as follows: 1. 𝜖 ∈ 𝐿 2. ∀𝑥 ∈ 𝐿, both


0𝑥 and 0𝑥1 are in𝐿. Prove that: For every 𝑛 >= 0, every 𝑥
Question 2 4 Marks

belongs to 𝐿 obtained by n applications of rule 2 is an element of


L
Question 3 Say whether the statement (p ᴧ (p → q)) → q is tautology or 3 Marks
contradiction.
Question 4 The given relation R on set A= {1,2,3} determine whether the 4 Marks
Relation is reflexive, symmetric or transitive, give reason. R =
{(1,1), (1,2), (2,1), (2, 2), (3,2),(3,3)} (2-times)
Question 5 7 Marks

Question 6 Define: Set, Subset, Complement 3 Marks


Question 7 Write and explain the principle of mathematical induction using 7 Marks
example.
Question 8 Define the following functions: one-one, on-to, and inverse 3 Marks
Question 9 Prove “There must be a prime number between n and n!” 4 Marks
Question 10 Define one-to-one, onto and bijection function 3 Marks
Question-11 Write Principle of Mathematical Induction. Prove that for every n 7 Marks
≥ 1, 1 + 3 + 5 + … + (2n - 1) = n2

CHAPTER-2
Question 1 Discuss “Distinguishability” of one string from another and 7 Marks

the example of 𝐿 = {𝑎, 𝑏} ∗ {𝑎𝑏𝑎}, how do the distinguishable


explain how it affects the number of states in an FA. Considering

strings in L relate to the number of states in its FA?


Question 2 Define: Grammar 3 Marks
Question 3 What are similarities and differences between Moore machines 4 Marks

Given two languages 𝐿1 and 𝐿2, defined as: 𝐿1 = {𝑥 | 𝑎𝑙𝑙 𝑥


and Mealy machines? (2-times)

𝑠𝑡𝑎𝑟𝑡 𝑤𝑖𝑡ℎ 𝑎𝑏𝑎 } 𝐿2 = {𝑥 | 𝑎𝑙𝑙 𝑥 𝑒𝑛𝑑𝑠 𝑖𝑛 𝑏𝑏} Write the


Question 4 7 Marks

regular expression for both the languages and construct FAs 𝑀1


and 𝑀2 such that 𝑀1 accepts 𝐿1 and 𝑀2 accepts 𝐿2. Derive
𝐿1 ∩ 𝐿2
Question-5 Draw the given NFA in Table-1 and convert it to FA and identify 7 Marks
the language. q0 is the initial state and q1 is the accepting state.
Question-6 Draw NFA lambda for the given regular expression: 3 Marks
(0)* (00 + 11)* (001) (01 + 10)
Question-7 Define FA and Write recursive definition of NFA (2-times) 3 Marks
Question-8 Find a regular expression of followingsubsets of {0, 1}* 4 Marks
1 | B. H. Gardi College of Engineering & Technology
CE-CSE THEORY OF COMPUTATION (3160704)

1. The language of all strings that begin or end with 00 or 11.


2. The language of all strings ending with 1 and not containing 00
(2- times)
Question-9 7 Marks

(2-times)
Question-10 Define mealy machine. Design and mealy machine that gives 4 Marks
output ‘x’ if input of sequence is abb, otherwise z

Question-11 Convert NFA- Λ to FA for following figure. 7 Marks

Question-12 Convert the given Moore machine into Mealy machine. Draw 4 Marks
state transition diagram of Mealy machine.

(i). (0 + 1) ∗ (1 + 00)(0 + 1) ∗
Question-14 Draw Finite automata for following regular expression: 7 Marks

(ii). (111 + 100) ∗0


Question-15 Find a regular expression corresponding to each of the following 4 Marks
subsets of {0,1}*

2 | B. H. Gardi College of Engineering & Technology


CE-CSE THEORY OF COMPUTATION (3160704)

(i) the language of all strings that do not end with 01


(ii) the language of all strings that begin with or end with 00 or 11
Question-16 Explain procedure to minimize finite automata 7 Marks
Question-17 Define Regular grammar and give example. 3 Marks
Question-18 Write down 5-tuple definition for the finite automata. Construct 7 Marks
the minimal finite automata over Σ = {a,b} for the following
languages. L1 = {Where all the strings start and ends with
different symbol}
L2 = {Where every string has odd occurrences of “ba”}
Question-19 Enlist types of grammars, types of languages and types of 3 Marks
automata
Question-20 Construct the Moore machine that counts the no. of occurrences 7 Marks
of substring “bba” over Σ = {a,b}. Now convert this Moore
machine into Mealy machine. Show the transition table and
transition diagram for both the machines.
Question-21 Define the steps to convert ε -NFA into NFA. Then convert the 7 Marks
following ε -NFA into NFA

Question-22 Construct the regular expressions for the following languages. 4 Marks
L1 = {Where the no. of ‘a’ is odd}, Σ = {a,b}
L2 = {Where every string starts with ‘0’ and of even length}, Σ =
{0,1}
Question-23 Construct the regular expressions for the following languages. 4 Marks
L1 = {Where every string starts with ‘b’ and does not contain 2
consecutive a’s}, Σ = {a,b}
L2 = {Where every string starts with ‘1’ and of odd length}, Σ =
{0,1}
Question-24 Draw Finite Automata to accept following over input alphabets Σ 7 Marks
={0, 1}
(i) The language accepting strings not ending with ’01’ . (
(ii) iThe language accepting strings next to last symbol
‘0’
Question-25 Convert NFA- Λ to FA for following figure. 7 Marks

3 | B. H. Gardi College of Engineering & Technology


CE-CSE THEORY OF COMPUTATION (3160704)

Question-26 Design and mealy machine that gives output 1 if input of 4 Marks
sequence abb comes, other wise 0.
Question-27 Find minimum state FA for following figure. 7 Marks

CHAPTER-3 Marks
Question 1 Explain the Pumping Lemma for Context Free Languages. 4 Marks
Question 2 Convert the following grammar to CNF. 7 Marks
S → ABA
A → aA | ϵ
B → bB | ϵ
Question 3 Find context-free grammar for the language: L= {aib j c k | i=j+k} 3 Marks
(2-times)
Question 4 Define Ambiguous grammar. for following grammar say whether 4 Marks
the grammar is ambiguous or not. give reason S→ABA, A→aA |
Λ , B→bB | Λ (2-times)
Question-5 Write Kleen’s Theorem part -1 (3-times) 7 Marks
Question-6 Using kleene's Theorem Draw NFA-Λ for a given RE 4 Marks
aa(ba)*+b*aba*
Question-7 Define Context free grammar & context free language 3 Marks
Question-8 Write CFG for following 4 Marks
(i) L={a ib j c k | i=j or j=k}
(ii) (ii) L={a ib j c k | j>i+k}
Question-9 Convert following CFG to CNF: S -> S(S)/^ 7 Marks
Question-10 Explain types of derivation and ambiguity. 4 Marks
Question-11 Convert following CFG to CNF: 7 Marks
S->aX/Yb X->S/^ Y->bY/b
Question-12 Define type 2 grammar with example 3 Marks
Question-14 Define: CNF. Show the steps to convert CFG into CNF. Convert 7 Marks
the following CFG into equivalent CNF.
S→TU

4 | B. H. Gardi College of Engineering & Technology


CE-CSE THEORY OF COMPUTATION (3160704)

T → 0T1 | ε
U → 1U0 | ε

language L= {ww / w ∈{a,b}*} is not context free language using


Question-15 Define pumping lemma for context free language. Show that the 4 Marks

pumping lemma theory.


Question-16 Explain ambiguous and unambiguous context free grammar with 7 Marks
example.
Question-17 Give an unambiguous grammar for SIMPLE CALCULATOR 4 Marks
contain +, -, *, /,(,) operator for terminal ‘id’. And draw a parse
tree for (id+id)*id-id
Question-18 Find the CFG for the regular expression : (01*1 + 1)* (01)* 3 Marks
Question-19 Using kleene's Theorem Draw NFA-Λ for ((0+1)*10 + (00)*)* 7 Marks
Question-20 Given the context-free grammar G, find a CFG G’ in Chomsky 7 Marks
Normal Form.
S -> AaA | CA | BaB
A -> aaBa | DC
B -> bb | aS
C -> Ca | bC | D
D -> bD | Λ

CHAPTER-4

Question 1 What are non-CFLs? Give at-least two examples of non-CFLs. 3 Marks

Question 2 Show Bottom Up Parsing of the string “id + id * id” using the 7 Marks
following grammar.
E→E+T|T
T→T*F|F
F → (E) | id
Question 3 Define PDA. State whether a PDA can accept a CFL or not. 3 Marks
Question 4 Discuss the closure properties of CFLs. (2 times) 4 Marks
Question 5 Compare NPDA with DPDA. 3 Marks
Show that if there are strings 𝑥 and 𝑦 in the language 𝐿 so that
𝑥 is a prefix of 𝑦 and 𝑥 ≠ 𝑦, then no DPDA can accept 𝐿 by
Question 6 4 Marks

empty stack.
Question 7 State pumping lemma for regular languages 3 Marks
Question 8 Construct PDA for 4 Marks
S → 0AB
A → 1A | 1
B → 0B | 1A | 0
Trace the string 01011 using PDA
Question 9 Define Push Down Automata (2-times) OR 3 Marks

5 | B. H. Gardi College of Engineering & Technology


CE-CSE THEORY OF COMPUTATION (3160704)

What is a pushdown automaton? Explain


Question 10 Given the context-free grammar G, find a CFG G’ in Chomsky 7 Marks
Normal Form.
S -> AaA | CA | BaB
A -> aaBa | DC
B -> bb | aS
C -> Ca | bC | D
D -> bD | Λ
Question 11 Design a PDA to accept L = {xcy | x, y∈ (a,b)* and |x| = |y|}. (2- 4 Marks
times)
Question 12 Design a PDA to accept L = {aib jC k | j = i+k}. (2-times) 4 Marks
Question 13 Give the difference between top down and bottom-up parsing. 4 Marks
Question 14 Design and draw deterministic PDA Accepting “Balance string of 7 Marks
brackets”
Question 15 Explain deterministic pushdown automata. 3 Marks
Question 16 Explain conversion from PDA to CFG 4 Marks
Question 17 Design and draw PDA to accept string with more a’s than b’s. 7 Marks
Question 18 Define pumping lemma for regular language. Show that the 4 Marks
language L= {an b n c n / n>=1} is non-regular using pumping
lemma theory.
Question 19 What is Instantaneous Description? Construct the pushdown 7 Marks
automata over Σ = {a,b} for the language L = {an c b n / n>=1}.
Question-20 Define the following operations for Push Down Automata: 3 Marks
PUSH, POP, and SKIP

CHAPTER 5

Question 1 For the given Turing Machine in Table-2, trace the transition for 7 Marks
the strings 1011 and 10101 and identify the language recognized

{q0,q1,q2,q3,q4,q5,q6} ∈ Q, Σ = {0,1}, {0,1,X,Y,B} ∈ Γ, q0 ∈ Q,


by this TM. TM is defined as TM = (Q, Σ, Γ, q0, δ ) where

B ∈ Γ , B ∉ Σ, {q6} is the accepting state.


Question 2 Draw a TM for the Language of strings with balanced parenthesis 7 Marks
“(” and “)” only.
Question 3 When can we say that the language is decidable or undecidable? 3 Marks

language 𝐿 = {0 𝑛1 𝑛 : 𝑤ℎ𝑒𝑟𝑒 𝑛 ≥ 1}
Question 4 Draw only the transition table of Turing Machine to accept the 4 Marks

Show that a Turing Machine to recognize the language 𝐿 = 𝐿(0


∗1) can accept the string without moving the head in L direction.
Question 5 4 Marks

Question 6 Explain Universal Turing Machine (3-times) 3 Marks


Question 7 Develop a Turing Machine to accept palindromes over {a,b}* (2- 7 Marks

6 | B. H. Gardi College of Engineering & Technology


CE-CSE THEORY OF COMPUTATION (3160704)

times)
Question-8 Define grammar and Chomsky hierarchy (2-times) 3 Marks

Na(X)=Nb(X) , X ∈ {a,b}*} (2-times)


Question-9 Develop a Turing Machine to accept the language L = {X / 7 Marks

Question-10 What is Turing machine? Explain its capabilities. 3 Marks


Question-11 Explain Church Turing thesis 4 Marks
Question-12 Design a Turing machine to copy a string 7 Marks
Question-13 Design a Turing machine to delete a symbol 7 Marks
Question-14 Enlist and explain the operations performed by tape in Turing 3 Marks
machine.
Question-15 Enlist closure properties for the context sensitive language. 3 Marks
Question-16 Write down 7-tuple definition for the turing machine. Construct 7 Marks
the turing machine and its transition table over Σ = {a,b} for the
language L = {an b n / n>=1}.

CHAPTER 6

recursive (𝑛 + 1) place predicate, its bounded minimalization 𝑚𝑃


Question 1 Define: Bounded Minimalization and show that, if P is a primitive 7 Marks

is a primitive recursive function.


Question 2 When can the language be called a recursive language or a 3 Marks

Define: 𝜇-Recursive functions and show how all computable


recursively enumerable language?

functions are 𝜇 – recursive.


Question 3 7 Marks

7 | B. H. Gardi College of Engineering & Technology


CE-CSE THEORY OF COMPUTATION (3160704)

Question 4 Explain Primitive Recursive Functions 3 Marks


Question 5 State the following functions: Partial, Constant and Total. 3 Marks
Question 6 What is minimization? Explain with suitable example. 4 Marks
Question 7 Describe: Recursive function. Prove that every recursive function 7 Marks
is computable.

CHAPTER 7
Question 1 Discuss Post’s Correspondence Problem with example. 7 Marks
Question 2 Define the following terms: Recursive language, and Recursive 3 Marks
Enumerable Language.
Question 3 Explain in detail: Class P and Class NP. 4 Marks

Prepared By Approved By
Prof. Palak Vyas Prof. Monika Shah
HOD CE-CSE-IT

8 | B. H. Gardi College of Engineering & Technology

You might also like