Automata Theory
Σ = {0, 1}:
{w : every odd position of w is 1 and w = wR}
(HINT: All strings in the language will be of odd length).
TO UNDERSTAND THE QUESTION :
Lets see for some of the strings which are accepted or
not, by language over
Σ = {0, 1}: {w : every odd position of w is 1
and w = wR}
(YES : Accepted )
(NO: Not accepted)
YES | w: 1 (w = wR), (1st position is odd positiion, every odd
position of w is 1)
NO | w: 10 (all the strings of the language will be of odd
length)
YES | w : 101 (even position can be 0 or 1)
YES | w: 111 ( even position can be 0 or 1)
and so on...
So, for all strings w in language given,
=========================================
So Context Free Grammar (CFG) for such a language is ,
S --> RPR | R
P --> TST | RSR | T | R
T --> 0
R --> 1
==========================================
Where,
==========================================
Automata Theory Give a context-free grammar producing the following language over Σ = {0, 1}: {w...
Give a context-free grammar for the following language over = {0, 1}: L={w : w is not a palindrome}
Give a context-free grammar generating the following language over Σ = {0, 1}: {0n1m : m, n ≥ 0; n ≠ m; n ≠ 2m}
Give context-free grammars generating each of the following languages over Σ = {0, 1}: {w : |w| ≤ 5} {w : |w| > 5 or its third symbol is 1} {w : every odd position of w is 1}
Formal Languages and Automata Theory
Q2. Give context-free grammars that generate the following language: { w є {0, 1} | w contains at least three 1's)
Give a context-free grammar generating the complement of the language {anbn : n ≥ 0} over Σ = {a, b}
Give a DFA for the following language over the alphabet Σ = {0, 1}: L={ w | w starts with 0 and has odd length, or starts with 1 and has even length }. E.g., strings 0010100, 111010 are in L, while 0100 and 11110 are not in L.
Automata Theory
I've given my answer to 3d. Is it correct? If not, please
correct it. Thanks
3. Context-free languages are useful for the definition of programming languages. For example, we have looked at grammars for defining Lisp and C. (a) Give a context-free language that is not regular, establishing the added power of CFL (b) What language is accepted by the following grammar: (c) Build a context-free grammar for the language (wb w-wR, k 0 a,by (d) Build a...
Give a context-free-grammar describing the syntax of the
following language.
Thank you =)
Give a context-free-grammar describing the syntax of the following language: L = { ww| we{a, b }" } is a context- free language, where w is a non-empty string from alphabet {a, b } and wt denotes the reversal of string w.
Write a context-free grammar for the language where all strings are of even length and the first half of the string is all 0’s, but it must be an odd number of 0’s
1. Give a context-free grammar for the set BAL of balanced strings of delimiters of three types (), and . For example, (OOis in BAL but [) is not. Give a nondeterministic pushdown automata that recognizes the set of strings in BAL as defined in problem 1 above. Acceptance should be by accept state. 2. Give a context free grammar for the language L where L-(a"b'am I n>-o and there exists k>-o such that m-2*ktn) 3. Give a nondeterministic pushdown...