13

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Problem

Let G = (V,∑,R, S) be the following grammar. V = {S, T, U}; ∑ = {0, #}; and R is the set of rules:

a. Describe L(G) in English.

b. Prove that L(G) is not regular.

Step-by-step solution

Step 1 of 4

Let be the grammar. is the set of rules.

Comment

Step 2 of 4

Description of in English is given as

is the set of all strings containing of the form(s)

(a) Strings containing exactly two ’s and any number of .

(b) Strings containing exactly one and the number of on the left of are half the number of to the right.

Comments (1)

Step 3 of 4

To prove the language is not regular, consider by contradiction is regular.

Let .

From our consideration is regular. So is regular.

Since is regular, using pumping lemma let be the pumping length of the regular language.

Consider the sting .

Clearly length of the string is greater the . That is .

So, by pumping lemma we have such that

Comment

Step 4 of 4

Since is a regular language, consider the possible ways of cutting the string .
• If contains the character , then will be on the right side of . Pumping down, increases the number of on the left such that number of on
the left of are not equal to half the number of to the right.

• If contains the character , then pumping down, increases the number of ’s in the string.

• If contains the character , then will be on the left side of . Pumping down, decreases the number of on the right such that number of
on the left of are not equal to half the number of to the right.

The resulting string of all the above cases does not belong to . So, we can say that does not satisfy pumping lemma. Hence is not a regular
language.

This is a contradiction to our statement that regular language.

Therefore, is not a regular language.

Comment

You might also like