0% found this document useful (0 votes)
14 views

CLASS ASSIGNMENT NO2-toc

Uploaded by

rootsha
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)
14 views

CLASS ASSIGNMENT NO2-toc

Uploaded by

rootsha
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/ 2

6 TH sem.

SUBMISSION DATE: 16TH APRIL 2015

THEORY OF COMPUTATION
CLASS ASSIGNMENT NO: 1
1) Explain Chomsky Normal Form (CNF)
2) Explain following :
(i) Regular Grammar (ii) Context free grammar
3) Design CFG for following language
a) L = {0i 1 j 0 k | j > i+ k
b) L = { a i b j ck | i=j or j = k }
4) For following CFG’s , describe the language it accepts
a) S SS | XaXaX | ^
X bX | ^
b) S aM | bS
M aF | bS
F aF | bF | ^
c) S aS | bS |a| b| ^
5) For below CFG find a CNF form
S AaA | CA | BaB
A aaBa | CDA | aa | DC
B bB | bAB | bb | aS
C Ca | bC | D
D bD |^
6) Prove that following CFG is ambiguous and also write unambiguous grammar for
same and draw a parse tree for string a + a * a
S S +S | S-S | S *S | (S) |a
7) Show that CFG S a | Sa | bSS | SSb | SbS is ambiguous
8) Find equivalent unambiguous grammar for following CFG
S A|B
A aAb | ab
B abB | ^
9) Explain derivation tree, expression tree and ambiguity with example
10) Convert following CFG to CNF
S AACD | ACD | AAC | CD | AC | C
A aAb | ab
C aC | a
D aDa | bDb| aa | bb
11) Give difference between top down parsing and bottom up parsing
12) Write theorem : If L1 and L2 are two context free languages , then the language L1U
L2, L1 ∩L2 and L1* are also CFLs.
13) Explain bottom up parsing with example.
14) Give transition table for deterministic PDA recognizing following language
L = { an bn+m cm | n,m ≥ 0 }

PACIFIC SCHOOL OF ENGINEERING


15) Give transition table for PDA recognizing the following language
L = { ai bj ck | i,j,k ≥0 and j =i or j = k }
16) For language L = { xcxr | x ∈ {a,b}* } design PDA and trace it for string “abcba”
17) Design and draw deterministic PDA accepting “Balanced string of Brackets “ which
are accepted by following CFG
S SS | [ S ] | { S } | ^
18) Prove : There are context free languages L1 and L2 so that L1 ∩L2 is not a CFL and
there is a CFL L so that L’ is not a CFL
19) Design PDA for L = { x ∈ {a,b}* | na(x) > nb(x) }
20) Define a turing machine. Describe it’s capabilities. Also write a short note on
Universal turing machine.
21) Draw a TM for L = { SS | S ∈ {a,b}* }
22) Draw a transition diagram for turing machine accepting the following language
L = { x ∈ {a,b,c}* | na(x) = nb(x) = nc (x)}
23) Draw a transition diagram for turing machine accepting the following language
L = { an bn cn | n ≥ 0}
24) Draw a turing macine to accepts palindrome over {a,b} ( eben as well as odd
palindrome)
25) Design a TM which recognizes words of form www over alphabet {a,b}
26) Explain recursive functions.
27) Explain halting problem
28) Explain Church turing hypothesis
29) Write a short note on primitive recursive functions and operations.
30) Write theorem : Let f: Σ1 * Σ2* . Then f is computable if and only if f is
recursive
31) Define following :
(i) Initial Functions (ii) Composition
(iii) The primitive recursive functions (iv) Polynomial time reducibility
(v) NP hard and NP complete Problems (vi) The sets P, NP, Pspace and NPspace
(vii) Basic complexity classes (viii) Step counting functions
(ix) The time and space complexity of turing machine

32) Write a difference between NP hard and NP complete


33) Explain P and NP completeness
34) Explain Cook’s theorem

PACIFIC SCHOOL OF ENGINEERING

You might also like