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|λ

1 Answer

Answer :

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

Related questions

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

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

Description : Minimal deterministic finite automaton for the language L={ 0n | n≥0, n≠4 } will have: (A) 1 final state among 5 states (B) 4 final states among 5 states (C) 1 final state among 6 states (D) 5 final states among 6 states

Last Answer : (D) 5 final states among 6 states

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 : 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 : 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 : 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 : 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 x is less than ................... (1) 1 (2) 1/n (3) 1/m (4) n/m

Last Answer : Answer: 1

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

Last Answer : Answer: 4

Description : Does a device exist where one can use AAA batteries in AA slots?

Last Answer : Not in the way you are describing. There are several battery chargers - Energizer makes some, Samsung does too, wherein the same slot will charge an AA and an AAA - but not at the same time. They ... controls - I suppose it is theoretically possibly do build it, but I have never seen one for sale.

Description : How easily could you find a store that sells a battery tester for AA, AAA etc. in your neighborhood stores?

Last Answer : I local hardware store used to have a battery testing service. Maybe you could call around your area and find someplace like that.

Description : AAA and AA which one is greater?

Last Answer : Hi Ruth, both AA and AAA has the same 1.5V. But the capacity of AA is bigger than AAA. The AAA battery is smaller in size than AA. The amount of current carrying though the battery vary in AA ... . It depends on the specific size devices that you have and how long do you want the device work for.

Description : Each year the company receives bond ratings. The range of these bond ratings from best to worse is: a. A to F. b. A to C. c. D to AA. d. D to AAA. e. AAA to D.

Last Answer : e. AAA to D.

Description : What is your bond rate? The prime rate is 10%; your current bond rating slipped one category (from AAA to AA). a. 12.1% b. 10.5% c. 11.4% d. 11.2%

Last Answer : b. 10.5%

Description : Which of the following statement is not true? a) The union and concatenation of two context-free languages is context-free b) The reverse of a context-free language is context-free, but the ... it can be described by a regular grammar d) The intersection two context-free languages is context-free

Last Answer : d) The intersection two context-free languages is context-free

Description : Which of the following statement is not true? a) The union and concatenation of two context-free languages is context-free b) The reverse of a context-free language is context-free, but ... a regular language is always context-free e) The intersection two context-free languages is context-free

Last Answer : e) The intersection two context-free languages is context-free

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 : 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 : 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 : 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 : Which of the following statements is false? (1) Every context-sensitive language is recursive. (2) The set of all languages that are not recursively enumerable is countable. (3) The family ... under union. (4) The families of recursively enumerable and recursive languages are closed under reversal.

Last Answer : The set of all languages that are not recursively enumerable is countable.

Description : The statements s1 and s2 are given as: s1: Context sensitive languages are closed under intersection, concatenation, substitution and inverse homomorphism. s2: Context free languages are closed under complementation, ... is not correct and s2 is correct. (D) Both s1 and s2 are not correct.

Last Answer : (B) s1 is correct and s2 is not correct.

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 : 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 : 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 : The regular expression corresponding to the language L where L={x∈{0,1}* | x ends with 1 and does not contain substring 00 } is: (A) (1 + 01)* (10 + 01) (B) (1 + 01)* 01 (C) (1 + 01)* (1 + 01) (D) (10 + 01)* 01

Last Answer : (C) (1 + 01)* (1 + 01) 

Description : Let L be the language generated by regular expression 0*10* and accepted by the deterministic finite automata M. Consider the relation RM defined by M. As all states are reachable from the start state, RM has ................ equivalence classes. (A) 2 (B) 4 (C) 5 (D) 6

Last Answer : (D) 6

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 : Shift-Reduce parsers perform the following : (A) Shift step that advances in the input stream by K(K>1) symbols and Reduce step that applies a completed grammar rule to some recent parse trees, ... in the input stream and Reduce step that applies a completed grammar rule to form a single tree.

Last Answer : (B) Shift step that advances in the input stream by one symbol and Reduce step that applies a completed grammar rule to some recent parse trees, joining them together as one tree with a new root symbol.

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 : A context diagram is used A) as the first step in developing a detailed DFD of a system B) in systems analysis of very complex systems C) as an aid to system design D) as an aid to programmer

Last Answer : A) as the first step in developing a detailed DFD of a system

Description : A context diagram A) Describes the context of a system B) is a DFD which gives an overview of the system C) is a detailed description of a system D) is not used in drawing a detailed DFD

Last Answer : B) is a DFD which gives an overview of the system

Description : High level knowledge which relates to the use of sentences in different contexts and how the context affect the meaning of the sentences? (A) Morphological (B) Syntactic (C) Semantic (D) Pragmatic

Last Answer : (D) Pragmatic

Description : The family of context sensitive languages is ................. under union and ................. under reversal. (A) closed, not closed (B) not closed, not closed (C) closed, closed (D) not closed, closed

Last Answer : (C) closed, closed 

Description : Consider three CPU intensive processes P1, P2, P3 which require 20, 10 and 30 units of time, arrive at times 1, 3 and 7 respectively. Suppose operating system is implementing Shortest Remaining Time first (preemptive scheduling) ... end of Ready queue are not counted). (A) 3 (B) 2 (C) 4 (D) 5

Last Answer : (A) 3

Description : Which of the following statement is true? a) Not all formal languages are context-free b) All formal languages are Context free c) All formal languages are like natural language d) Natural languages are context-oriented free

Last Answer : a) Not all formal languages are context-free

Description : Which of the following statement is true? a) Not all formal languages are context-free b) All formal languages are Context free c) All formal languages are like natural language d) Natural languages are context-oriented free e) Natural language is formal

Last Answer : a) Not all formal languages are context-free

Description : What is an L-attributed translation grammar?

Last Answer : http://www.google.com/ hurf durf

Description : What goldish/tan paint will go good with BM Tuscan Red?

Last Answer : I had to google Tuscan Red. But I don’t think any tan or gold paints will look good with it.

Description : Where is BM College located ?

Last Answer : Barisal is located

Description : Can Honors be done from BM College ?

Last Answer : You can do honors even if you study in BM college If you study in BM department in BM College , you will be able to do Honors in Accounting , Management , Finance and Banking , Marketing , Bengali , English. Thank you!

Description : What is the full form of BM ?

Last Answer : BM 's full form Brigade Major.

Last Answer : Alhaj Salah Uddin Ahmed is the founder of Pekua BM College.