Login
Register
@
Dark Mode
Profile
Edit my Profile
Messages
My favorites
Register
Activity
Q&A
Questions
Unanswered
Tags
Subjects
Users
Ask
Previous Years
Blogs
New Blog
Exams
Dark Mode
Recent questions tagged context-free-grammar
0
votes
1
answer
61
TIFR CSE 2020 | Part B | Question: 6
Consider the context-free grammar below ($\epsilon$ denotes the empty string, alphabet is $\{a,b\}$): $S\rightarrow \epsilon \mid aSb \mid bSa \mid SS.$ What language does it generate? $(ab)^{\ast} + (ba)^{\ast}$ $(abba) {\ast} + (baab)^{\ast}$ ... of the form $a^{n}b^{n}$ or $b^{n}a^{n},n$ any positive integer Strings with equal numbers of $a$ and $b$
admin
asked
in
Theory of Computation
Feb 10, 2020
by
admin
493
views
tifr2020
theory-of-computation
context-free-grammar
2
votes
4
answers
62
ISRO2020-39
The language which is generated by the grammar $S \rightarrow aSa \mid bSb \mid a \mid b$ over the alphabet of $\{a,b\}$ is the set of Strings that begin and end with the same symbol All odd and even length palindromes All odd length palindromes All even length palindromes
Satbir
asked
in
Theory of Computation
Jan 13, 2020
by
Satbir
2.1k
views
isro-2020
theory-of-computation
context-free-grammar
normal
3
votes
0
answers
63
Michael Sipser Edition 3 Exercise 5 Question 36 (Page No. 242)
Say that a $CFG$ is minimal if none of its rules can be removed without changing the language generated. Let $MIN_{CFG} = \{\langle G \rangle \mid \text{G is a minimal CFG}\}$. Show that $MIN_{CFG}$ is $T-$recognizable. Show that $MIN_{CFG}$ is undecidable.
admin
asked
in
Theory of Computation
Oct 20, 2019
by
admin
621
views
michael-sipser
theory-of-computation
context-free-grammar
recursive-and-recursively-enumerable-languages
decidability
proof
0
votes
0
answers
64
Michael Sipser Edition 3 Exercise 5 Question 32 (Page No. 241)
Prove that the following two languages are undecidable. $OVERLAP_{CFG} = \{\langle G, H\rangle \mid \text{G and H are CFGs where}\: L(G) \cap L(H) \neq \emptyset\}$. $PREFIX-FREE_{CFG} = \{\langle G \rangle \mid \text{G is a CFG where L(G) is prefix-free}\}$.
admin
asked
in
Theory of Computation
Oct 20, 2019
by
admin
449
views
michael-sipser
theory-of-computation
context-free-grammar
turing-machine
decidability
proof
0
votes
0
answers
65
Michael Sipser Edition 3 Exercise 5 Question 21 (Page No. 240)
Let $AMBIG_{CFG} = \{\langle G \rangle \mid \text{G is an ambiguous CFG}\}$. Show that $AMBIG_{CFG}$ is undecidable. (Hint: Use a reduction from $PCP$ ... $a_{1},\dots,a_{k}$ are new terminal symbols. Prove that this reduction works.)
admin
asked
in
Theory of Computation
Oct 19, 2019
by
admin
388
views
michael-sipser
theory-of-computation
context-free-grammar
reduction
post-correspondence-problem
decidability
proof
0
votes
0
answers
66
Michael Sipser Edition 3 Exercise 5 Question 2 (Page No. 239)
Show that $EQ_{CFG}$ is co-Turing-recognizable.
admin
asked
in
Theory of Computation
Oct 17, 2019
by
admin
177
views
michael-sipser
theory-of-computation
context-free-grammar
recursive-and-recursively-enumerable-languages
proof
0
votes
0
answers
67
Michael Sipser Edition 3 Exercise 5 Question 1 (Page No. 239)
Show that $EQ_{CFG}$ is undecidable.
admin
asked
in
Theory of Computation
Oct 17, 2019
by
admin
166
views
michael-sipser
theory-of-computation
context-free-grammar
decidability
proof
1
vote
0
answers
68
Michael Sipser Edition 3 Exercise 4 Question 31 (Page No. 212)
Say that a variable $A$ in $CFL\: G$ is usable if it appears in some derivation of some string $w \in G$. Given a $CFG\: G$ and a variable $A$, consider the problem of testing whether $A$ is usable. Formulate this problem as a language and show that it is decidable.
admin
asked
in
Theory of Computation
Oct 17, 2019
by
admin
450
views
michael-sipser
theory-of-computation
context-free-language
context-free-grammar
decidability
proof
0
votes
0
answers
69
Michael Sipser Edition 3 Exercise 4 Question 29 (Page No. 212)
Let $C_{CFG} = \{\langle G, k \rangle \mid \text{ G is a CFG and L(G) contains exactly $k$ strings where $k \geq 0$ or $k = \infty$}\}$. Show that $C_{CFG}$ is decidable.
admin
asked
in
Theory of Computation
Oct 17, 2019
by
admin
251
views
michael-sipser
theory-of-computation
context-free-grammar
decidability
proof
0
votes
0
answers
70
Michael Sipser Edition 3 Exercise 4 Question 28 (Page No. 212)
Let $C = \{ \langle G, x \rangle \mid \text{G is a CFG $x$ is a substring of some $y \in L(G)$}\}$. Show that $C$ is decidable. (Hint: An elegant solution to this problem uses the decider for $E_{CFG}$.)
admin
asked
in
Theory of Computation
Oct 17, 2019
by
admin
178
views
michael-sipser
theory-of-computation
context-free-grammar
decidability
proof
0
votes
0
answers
71
Michael Sipser Edition 3 Exercise 4 Question 15 (Page No. 212)
Show that the problem of determining whether a CFG generates all strings in $1^{\ast}$ is decidable. In other words, show that $\{\langle { G \rangle} \mid \text{G is a CFG over {0,1} and } 1^{\ast} \subseteq L(G) \}$ is a decidable language.
admin
asked
in
Theory of Computation
Oct 17, 2019
by
admin
536
views
michael-sipser
theory-of-computation
context-free-grammar
decidability
proof
0
votes
0
answers
72
Michael Sipser Edition 3 Exercise 4 Question 14 (Page No. 211)
Let $\Sigma = \{0,1\}$. Show that the problem of determining whether a $CFG$ generates some string in $1^{\ast}$ is decidable. In other words, show that $\{\langle {G \rangle}\mid \text{G is a CFG over {0,1} and } 1^{\ast} \cap L(G) \neq \phi \}$ is a decidable language.
admin
asked
in
Theory of Computation
Oct 17, 2019
by
admin
190
views
michael-sipser
theory-of-computation
context-free-grammar
decidability
proof
0
votes
0
answers
73
Michael Sipser Edition 3 Exercise 4 Question 4 (Page No. 211)
Let $A\varepsilon_{CFG} = \{ \langle{ G }\rangle \mid G\: \text{is a CFG that generates}\: \epsilon \}.$Show that $A\varepsilon_{CFG}$ is decidable.
admin
asked
in
Theory of Computation
Oct 15, 2019
by
admin
191
views
michael-sipser
theory-of-computation
turing-machine
context-free-grammar
decidability
proof
0
votes
0
answers
74
Michael Sipser Edition 3 Exercise 2 Question 59 (Page No. 160)
If we disallow $\epsilon$-rules in CFGs, we can simplify the DK-test. In the simplified test,we only need to check that each of DK’s accept states has a single rule. Prove that a CFG without $\epsilon$-rules passes the simplified DK-test iff it is a DCFG.
admin
asked
in
Theory of Computation
Oct 12, 2019
by
admin
284
views
michael-sipser
theory-of-computation
context-free-grammar
descriptive
1
vote
0
answers
75
Michael Sipser Edition 3 Exercise 2 Question 55 (Page No. 159)
Let $G_{1}$ be the following grammar that we introduced in Example $2.45$. Use the DK-test to show that $G_{1}$ is not a DCFG. $R \rightarrow S \mid T$ $S \rightarrow aSb \mid ab$ $T \rightarrow aTbb \mid abb$
admin
asked
in
Theory of Computation
Oct 12, 2019
by
admin
229
views
michael-sipser
theory-of-computation
context-free-grammar
descriptive
0
votes
0
answers
76
Michael Sipser Edition 3 Exercise 2 Question 54 (Page No. 159)
Let G be the following grammar: $S \rightarrow T\dashv $ $T \rightarrow T aT b \mid T bT a | \epsilon$ Show that $L(G) = \{w\dashv \: \mid w\: \text{contains equal numbers of a’s and b’s} \}$. Use a proof by induction on the length of $w$. Use the DK-test to show that G is a DCFG. Describe a DPDA that recognizes L(G).
admin
asked
in
Theory of Computation
Oct 12, 2019
by
admin
234
views
michael-sipser
theory-of-computation
context-free-grammar
descriptive
0
votes
0
answers
77
Michael Sipser Edition 3 Exercise 2 Question 52 (Page No. 159)
Show that every DCFG generates a prefix-free language.
admin
asked
in
Theory of Computation
Oct 12, 2019
by
admin
242
views
michael-sipser
theory-of-computation
context-free-grammar
prefix-free-property
proof
0
votes
0
answers
78
Michael Sipser Edition 3 Exercise 2 Question 51 (Page No. 159)
Show that every DCFG is an unambiguous CFG.
admin
asked
in
Theory of Computation
Oct 12, 2019
by
admin
223
views
michael-sipser
theory-of-computation
context-free-grammar
ambiguous
proof
1
vote
0
answers
79
Michael Sipser Edition 3 Exercise 2 Question 47 (Page No. 159)
Let $\Sigma = \{0,1\}$ and let $B$ be the collection of strings that contain at least one $1$ in their second half. In other words, $B = \{uv \mid u \in \Sigma^{\ast}, v \in \Sigma^{\ast}1\Sigma^{\ast}\: \text{and} \mid u \mid \geq \mid v \mid \}$. Give a PDA that recognizes $B$. Give a CFG that generates $B$.
admin
asked
in
Theory of Computation
Oct 12, 2019
by
admin
779
views
michael-sipser
theory-of-computation
context-free-grammar
pushdown-automata
descriptive
0
votes
0
answers
80
Michael Sipser Edition 3 Exercise 2 Question 46 (Page No. 158)
Consider the following CFG $G:$ $S \rightarrow SS \mid T$ $T \rightarrow aT b \mid ab$ Describe $L(G)$ and show that $G$ is ambiguous. Give an unambiguous grammar $H$ where $L(H) = L(G)$ and sketch a proof that $H$ is unambiguous.
admin
asked
in
Theory of Computation
Oct 12, 2019
by
admin
414
views
michael-sipser
theory-of-computation
context-free-grammar
ambiguous
proof
0
votes
0
answers
81
Ullman (Compiler Design) Edition 2 Exercise 4.4 Question 10 (Page No. 233)
Show how, having filled in the table as in Question $4.4.9$, we can in $O(n)$ time recover a parse tree for $a_{1}a_{2}\cdot\cdot\cdot a_{n}$. Hint: modify the table so it records, for each nonterminal $A$ in each table entry $T_{ij}$, some pair of nonterminals in other table entries that justified putting $A$ in $T_{ij}$.
admin
asked
in
Compiler Design
Aug 20, 2019
by
admin
204
views
ullman
compiler-design
context-free-grammar
descriptive
0
votes
0
answers
82
Ullman (Compiler Design) Edition 2 Exercise 4.4 Question 9 (Page No. 232)
Every language that has a context-free grammar can be recognized in at most $O(n^{3})$ time for strings of length $n$. A simple way to do so,called the Cocke- Younger-Kasami (or CYK) algorithm is based on dynamic programming. ... in the table, how do you determine whether $a_{l}a_{2}\cdot\cdot\cdot a_{n}$ is in the language?
admin
asked
in
Compiler Design
Aug 20, 2019
by
admin
279
views
ullman
compiler-design
context-free-grammar
cyk-algorithm
descriptive
0
votes
0
answers
83
Ullman (Compiler Design) Edition 2 Exercise 4.2 Question 3 (Page No. 207)
Design grammars for the following languages: The set of all strings of $0's$ and $1's$ such that every $0$ is immediately followed by at least one $1$. The set of all strings of $0's$ and $1's$ that are palindromes; ... $1's$ of the form $xy$, where $x\neq y$ and $x$ and $y$ are of the same length.
admin
asked
in
Compiler Design
Aug 17, 2019
by
admin
417
views
ullman
compiler-design
context-free-grammar
descriptive
1
vote
0
answers
84
Ullman (Compiler Design) Edition 2 Exercise 4.2 Question 2 (Page No. 206 - 207)
Repeat Question $4.2.1$ for each of the following grammars and strings: $S\rightarrow 0S1\mid 01$ with string $000111$. $S\rightarrow +SS\mid \ast SS\mid a$ with string $+\ast aaa$ ... $bfactor\:\rightarrow\:not\:bfactor\mid (bexpr)\mid true\mid false$
admin
asked
in
Compiler Design
Aug 17, 2019
by
admin
722
views
ullman
compiler-design
context-free-grammar
parsing
ambiguous
descriptive
4
votes
1
answer
85
Ullman (Compiler Design) Edition 2 Exercise 4.2 Question 1 (Page No. 206)
Consider the context-free grammar:$S\rightarrow SS + \mid SS {\ast} \mid a$and the string $aa + a{\ast}$. Give a leftmost derivation for the string. Give a rightmost derivation for the string. ... for the string. Is the grammar ambiguous or unambiguous? Justify your answer. Describe the language generated by this grammar.
admin
asked
in
Compiler Design
Aug 7, 2019
by
admin
10.4k
views
ullman
compiler-design
context-free-grammar
parsing
ambiguous
descriptive
1
vote
0
answers
86
Ullman (Compiler Design) Edition 2 Exercise 2.2 Question 6 (Page No. 52)
Construct a context-free grammar for roman numerals.
admin
asked
in
Compiler Design
Jul 26, 2019
by
admin
281
views
ullman
compiler-design
context-free-grammar
0
votes
0
answers
87
Ullman (Compiler Design) Edition 2 Exercise 2.2 Question 4 (Page No. 51 - 52)
Construct unambiguous context-free grammars for each of the following languages. In each case show that your grammar is correct. Arithmetic expressions in postfix notation. Left-associative lists of identifiers separated by commas. Right- ... $(d)$.
admin
asked
in
Compiler Design
Jul 26, 2019
by
admin
631
views
ullman
compiler-design
context-free-grammar
1
vote
2
answers
88
Ullman (Compiler Design) Edition 2 Exercise 2.2 Question 3 (Page No. 51)
Which of the grammars are ambiguous? $S\rightarrow 0S1 \mid 01$ $S\rightarrow +SS \mid -SS \mid a$ $S\rightarrow S(S)S \mid \epsilon$ $S\rightarrow aSbS \mid bSaS \mid \epsilon$ $S\rightarrow a \mid S+S \mid SS \mid S^{\ast} \mid (S)$
admin
asked
in
Compiler Design
Jul 26, 2019
by
admin
1.2k
views
ullman
compiler-design
context-free-grammar
ambiguous
0
votes
0
answers
89
Ullman (Compiler Design) Edition 2 Exercise 2.2 Question 2 (Page No. 51)
What language is generated by the following grammars? In each case justify your answer. $S\rightarrow 0S1 \mid 01$ $S\rightarrow +SS \mid -SS \mid a$ $S\rightarrow S(S)S \mid \epsilon$ $S\rightarrow aSbS \mid bSaS \mid \epsilon$ $S\rightarrow a \mid S+S \mid SS \mid S^{\ast} \mid (S)$
admin
asked
in
Compiler Design
Jul 26, 2019
by
admin
314
views
ullman
compiler-design
context-free-grammar
0
votes
0
answers
90
Ullman (Compiler Design) Edition 2 Exercise 2.2 Question 1 (Page No. 51)
Consider the context-free grammar $S\rightarrow SS+\mid SS^{\ast}\mid a$ Show how the string $aa+a^{\ast}$ can be generated by this grammar. Construct a parse tree for this string. What language does this grammar generate? Justify your answer.
admin
asked
in
Compiler Design
Jul 26, 2019
by
admin
173
views
ullman
compiler-design
context-free-grammar
Page:
« prev
1
2
3
4
5
6
7
8
...
12
next »
Subscribe to GATE CSE 2024 Test Series
Subscribe to GO Classes for GATE CSE 2024
Quick search syntax
tags
tag:apple
author
user:martin
title
title:apple
content
content:apple
exclude
-tag:apple
force match
+apple
views
views:100
score
score:10
answers
answers:2
is accepted
isaccepted:true
is closed
isclosed:true
Recent Posts
Post GATE 2024 Guidance [Counseling tips and resources]
GATE CSE 2024 Result Responses
[Project Contest] Pytorch backend support for MLCommons Cpp Inference implementation
Participating in MLCommons Inference v4.0 submission (deadline is February 23 12pm IST)
IIITH PGEE 2024 Test Series by GO Classes
Subjects
All categories
General Aptitude
(3.5k)
Engineering Mathematics
(10.4k)
Digital Logic
(3.6k)
Programming and DS
(6.2k)
Algorithms
(4.8k)
Theory of Computation
(6.9k)
Compiler Design
(2.5k)
Operating System
(5.2k)
Databases
(4.8k)
CO and Architecture
(4.0k)
Computer Networks
(4.9k)
Artificial Intelligence
(79)
Machine Learning
(48)
Data Mining and Warehousing
(25)
Non GATE
(1.4k)
Others
(2.7k)
Admissions
(684)
Exam Queries
(1.6k)
Tier 1 Placement Questions
(17)
Job Queries
(80)
Projects
(11)
Unknown Category
(870)
64.3k
questions
77.9k
answers
244k
comments
80.0k
users
Recent questions tagged context-free-grammar
Recent Blog Comments
category ?
Hi @Arjun sir, I have obtained a score of 591 in ...
download here
Can you please tell about IIT-H mtech CSE self...
Please add your admission queries here:...