Generating grammar

S A B S A B \displaystyle S\to ABS\mid AB

A aaa A ϵ \displaystyle A\to \text{aaa}A\mid \epsilon

B B bb ϵ \displaystyle B\to B\text{bb}\mid \epsilon

A bb A \displaystyle A\text{bb}\to A

The above grammar generates a language that is which of the following?

Regular but not finite Finite Not Context-Free Context-Free but not regular

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Maggie Miller
Jul 21, 2015

The generated language is L = L ( ( aaa bb ) ) L=L((\text{aaa}\cup\text{bb})^*) ; or in English, words in { a , b } \{\text{a},\text{b}\}^* so that consecutive strings of a's have length divisible by three and consecutive strings of b's have length divisible by two.

This language is clearly infinite, since b 2 n L \text{b}^{2n}\in L for each n n . It is also regular, since L L is decided by the following Finite State Machine.

Therefore, the answer is regular but not finite .

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...