• edited by
23,312 views
20 20 votes

What is the highest type number that can be assigned to the following grammar?

$$S\to Aa,A\to Ba,B \to abc$$

  1. Type 0
  2. Type 1
  3. Type 2
  4. Type 3

9 Answers

Best answer
25 25 votes

type 3

• selected by
6 6 votes
Let us see what we get by following the production rules :

$S \rightarrow \underline{A}a \rightarrow \underline{B}a.a \rightarrow abcaa$

We see that the language consists of just one string, which is $abcaa$. Thus, the language is finite and can be represented by FA. Hence, the highest type number is type-3.
• edited by
2 2 votes

Option C Type 2 grammar

It is context Free grammer which is type 2 grammer beacuse here Non Terminal produce Terminal as well non terminals ie NT ---> T/NT.

Why not type 3 beacuse it not producing Non terminal to terminal only. (S→Aa,A→Ba,B→abc).

1 1 vote
grammar will be type 3 grammar as it generates a regular language.. abcaa

since abcaa is regular it satisfies every type.. type 0,1,2,3

but the highest type number is TYPE 3
1 1 vote

D is the correct option because it preserves the form A->aB/Ba/a where A,B are set of Vertices and a is set of terminals.

Answer:
Position:
Show:

Related questions

11 11 votes
1 answers 1 answer
8.4k
8.4k views
Desert_Warrior asked Jul 3, 2016
8,419 views
Let $L=\{w \in (0+1)^* \mid w \text{ has even number of 1's}\}$, i.e. $L$ is the set of all bit strings with even number of 1's. Which one of the regular expression below...
9 9 votes
2 answers 2 answers
11.7k
11.7k views
Desert_Warrior asked Jul 3, 2016
11,664 views
AN FSM(finite state machine) can be considered to be a turing machine of finite tape lengthwithout rewinding capability and unidirectional tape movementrewinding capabili...
8 8 votes
2 answers 2 answers
4.8k
4.8k views
Arjun asked Jul 6, 2016
4,762 views
A simple two-pass assembler does which of the following in the first pass:Checks to see if the instructions are legal in the current assembly modeIt allocates space for t...
8 8 votes
3 answers 3 answers
12.5k
12.5k views
Arjun asked Jul 6, 2016
12,514 views
At a particular time of computation the value of a counting semaphore is 7. Then 20 $P$ operations and $x$ $V$ operations were completed on this semaphore. If the new val...