Is that an adequate description of a language described by a grammar?

Given the following grammar I have been asked to describe the language it generates:

$\displaystyle S \rightarrow aT $

$\displaystyle T \rightarrow a \,|\, UTV $

$\displaystyle U \rightarrow ab \,|\, ba $

$\displaystyle V \rightarrow ac \,|\, ca$

I started with some examples:

$\displaystyle S \implies aT \implies aa$

$\displaystyle S \implies aT \implies aUTV \implies abTac \implies abaac$

$\displaystyle S \implies aT \implies aUTV \implies baTca \implies baUTVca \implies baabaacca$

So my description is:

A language where b's and c's are balanced (including zero of each) centred around an a, such that there will always be 1 more a than the number of b's or the number of c's.

The exact question is "What language is generated by the grammar?", given this information would you agree that this is an adequate answer?

Thanks

Re: Is that an adequate description of a language described by a grammar?

Hey alexgeek.

I don't know what is expected by your professors/lecture-persons/tutors but when I think of a language I think of the syntactic properties associated with the language whether that includes some sort of grammar, finite automata description, or markov model (or a combination of the three).

It's just a little hard to know exactly what the question is asking let alone to give an adequate answer.

Do you have another question like this that has an existing solution? Also are doing this as part of a particular course? (Compiler design, linguistics, etc)?

Re: Is that an adequate description of a language described by a grammar?

Quote:

Originally Posted by

**alexgeek** So my description is:

A language where b's and c's are balanced (including zero of each) centred around an a, such that there will always be 1 more a than the number of b's or the number of c's.

First, this is a description of words that result from T, not S. S adds an additional a in the beginning. Second, this description is true for all words in the language of T, but it is also true of some words outside the language. Namely, it does not preclude words where c occurs in the first half or where 3 b's occur in a row.

I would describe this language as $\displaystyle a(ab|ba)^na(ac|ca)^n$.

It is recommended to post questions about formal languages in the Discrete Math subforum.