Theory of Computation BSC CSIT Old Questions

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

https://genuinenotes.

com
Tribhuvan University
Institute of Science and Technology
2067

Bachelor Level/ Second Year/ Fourth Semester/ Science FM : 80


Computer Science and Information Technology (CSc. 251) PM : 32
(Theory of Computation)

Attempt all the questions.


Group A (8x4=32)
1.
DFA?
2. Give the DFA accepting the strings over {a, b} such that each string does not start
with ab.
3. Give the regular expression for the following languages.
a. L= {SS {a, b}* and S starts with aa or b and does not contains substring bb .
b. {0, 1}* and 0 occurs in pairs if any and ends with 1.
4. Convert following regular grammar in to Finite Automata.

5. Convert following grammar into a equivalent PDA


S
6. What is a multi track Turing Machine? How it differs with single track machine?
7. Construct a Turing Machine that accepts the language of palindrome over {a, b}*
with each string of odd length.
8. What is an algorithm? Explain on the basis of Church Hypothesis.
Group B (6x8=48)
9. - NFA can be converted into NFA and DFA? Explain with a suitable
example.
10. Find the minimum state DFA equivalent to the following DFA.
State 0 1
B C
B B D
C E D
D E D
*E A D
11. Show that a language L is accepted by some DFA if and only if L is accepted by s.
12. Define the language of PDA that accepts by Final State. Explain how a PDA
accepting empty stack can be converted into a PDA by final state.
13. Explain about multi tape TM. Show that every language accepted by a multi-tape
Turning Machine is also accepted by one tape Turning Machine.
14. Write short motes on:
a. Decidable Vs Un-decidable problems.
b. Unrestricted Grammar
c. NP-completeness
d. CNF-SAT Problem.

IOST, TU
https://genuinenotes.com
https://genuinenotes.com

Tribhuvan University
Institute of Science and Technology
2067

Bachelor Level/ Second Year/ Fourth Semester/ Science FM:80


Computer Science and Information Technology (CSc. 251) PM:32
(Theory of Computation)

Attempt all the questions.


Group A (8X4=32)

1. What is DFA? How it differ with a NFA? Explain.


2. Give the DFA for language of strings over {0, 1}in which each strings end with 11.
3. For a regular expression (a+b)*baa, construct ε-NFA.
4. Define the term parse tree, regular grammar, sequential form and ambiguous
grammar.
5. Give the formal definition of NPDA. How it differs with DPDA? Explain.
6. Construct a Turning Machine that accepts a language of strings over (a, b) with
each string of even length. Show how it accepts string abab.
7. Give the formal definition of Turning Machine. How it differs from PDA?
8. Explain about the Unrestricted Grammar.
Group B (6x8=48)

9. Show that a language L is accepted by some DFA if and only if L is accepted by


some NFA.
10. State and prove pumping lemma for regular language. Show by example how it
can be used to prove a language is not a regular.
11. Define Context Free Grammar. Given the following CFG.
S →0AS | 0, A → SIA| SS | 10
For the string 001001100, Give the left most and right most derivation and also
construct a parse tree.
12. Define deterministic PDA. Design a PDA that ac c ept a language L = {anbn |
n>0}. You may accept either by empty stack or by final state.
13. Describe a Universal Turing Machine and its operations. What types of languages
are accepted by Universal TM?
14. Explain about the Chomsky Hierarchy of the language.

IOST, TU

https://genuinenotes.com
https://genuinenotes.com

Tribhuvan University
Institute of Science and Technology
2068

Bachelor Level/ Second Year/ Fourth Semester/ Science FM:80


Computer Science and Information Technology (CSc. 251) PM:32
(Theory of Computation)
Attempt all the questions.
Group A (8X4=32)
1. Define finite automata. Give the formal definition of deterministic finite automata with example.
2. Give the DFA for language of strings over{a,b} where no two consecutive a.’s occurred.
3. Show that language of palindrome over {a,b} is not a regular language.
4. What do you mean by a CNF grammar? Convert following grammar in CNF.
S → AC|ɛ, A → aS|a, c → BC|aC|b.
5. Define Deterministic Push Down Automata. How it differs with a Finite Automata.
6. Give formal definition of Turing Machine. Explain the roles of Turing Machine.
7. Construct a Turing machine that accepts the language of palindrome over {a,b}* with each
strings of even length.
8. What is universal language? Explain.

Group B (6X8=48)
9. Show that for any regular expression, there is a NFA that accepts the same language
represented by r. Convert the regular expression (a+b) (aa+ba)* + ab(a+b)* bba into NFA.
10. How a NFA can be converted into a DFA? Convert the following NFA into equivalent DFA.
0,1

P 0 Q 0,1 R 0,1
SS

11. Define CFG. Convert the following CFG into Chomsky Normal Form.
S → |Sbb|aabb|Aa|Bb|
A → Aa|a,
B → Bb|b|ɛ
12. Define the language of PDA that accepts by Final state. Explain, how a PDA accepting by empty
stack can be converted into a PDA final state.
13. Explain about multi tape TM. Show that every language accepted by a multi-tape Turing Machine
is also accepted by one tape Turing Machine.
14. Explain the following terms.
(a) Big Oh and Big Omega
(b)Class P and NP
(c)CNF SAT Problem
(d)Turing Decidable and Acceptable problems.

IOST, TU

https://genuinenotes.com
https://genuinenotes.com
Tribhuvan University
Institute of Science and Technology
2069

Bachelor Level/ Second Year/ Fourth Semester/ Science Full Marks: 80


Computer Science and Information Technology (CSc. 251) Pass Marks: 32
(Theory of Computation) Time: 3 hours

Candidates are required to give their answers in their own words as far as practicable.
The figures in the margin indicate full marks.

Attempt all the questions.


Group A (8x4=32)

1. What do you mean by finite automata? Explain deterministic finite automata with example.
2. Explain the finite automata with Epsilon Transition.
3. Explain the closure properties of context free languages with example.
4. Differentiate between deterministic and non-deterministic PDA.
5. Explain the non-deterministic Turing machines with example.
6. Define the Turing machine. What are the roles of Turing machines?
7. What is a universal Turing machine?
8. Differentiate between class P and class NP.

Group B (6x8=48)

9. Design a constructive method to prove that the complement of the language accepted by an NFA is accepted
by a DFA.
10. What do you mean by regular expressions? Explain with example of pumping lemma for regular languages.
11. Define the non-deterministic finite automata (NFA) and write down recursive definition of for NFA and A.
12. Draw Turing machine to accept palindromes over {a, b}.
13. Give a detailed description of ambiguity in context free grammar.
14. Explain the following:
a) Minimization of finite state machine
b) Push down automata (PDA).
c) Halting problems
d) Computational complexity

IOST, TU

https://genuinenotes.com
https://genuinenotes.com
Tribhuvan University
Institute of Science and Technology
2070

Bachelor Level/ Second Year/ Fourth Semester/ Science Full Marks: 80


Computer Science and Information Technology (CSc. 251) Pass Marks: 32
(Theory of Computation) Time: 3 hours

Candidates are required to give their answers in their own words as far as practicable.
The figures in the margin indicate full marks.

Attempt all the questions.


Group A (8x4=32)

1. Differentiate between deterministic and non-deterministic finite automata.


2. What do you mean by pumping lemma for regular languages?
3. Explain the non-deterministic PDA with example.
4. Define Turing Machines. Draw NFA - ^ corresponding to following regular expression over ∑ = {0,1}
010* + 0(01+10)* 11
5. Explain about recursive enumerable and recursive language.
6. Explain the computational complexity with example.
7. Differentiate between class P and class NP.
8. Compare FA, NFA and NFA- ^ with illustration.

Group B (6x8=48)

9. Define finite automata and draw FA for the strings.


10. For the following regular expression draw an NFA - ^ recognizing the corresponding languages.
i. (00 +1)*(10)*
ii. 001*0*11
11. Define CFG. Prove the following CFG is ambiguous.
S→S+S | S*S | (S) | a
Write the unambiguous CFG for the above grammar.
12. Draw Turing Machine (TM) to accept palindromes over {a, b}. (Even as well as odd Palindromes).
13. Prove that any regular language can be accepted by a finite automata with all details.
14. Explain the following:
a) Regular Grammar
b) Halting problem
c) Chomsky hierarchy
d) NP-complete Problem

IOST, TU

https://genuinenotes.com
https://genuinenotes.com

Tribhuvan University
Institute of Science and Technology
2071

Bachelor Level/ Second Year/ Fourth Semester/ Science Full Marks : 80


Computer Science and Information Technology (CSc. 251) Pass Marks : 32
(Theory of Computation) Time : 3 hours

Attempt all the questions :


Group A
(8x4=32)

1.) Explain the extended transition function of NFA.


2.) Construct a DFA that accepts all the strings of alphabet {a,b} having each strings with even
number of 0’s and even number of 1’s.
3.) How can you convert an ɛ-NFA into equivalent DFA? Explain.
4.) What are the regular operators applied to the regular languages? Explain with example.
5.) Simplify the following regular expressions.
a.) 1*+1*0(ɛ+0+1)*ø
b.) ɛ+0+1+( ɛ+0+1)( ɛ+0+1)*( ɛ+0+1)

6.) what do you mean by a CNF grammar? Convert the following grammar into CNF.
S→abSb | aa
7.) what are unrestricted grammar? How they differ with CFG? Explain.
8.) Define the term Class P and Class NP with example.

Group B (6x8=48)

9.) What are the algebraic rules for regular expressions? Also show that if L, M, N are any regular
language then show that L(M U N) = L.M U L.N.
10.) Prove that for any given NFA N accepting a language L there exists a DFA D such that L(N) = L(D).
11.) Define regular grammar. Show with suitable example that the language described by regular
grammar are accepted by a finite automata.
12.) What do you mean by the Chomsky Heirarchy in the formal language theory? Explain in detail.
13.) Construct a PDA that accepts a language of palindrome of even length from an alphabet {a,b}.
14.) Show that a Turing Machine with one tape and a Turing Machine with multiple tape are
equivalent.

IOST, TU

https://genuinenotes.com
https://genuinenotes.com
Tribhuvan University
Institute of Science and Technology
2072


Bachelor Level/ Second Year/ Fourth Semester/ Science Full Marks: 80


Computer Science and Information Technology (CSc. 251) Pass Marks: 32
(Theory of Computation) Time: 3 hours

Candidates are required to give their answers in their own words as far as practicable.
The figures in the margin indicate full marks.

Attempt all the questions.


Group A (8x4=32)

1. Define the term: Kleene closure, union, concatenation and power of an alphabet with example.
2. Construct a DFA that accepts only the strings ab, abb and baa not more from {a, b}*.
3. Find the regular expression corresponding to the following languages over {0, 1}*.
a) The language of all strings containing exactly two 0's.
b) The language of all strings containing 00 or 101 as substrings.
4. Construct the FA recognizing the language corresponding to the following regular expressions.
a) (11 + 10)*01
b) (111 + 100)*10
5. State the pumping lemma for regular language. Show by example, how can you use it to prove that a
language is not regular.
6. Explain the method to convert a given CFG into equivalent PDA.
7. What do you mean by problem reduction? Also explain about NP-Completeness.
8. What is the role of a Turing machine? Explain.
Group B (6x8=48)

9. What is finite automata? Describe its different variations with suitable examples.
10. Describe the method of subset construction to convert a given NFA into equivalent DFA with suitable
example.
11. Give the formal definition of Push Down Automata. Construct a PDA accepting the language
n n
L  {0 1 | n  0}
12. Given the following grammar,
S → AAC |
A → aAb | ab | ɛ
C → aC | a | ɛ
Simplify the grammar and convert it into equivalent grammar in CNF.
13. Define a Turing machine. Construct a Turing machine that accepts the languages
n
L  {a bn | n  0}
14. Write short notes on (Any two):
a) Unrestricted Grammar
b) Universal Turing Machine
c) CNF-SAT problem Complexity
IOST, TU

https://genuinenotes.com

You might also like