0% found this document useful (0 votes)
113 views11 pages

Decision Properties: I) Emptiness Ii) Non-Emptiness Iii) Finiteness Iv) Infiniteness V) Membership

The document discusses decidable and undecidable properties of context-free languages (CFLs), highlighting properties like emptiness, non-emptiness, and membership as decidable, while equality and ambiguity are undecidable. It also presents various questions and answers from exams regarding the closure properties of regular and context-free languages, as well as their intersections and unions. Key conclusions include that context-free languages are not closed under complementation and intersection.

Uploaded by

TECH TUBE
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)
113 views11 pages

Decision Properties: I) Emptiness Ii) Non-Emptiness Iii) Finiteness Iv) Infiniteness V) Membership

The document discusses decidable and undecidable properties of context-free languages (CFLs), highlighting properties like emptiness, non-emptiness, and membership as decidable, while equality and ambiguity are undecidable. It also presents various questions and answers from exams regarding the closure properties of regular and context-free languages, as well as their intersections and unions. Key conclusions include that context-free languages are not closed under complementation and intersection.

Uploaded by

TECH TUBE
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/ 11

Decision properties

• Following properties are decidable in case a CFL. Here we will use Grammar model to proof
decision properties.

i) Emptiness

ii) Non-emptiness

iii) Finiteness

iv) Infiniteness

v) Membership

• Following properties are Undecidable in case a CFL.

i) Equality

ii) Ambiguity

Q Which of the following problems is undecidable? (NET-NOV-2017)


a) To determine if two finite automata are equivalent
b) Membership problem for context free grammar
c) Finiteness problem for finite automata
d) Ambiguity problem for context free grammar
Ans: d

Q Which of the following problems is undecidable? (GATE-2014) (1 Marks)


(A) Deciding if a given context-free grammar is ambiguous.
(B) Deciding if a given string is generated by a given context-free grammar.
(C) Deciding if the language generated by a given context-free grammar is empty.
(D) Deciding if the language generated by a given context-free grammar is finite.
Ans: a
Q Which of the following are decidable? (GATE-2008) (2 Marks)
I. Whether the intersection of two regular languages is infinite
II. Whether a given context-free language is regular
III. Whether two push-down automata accept the same language
IV. Whether a given grammar is context-free
1. I and II 2. I and IV 3. II and III 4. II and IV
ANSWER B

Q Which of the following problems is undecidable? (GATE-2007) (1 Marks)


(A) Membership problem for CFGs (B) Ambiguity problem for CFGs.
(C) Finiteness problem for FSAs. (D) Equivalence problem for FSAs.
Answer: (B)

Q Which of the following are decidable? (GATE-2008) (1 Marks)


i) Whether the intersection of two regular languages is infinite
ii) Whether a given context-free language is regular
iii) Whether two push-down automata accept the same language
iv) Whether a given grammar is context-free
a) I and II b) I and IV c) II and III d) II and IV
ANSWER B

Q Which one of the following statements is FALSE? (GATE-2004) (1 Marks)


a) There exist context free languages such that all the context free grammars generating them
age ambiguous.
b) An unambiguous context free grammar always has a unique parse tree for each string of the
language generated by it.
c) Both deterministic and non – deterministic pushdown automata always accept the same set
of languages
d) A finite set of string from one alphabet is always a regular language.
Ans: c
Q Consider the following decision problems? (GATE-2000) (2 Marks)
(P1) Does a given finite state machine accept a given string
(P2) Does a given context free grammar generate an infinite number of stings
Which of the following statements is true?
(A) Both (P1) and (P2) are decidable (B) Neither (P1) nor (P2) are decidable
(C) Only (P1) is decidable (D) Only (P2) is decidable
Ans: a
Closure Properties of Deterministic Context Free Languages
• Regular languages are closed under following operations
o Complement
o Intersection with regular set
o Inverse Homeomorphism

• Regular languages are not closed under following operations


o Union
o Concatenation
o Kleen closure
o homomorphism
o Substitution
o Reverse operator
o Intersection

Closure Properties of Context Free Languages


• Regular languages are closed under following operations
o Union
o Concatenation
o Kleen Closure
o Substitution
o Homomorphism
o Inverse Homomorphism
o Reverse Operator
o Intersection with regular set

• Regular languages are not closed under following operations


o Intersection
o Complement
o Symmetric Difference
(NET-DEC-2018)

a)

b)

c)

d)

Q Let L1 and L2 be any context-free language and R be any regular language. Then, which of the
following is correct? (GATE-2017) (2 Marks)
I. L1 ∪ L2 is context-free. II. L1' is context-free.
III. L1 - R is context-free. IV. L1 ∩ L2 is context-free.
a) I, II and IV only b) I and III only
c) II and IV only d) I only
Ans: b

Q Consider the following languages over the alphabet ∑= {a, b, c}.


Let L1 = {an bn cm | m, n >= 0} and L2 = {am bn cn | m, n >= 0}.
Which of the following are context-free languages? (GATE-2017) (2 Marks)
I. L1 ∪ L2 II. L1 ∩ L2
a) I only b) II only c) I and II d) Neither I nor II
ANSWER A

Q Context free grammar is not closed under: (NET-NOV-2017)


a) Concatenation b) Complementation
c) Kleene Star d) Union
Ans: b
Q Given the following statements:
(A) A class of languages that is closed under union and complementation has to be closed
under intersection.
(B) A class of languages that is closed under union and intersection has to be closed under
complementation.
Which of the following options is correct? (NET-JAN-2017)
A) Both (A) and (B) are false. b) Both (A) and (B) are true.
c) (A) is true, (B) is false. d) (A) is false, (B) is true.
Ans: c

Q Let L = {0n1n|n ≥ 0} be a context free language. Which of the following is correct? (NET-JULY-
2016)
a) L` is context free and Lk is not context free for any k ≥ 1.
b) L` is not context free and Lk is not context free for any k ≥ 1.
c) Both L` and Lk is for any k ≥ 1 are context free.
d) Both L` and Lk is for any k ≥ 1 are not context free.
Ans: c

Q Which one of the following statements is FALSE? (GATE-2013) (1 Marks)


L1 = {0p 1q 0r ∣ p, q, r ≥ 0} L2 = {0p 1q 0r ∣p, q, r ≥ 0, p ≠ r}
(A) L2 is context-free. (B) L1 intersection L2 is context-free.
(C) Complement of L2 is recursive. (D) Complement of L1 is context-free but not regular.
Answer: (D)

Q Assume the statements S1 and S2 given as : (NET-SEP-2013)


S1: Given a context free grammar G, there exists an algorithm for determining whether L(G) is
infinite.
S2: There exists an algorithm to determine whether two context free grammars generate the
same language.
Which of the following is true?
(A) S1 is correct and S2 is not correct.
(B) Both S1 and S2 are correct.
(C) Both S1 and S2 are not correct.
(D) S1 is not correct and S2 is correct.
Ans: a
Q The statements s1 and s2 are given as : (NET-JUNE-2013)
s1: Context sensitive languages are closed under intersection, concatenation, substitution and
inverse homomorphism.
s2: Context free languages are closed under complementation, substitution and
homomorphism.
Which of the following is correct statement?
(A) Both s1 and s2 are correct.
(B) s1 is correct and s2 is not correct.
(C) s1 is not correct and s2 is correct.
(D) Both s1 and s2 are not correct.
Ans: b

Q Let L = 𝐿1 ∩ 𝐿2 , where 𝐿1 and 𝐿2 are languages as defined below: (GATE – 2009) (2 Marks)
𝐿1 = {𝑎𝑚 𝑏 𝑚 c 𝑎𝑛 𝑏 𝑛 | m, n ≥ 0} 𝐿2 = {𝑎𝑖 𝑏 𝑗 𝑐 𝑘 | I, j, k ≥ 0}
a) Not recursive b) Regular
c) Context – free but not regular d) Recursively enumerable but not context – free
Ans: c

Q Let L be a context - free language and M a regular language. Then the language L ∩ M is
(GATE-2006) (1 Marks)
a) Always regular b) Never regular
c) Always a deterministic context free language d) Always a context – free language
Ans: d

Q Consider the languages: (GATE-2005) (2 Marks)


L1 = {an bn cm | n, m > 0} L2 = {an bm cm | n, m > 0}
Which one of the following statements is FALSE?
(A) L1 ∩ L2 is a context-free language (B) L1 U L2 is a context-free language
(C) L1 and L2 are context-free language (D) L1 ∩ L2 is a context sensitive language
Answer: (A)
Q Let L be a regular language and M be a context-free language, both over the alphabet Σ. Let
Lc and Mc denote the complements of L and M respectively. Which of the following statements
about the language Lc ∪ Mc is TRUE? (GATE-2005) (2 Marks)
(A) It is necessarily regular but not necessarily context-free
(B) It is necessarily context-free.
(C) It is necessarily non-regular.
(D) None of the above
Answer: (D)

Q Which of the following statements is true? (GATE-2001) (1 Marks)


(A) If a language is context free it can always be accepted by a deterministic push-down
automaton
(B) The union of two context free languages is context free
(C) The intersection of two context free languages is context free
(D) The complement of a context free language is context free
Answer: (B)

Q Consider the following decision problems (GATE-2000) (2 Marks)


(P1) Does a given finite state machine accept a given string
(P2) Does a given context free grammar generate an infinite number of stings
Which of the following statements is true?
(A) Both (P1) and (P2) are decidable (B) Neither (P1) nor (P2) are decidable
(C) Only (P1) is decidable (D) Only (P2) is decidable
Answer: (A)

Q Let L1 is context free language and L2 is a regular language which of the following is/are false
(GATE – 1999) (1 Marks)
a) L 1 – L2 is not context free b) L1 ∩ L2 is context free
c) ~ L1 is context free d) ~ L2 is regular
Ans: a, c
Q Context – free language is closed under: (GATE – 1999) (1 Marks)
a) Union, intersection b) Union, Kleene closure
c) Intersection, complement d) Complement, Kleene closure
Ans: b

Q If 𝐿1 and 𝐿2 are context free language and R a regular set, one of the languages below is not
necessarily a context free language. Which one? (GATE – 1996) (1 Marks)
a) 𝐿1 , 𝐿2 b) 𝐿1 ∩ 𝐿2 c) 𝐿1 ∩ R d) 𝐿1 ∪ 𝐿2
Ans: b

Q Context – free languages are (GATE – 1992) (1 Marks)


a) Closed under union b) Closed under complementation
c) Closed under intersection d) Closed under Kleene closure
Ans: a, d
Q Suppose 𝐿1 and 𝐿2 are two language over ∑*
L = ∑*- ((∑* - 𝐿1 ) ∪ (∑* - 𝐿2 ))
𝐿1 and 𝐿2 are CFL. Which of the following statement is true?
1. L is necessarily CFL 2. L may or may not be CFL 3. L ⊆ 𝐿1
a) only 2 b) 1 and 3 c) 2 and 3 d) all of correct

Q CFG is not closed number


a) Intersection b) complement c) difference d) all of the above

Q Which of the following is not true?


a) CFLs are closed under union and concatenation.
b) Regular languages are closed under union and intersection
c) CFLs are not closed under intersection and complementation.
d) IF L is a CFL and R is a regular set then L∩R is not a CFL.

Q If 𝐿1 is regular and 𝐿2 is CFL over ∑* which of the following statement is incorrect?


a) 𝐿1 ∪ 𝐿2 is CFL b) 𝐿1 ∩ 𝐿2 is regular c) 𝐿1 * is regular d) None of the above

Q CFLs are not closed under


a) union b) Concatenation c) Closure d) Intersection

Q CFLs are not closed under


a) union b) Kleene star c) Complementation d) product

Q Context free languages are closed under


a) Union b) Intersection c) Complementation d) Set difference

Q Context – free languages and regular languages are both closed under the operations (s) of
i) Union ii) Intersection iii) Concatenation
a) i) and ii) only b) ii) and iii) only c) i) and iii) only d) All of the above
Q Consider the statements.
S1: All Context Free Languages over one symbol alphabet are regular.
S2: All non-self-embedded context-free languages are regular.
Which of the above statements are true?
a) Only S1 b) Only S2 c) Both S1 & S2 d) None of S1 & S2

Q Let L1 and L2 are context free languages, L3 and L4 are regular languages then which of the
following languages are always context-free
a) (L1  L2) – (L1  L4) b) (L1 L3) – (L2  L4)
c) (L1  L2) / (L3  L4) d) (L3  L4) / (L1  L2)

Q Let G1 and G2 be Context Free Grammars and R be a regular expression. Then which of the
following are decidable.
a) Is L(G1)  L(G2) = ? b) Is L(G1) = L(G2)?
c) Is L(G1) = L(R)? d) None of the above

Q CFG is not closed number


a) Intersection b) complement c) difference d) all of the above

Q Which of the following is undecidable


a) Equivalence of regular languages b) Equivalence of context free languages
c) Finiteness check on context free languages d) Emptiness of regular languages

You might also like