Purchase Solution

Context Free Grammar Problem

Not what you're looking for?

Ask Custom Question

Write a grammar that generates the language described as the following set:

{x∈ {a,b}*|x,where count(b)=2*count(a)}

The answer I came up with is
S->SaSbSbS
S->SbSaSbS
S->SbSbSaS
S-> ϵ

Is this correct?

Purchase this Solution

Solution Summary

The solution solves a context free grammar problem.

Purchase this Solution


Free BrainMass Quizzes
C++ Operators

This quiz tests a student's knowledge about C++ operators.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

C# variables and classes

This quiz contains questions about C# classes and variables.

Javscript Basics

Quiz on basics of javascript programming language.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.