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) ≤ nb(v) where v is any prefix of w}

(C) L = {w∈{a, b}* | na(w) ≠ nb(w) and na(v) ≥ nb(v) where v is any prefix of w}

(D) L = {w∈{a, b}* | na(w) ≠ nb(w) and na(v) ≤ nb(v) where v is any prefix of w}


1 Answer

Answer :

(A) L = {w∈{a, b}* | na(w) = nb(w) and na(v) ≥ nb(v) where v is any prefix of w} 

Related questions

Description : Given the following statements: S1 : The grammars S→asb | bsa | ss | a and S→asb | bsa | a are not equivalent. S2: The grammars S→ss | sss | asb | bsa | λ and S→ss | asb | bsa | λ are equivalent. ... and S2 are correct (C) S1 is not correct and S2 is correct (D) Both S1 and S2 are not correct.

Last Answer : (A) S1 is correct and S2 is not correct.

Description : A set of processors P1, P2, ......, Pk can execute in parallel if Bernstein's conditions are satisfied on a pair wise basis; that is  P1 || P2 || P3 || ..... || Pk if and only if: (A) Pi || Pj for all i ≠ j (B) Pi || Pj for all i = j+1 (C) Pi || Pj for all i ≤ j (D) Pi || Pj for all i ≥ j

Last Answer : (A) Pi || Pj for all i ≠ j Explanation: Bernstein's Condition: 1. If process Pi writes to a memory cell Mi, then no process Pj can read the cell Mi. 2. If process Pi read from a memory ... Mi. 3. If process Pi writes to a memory cell Mi, then no process Pj can write to the cell Mi.

Description : Which of the following is FALSE ? (A) The grammar S ⟶ aSb|bSa|SS|∈, where S is the only non-terminal symbol and ∈ is the null string, is ambiguous. (B) SLR is powerful than LALR. (C) An LL(1) parser is a top-down parser. (D) YACC tool is an LALR(1) parser generator.

Last Answer : (B) SLR is powerful than LALR.

Description : 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 

Last Answer : (D) q0 and q3 respectively

Description : 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 ... are true. (3) (A) is true, (B) is false. (4) (A) is false, (B) is true.

Last Answer : Both (A) and (B) are true. 

Description : Given the production rules of a grammar G1 as S1→AB | aaB A→a | Aa B→b and the production rules of a grammar G2 as S2→aS2bS2 | bS2aS2 | λ Which of the following is correct statement? ( ... G1 is not ambiguous and G2 is ambiguous. (D) G1 is not ambiguous and G2 is not ambiguous.

Last Answer : (B) G1 is ambiguous and G2 is ambiguous.

Description : 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.

Last Answer : L1 is context free language, L2 is not context free language.

Description : The Greibach normal form grammar for the language L={an bn+1|n≥0} is (A) S→a SB, B→bB|λ (B) S→a SB, B→bB|b (C) S→a SB|b, B→b (D) S→a Sb|b

Last Answer : (C) S→a SB|b, B→b 

Description : The context free grammar for the language L = {an bm | n≤m+3, n≥0, m≥0} is (A) S→aaaA; A→aAb|B, B→Bb|λ (B) S→aaaA|λ, A→aAb|B, B→Bb|λ (C) S→aaaA|aaA|λ, A→aAb|B, B→Bb|λ (D) S→aaaA|aaA|aA|λ, A→aAb|B, B→Bb|λ

Last Answer : (D) S→aaaA|aaA|aA|λ, A→aAb|B, B→Bb|λ

Description : Given a grammar : S1→Sc, S→SA|A, A→aSb|ab, there is a rightmost derivation S1=>Sc =>SAC=>SaSbc. Thus, SaSbc is a right sentential form, and its handle is (A) SaS (B) be (C) Sbe (D) aSb 

Last Answer : (D) aSb

Description : A fuzzy set A on R is ................. iff A(λx1 + (1 – λ)x2) ≥ min [A(x1), A(x2)] for all x1, x2 ∈ R and all λ ∈ [0, 1], where min denotes the minimum operator. (A) Support (B) α-cut (C) Convex (D) Concave 

Last Answer : (C) Convex 

Description : The equivalent production rules corresponding to the production rules S→Sα1|Sα2|β1|β2 is (A) S→β1 | β2, A→α1A | α2A | λ (B) S→β1 | β2 | β1A | β2A,  A→α1A | α2A (C) S→β1 | β2, A→α1A | α2A (D) S→β1 | β2 | β1A | β2A,  A→α1A | α2A | λ

Last Answer : (D) S→β1 | β2 | β1A | β2A,  A→α1A | α2A | λ

Description : The regular expression for the complement of the language L = {anbm|n≥4, m≤3} is: (A) (λ + a + aa + aaa)b* + a*bbbb* + (a + b)*ba(a + b)* (B) (λ + a + aa + aaa)b* + a*bbbbb* + (a + b)*ab(a + b)* (C) (λ + a ... *bbbbb* + (a + b)*ab(a + b)* (D) (λ + a + aa + aaa)b* + a*bbbbb* + (a + b)*ba(a + b)*

Last Answer : (D) (λ + a + aa + aaa)b* + a*bbbbb* + (a + b)*ba(a + b)*

Description : Consider a Hamiltonian Graph (G) with no loops and parallel edges. Which of the following is true with respect to this Graph (G) ? (a) deg(v) ≥ n/2 for each vertex of G (b) |E(G)| ≥ 1/2 (n-1)(n-2)+2 edges (c) deg(v) + deg( ... edge (A) (a) and (b) (B) (b) and (c) (C) (a) and (c) (D) (a), (b) and (c)

Last Answer : (D) (a), (b) and (c)

Description : A context free grammar for L={w|n0(w)>n1(w)} is given by: (A) S→0|0S|1SS (B) S→0S|1S|0SS|1SS|0|1 (C) S→0|0S|1SS|S1S|SS1 (D) S→0S|1S|0|1

Last Answer : (C) S→0|0S|1SS|S1S|SS1 

Description : If all the production rules have single non - terminal symbol on the left side, the grammar defined is : (A) context free grammar (B) context sensitive grammar (C) unrestricted grammar (D) phrase grammar

Last Answer : (A) context free grammar

Description : Naphthenic acid is represented by (A) CnH2n+2O2 (B) CnH2n-2O2 (C) CnH2n+2O2 (n ≥ 6) (D) CnH2n+6O2 (n ≤ 6)

Last Answer : (B) CnH2n-2O2

Description : . Which of the following relationships between co-efficient of friction (μ) between rock & roll and a (half of the angle of nip) of the particle to be crushed is correct? (A) μ > tan α (B) μ ≥ tan α (C) μ > tan 2α (D) μ ≤ tan α

Last Answer : (B) μ ≥ tan α

Description : I. 63x^2 – 275x + 300 = 0 II. 18y^2 – 85y + 100 = 0 1 : if x ≥ y 2 : if x ≤ y 3 : if x > y 4 : if x < y 5 : if x = y or relationship cannot be established

Last Answer : 2 : if x ≤ y

Description : I. 20x^2 – 119x + 176 = 0 II. 18y^2 – 123y + 209 = 0 1 : if x ≥ y 2 : if x ≤ y 3 : if x > y 4 : if x < y 5 : if x = y or relationship cannot be established

Last Answer : 5 : if x = y or relationship cannot be  established

Description : I. 3x^2 – 47x + 184 = 0 II. 3y^2 – 38y + 119 = 0 1 : if x ≥ y 2 : if x ≤ y 3 : if x > y 4 : if x < y 5 : if x = y or relationship cannot be established

Last Answer : 3 : if x > y

Description : I. 56x^2 – 127x + 72 = 0 II. 6y^2 – 17y + 12 = 0 1 : if x ≥ y 2 : if x ≤ y 3 : if x > y 4 : if x < y 5 : if x = y or relationship cannot be established

Last Answer : 4 : if x < y

Description : I. 6x^2 – 71x + 195 = 0 II. 12y^2 – 97y + 195 = 0 1 : if x ≥ y 2 : if x ≤ y 3 : if x > y 4 : if x < y 5 : if x = y or relationship cannot be established

Last Answer : 1 : if x ≥ y

Description : I. 32a^2 + 52a + 15 = 0 II. 8b^2 + 38b + 35 = 0 1 : if a > b 2 : if a < b 3 : if a ≥ b 4 : if a ≤ b 5 : if a = b or the relation between a and b cannot be established.

Last Answer : 3 : if a ≥ b

Description : I. 12a^2 − a − 6 = 0 II. 8b^2 − 26b + 15 = 0 1 : if a > b 2 : if a < b 3 : if a ≥ b 4 : if a ≤ b 5 : if a = b or the relation between a and b cannot be established.

Last Answer : 4 : if a ≤ b

Description : I. 28a^2 + 25a − 8 = 0 II. 5b^2 − 13b − 6 = 0 1 : if a > b 2 : if a < b 3 : if a ≥ b 4 : if a ≤ b 5 : if a = b or the relation between a and b cannot be established.

Last Answer : 5 : if a = b or the relation between a and b cannot be established.  

Description : I. 2a^2 − 11a + 12 = 0 II. 35b^2 − 18b − 8 = 0 1 : if a > b 2 : if a < b 3 : if a ≥ b 4 : if a ≤ b 5 : if a = b or the relation between a and b cannot be established.

Last Answer : 1 : if a > b

Description : I. 20a^2 + 51a + 28 = 0 II. 15b^2 − 61b + 56 = 0 1 : if a > b 2 : if a < b 3 : if a ≥ b 4 : if a ≤ b 5 : if a = b or the relation between a and b cannot be established.

Last Answer : 2 : if a < b

Description : For every context free grammar (G) there exists an algorithm that passes any w ∈ L(G) in number of steps proportional to (A) ln|w| (B) |w| (C) |w|2 (D) |w|3

Last Answer : (D) |w|3

Description : Sodium reacts with water to form sodium hydroxide and hydrogen gas. The balanced equation which represents the above reaction is (a) Na(s) + 2H20(l) → 2NaOH(aq) + 2H2(g) (b) 2Na(s) + 2H2O(l) → 2NaOH(aq) +H2(g) (c) 2Na(s) + 2H20(l) → NaOH(aq) + 2H2(g) (d) 2Na(s) + H20(l) - 2NaOH(aq) + 2H2(g)

Last Answer : Answer: (b)

Description : Let A and B be sets in a finite universal set U. Given the following: |A - B|, |AÅB|, |A|+|B| and |AÈB| Which of the following is in order of increasing size ? (A) |A - B| ≤ |AÅB| ≤ |A| + |B| ≤ |AÈB| (B) |AÅB| ≤ |A ... |AÅB| ≤ |A| + |B| ≤ |A - B| ≤ |AÈB| (D) |A - B| ≤ |AÅB| ≤ |AÈB| ≤ |A| + |B|

Last Answer : (D) |A – B| ≤ |AÅB| ≤ |AÈB| ≤ |A| + |B|

Description : Consider the table Student(stuid, name, course, marks). Which one of the following two queries is correct to find the highest marks student in course 5? Q.1. Select S.stuid From student S Where not exists (select * from student ... ) Q.1 (B) Q.2 (C) Both Q.1 and Q.2 (D) Neither Q.1 nor Q.2

Last Answer : (B) Q.2 Explanation: First query gives stuid of students whose marks are greater than all students taking course 5. Second query gives stuid of students whose marks are greater than any student taking ... comparison is between maximum of marks by any student in course 5. So the answer is option D.

Description : A second order reaction of the form A + B → C is called a pseudo-first order reaction, when (A) CA0 = CB0 (B) CA0 > CB0 (C) CB0 > CA0 (D) CB0 ≥ CB0

Last Answer : (D) CB0 ≥ CB0

Description : A pushdown automation M = (Q, Σ, Γ, δ, q0, z, F) is set to be deterministic subject to which of the following condition(s), for every q ∈ Q, a ∈ Σ ∪ {λ} and b ∈ Γ (s1) δ(q, a, b) contains at most one ... ) must be empty for every c ∈ Σ (A) only s1 (B) only s2 (C) both s1 and s2 (D) neither s1 nor s2

Last Answer : (C) both s1 and s2

Description : If we convert ∃u ∀v ∀x ∃y (P(f(u),v, x, y) → Q(u,v,y)) to ∀v ∀x (P(f(a),v, x, g(v,x)) → Q(a,v,g(v,x))) This process is known as (A) Simplification (B) Unification (C) Skolemization (D) Resolution

Last Answer : (C) Skolemization

Description : The language of all non-null strings of a’s can be defined by a context free grammar as follow : S→a S|S a| a The word a3 can be generated by ................ different trees. (A) Two (B) Three (C) Four (D) Five

Last Answer : (C) Four Explanation:

Description : The value of NA/(NA + NB), for steady state equimolal counter diffusion of two gases 'A' and 'B' is (A) 1 (B) ∞ (C) 0.5

Last Answer : (B) ∞

Description : The value of NA/(NA + NB) for steady state molecular diffusion of gas 'A' through non-diffusing gas 'B' is (A) 1 (B) ∞ (C) 0.5 (D) 2

Last Answer : (A) 1

Description : If h is chosen from a universal collection of hash functions and is used to hash n keys into a table of size m, where n ≤ m, the expected number of collisions involving a particular key K is (A) less than 1 (B) less than lg n (C) greater than 1 (D) greater than lg n

Last Answer : (A) less than 1

Description : A computer program selects an integer in the set {k : 1 ≤ k ≤ 10,00,000} at random and prints out the result. This process is repeated 1 million times. What is the probability that the value k = 1 appears in the printout atleast once ? (A) 0.5 (B) 0.704 (C) 0.632121 (D) 0.68

Last Answer : (C) 0.632121

Description : Consider the statement, "Either -2 ≤ x ≤ -1 or 1 ≤ x ≤ 2" The negation of this statement is (A) x

Last Answer : (A) x

Description : Consider an undirected graph G where self-loops are not allowed. The vertex set of G is {(i, j) | 1 ≤ i ≤ 12, 1 ≤ j ≤ 12}. There is an edge between (a, b) and (c, d) if |a – c| ≤ 1 or |b–d| ≤ 1. The number of edges in this graph is (A) 726 (B) 796 (C) 506 (D) 616

Last Answer : (D) 616

Description : Given the following prefix expression: * + 3 + 3 ↑ 3 + 3 3 3 What is the value of the prefix expression? (A) 2178 (B) 2199 (C) 2205 (D) 2232

Last Answer : (C) 2205

Description : Let us assume that you construct ordered tree to represent the compound proposition (~(p˄q))↔(~p˅~q). Then, the prefix expression and post-fix expression determined using this ordered tree are given as ........... and .......... ... ~p~q~˅↔ (C) ↔~˄pq˅ ~~pq, pq˄~p~ ~q˅↔ (D) ↔~˄pq˅ ~p~q, pq˄~p~~q˅↔

Last Answer : (B) ↔~˄pq˅ ~p~q, pq˄~p~q~˅↔

Description : Which of the following statements is false? (A) Optimal binary search tree construction can be performed efficiently using dynamic programming. (B) Breadth-first search cannot be used to find connected components of a graph. (C) ... used to find the components of a graph. (1) A (2) B (3) C (4) D 

Last Answer : Answer: 2

Description : Given L1 = L(a*baa*) and L2 = L(ab*) The regular expression corresponding to language L3 = L1/L2 (right quotient) is given by (A) a*b (B) a*baa* (C) a*ba* (D) None of the above

Last Answer : (C) a*ba* 

Description : 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.

Last Answer : (D) S1 is correct and S2 is correct. 

Description : Given the following statements : S1 : If L is a regular language then the language {uv | uϵL, vϵLR} is also regular. S2 : L = {wwR} is regular language. Which of the following is true ? (A) S1 is not ... S2 is correct. (C) S1 is correct and S2 is not correct. (D) S1 is correct and S2 is correct.

Last Answer : (C) S1 is correct and S2 is not correct.

Description : Given the following statements : S1 : SLR uses follow information to guide reductions. In case of LR and LALR parsers, the look-aheads are associated with the items and they make use of the left context available to ... (C) S1 is correct and S2 is not correct. (D) S1 is correct and S2 is correct.

Last Answer : (D) S1 is correct and S2 is correct.

Description : Synchronization is achieved by a timing device called a ................. which generates a periodic train of .................. (A) clock generator, clock pulse (B) master generator, clock pulse (C) generator, clock (D) master clock generator, clock pulse

Last Answer : Answer: A and D