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

Theory of Computation Quiz

This document provides a quiz on theory of computation concepts with 4 questions. Question 1 asks about the correctness of a proof that context-free languages are closed under Kleene star and how to correct it if incorrect. It also asks to argue that the suffix of a context-free language is context-free. Question 2 asks to show that a specific language is deterministic context-free and what happens without certain symbols. Question 3 describes a grammar and asks to characterize its language formally and in English, and determine if the grammar is deterministic. Question 4 asks to argue that context-free languages are closed under homomorphism but deterministic context-free languages are not.

Uploaded by

Akshat Gupta
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)
75 views

Theory of Computation Quiz

This document provides a quiz on theory of computation concepts with 4 questions. Question 1 asks about the correctness of a proof that context-free languages are closed under Kleene star and how to correct it if incorrect. It also asks to argue that the suffix of a context-free language is context-free. Question 2 asks to show that a specific language is deterministic context-free and what happens without certain symbols. Question 3 describes a grammar and asks to characterize its language formally and in English, and determine if the grammar is deterministic. Question 4 asks to argue that context-free languages are closed under homomorphism but deterministic context-free languages are not.

Uploaded by

Akshat Gupta
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/ 1

Shiv Nadar University

CSD303: Theory of Computation


Quiz #4

Date: 8-4-2020 Upload by 11.00 on 12-4-2020


Max marks:40

1. Answer all 4 questions. Do it yourself. Don’t exchange answers.


2. You can upload on Blackboard or the upload link that I send by email.

1. (a) Let L be a CFL generated by a CFG G. That is L = L(G), G = (V, Σ, P, S). A student gives
the following simple proof that CFLs are closed under the star operation. That is if L is a CFL
then L? is also a CFL.
Proof. Add the rule S → SS to P to yield P 0 = P ∪ {S → SS} then the grammar G0 =
(V, Σ, P 0 , S) generates the language L? . G0 is clearly a CFG so CFLs are closed under the star
operation.
Is the above proof correct? If yes explain why and if not say why not and correct it (don’t give
a totally different proof).
(b) Let L be any language. Define the language suffix(L) = {v | uv ∈ L, for some u}. So, the suffix
of L contains all strings that are suffixes of any string in L. Argue that if L is a CFL suffix(L) is
also a CFL.
[3,7=10]
2. Show that the language L = {c0m 1n | m 6= n, m, n ≥ 0} ∪ {d0m 12m | m ≥ 0} is a DCFL. What happens
if c and d are not there?
[8,2=10]
3. Consider the grammar G with productions: S → 0S1 | SS | ε, where Σ = {0, 1} and S is the
start symbol.
(a) Describe the language L(G) informally (i.e. in English) and formally (i.e. as a set of strings
following certain constraints).
(b) Is G a DCFG? If yes justify. If not say why not.
[4,6=10]
4. Let L be a language over alphabet Σ. The homomorphism operation h maps symbols in Σ to strings
over Σh including ε. h can be extended to strings as follows: h(w = σ1 . . . σk ) = h(σ1 ) . . . h(σk ) and
then to languages by: h(L) = {h(w) | w ∈ L}.
(a) Argue that CFLs are closed under the homomorphism operation.
(b) Argue that DCFLs are not closed under homomorphism.
[4,6=10]

You might also like