-2

I am a student and i have an exercise with a linear grammar G=(N, Σ,S,P) where N is a set of nonterminal symbols, Σ is a set of terminal symbols, P is a set of production rules, and S is the start symbol with the productions:

S->aS

S->bX

X->ε

1.So I have to describe N and Σ;

i think that N={S,X} and Σ={a,b} Σ without ε?

2.G is right-linear

  1. Find 4 words for L(G): aab,ab,aaab,aaaab

4.I have to say the language : a*b?

5.I have to say a left -linear language for a*b.

I am blocked.Thank you a lot! :)

Community
  • 1
  • 1
Croco
  • 1

1 Answers1

0

Right about N and Σ. ε is not an alphabet symbol of the grammar but a symbol we use to denote the empty string. One could also write X ->
for the last rule.

Answers 2-4 are correct. Number 5 I do not understand.

Peter Leupold
  • 1,162
  • 1
  • 9
  • 16