🔍
Given the following two statements:

A. L = {w|na(w) = nb(w)} is deterministic context free language, but not linear B. L = {an bn} U {an b2n} is linear, but not deterministic context free language.

Which of the following options is correct?

(1) Both (A) and (B) are false.

(2) Both (A) and (B) are true.

(3) (A) is true, (B) is false.

(4) (A) is false, (B) is true.
0 like 0 dislike

1 Answer

Both (A) and (B) are true. 
0 like 0 dislike

Related questions

Given the following two languages: L1 = {anbn|n≥0, n≠100} L2 = {w ϵ {a,b,c}*| na(w) = nb(w) = nc(w)} Which of the following options is correct? (1) Both L1 and L2 are ... context free language, L2 is not context free language. (4) L1 is not context free language, L2 is context free language.
Answer : L1 is context free language, L2 is not context free language....

View solution
0 like 0 dislike
1 answer

The transition function for the language L = {w|na(w) and nb(w) are both odd} is given by: δ(q0, a)=q1 ; δ(q0, b)=q2 δ(q1, a)=q0 ; δ(q1, b)=q3 δ(q2, a)=q3 ; δ(q2, b ... the automata are: (A) q0 and q0 respectively (B) q0 and q1 respectively (C) q0 and q2 respectively (D) q0 and q3 respectively 
Answer : (D) q0 and q3 respectively...

View solution
0 like 0 dislike
1 answer

The grammar with production rules S → aSb |SS|λ generates language L given by: (A) L = {w∈{a, b}* | na(w) = nb(w) and na(v) ≥ nb(v) where v is any prefix of w} (B) L = {w∈{a, b}* | na(w) = nb(w) and na(v ... (D) L = {w∈{a, b}* | na(w) ≠ nb(w) and na(v) ≤ nb(v) where v is any prefix of w}
Answer : (A) L = {w∈{a, b}* | na(w) = nb(w) and na(v) ≥ nb(v) where v is any prefix of w} ...

View solution
0 like 0 dislike
1 answer

Given the following statements: S1: Every context-sensitive language L is recursive. S2: There exists a recursive language that is not context sensitive. Which statement is correct? (A) S1 is not correct and S2 is ... (C) S1 is correct and S2 is not correct. (D) S1 is correct and S2 is correct.
Answer : (D) S1 is correct and S2 is correct. ...

View solution
0 like 0 dislike
1 answer

Consider the following statements related to compiler construction: I. Lexical Analysis is specified by context-free grammars and implemented by pushdown automata. II. Syntax Analysis is specified by regular expressions and implemented by ... Only l (2) Only ll (3) Both I and II (4) Neither I nor Il
Answer : Answer: 4...

View solution
0 like 0 dislike
1 answer

50.5k questions

47.1k answers

240 comments

7.0k users