1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
masha68 [24]
3 years ago
6

Write a grammar for the language consisting of strings built only of the letters a and b. The strings may have any number of the

se letters, but the letter combinations bb must be in each string somewhere, and each string must end with a ba.
Computers and Technology
1 answer:
Alika [10]3 years ago
4 0

Answer:

Grammer:

S->ABS/bba

A->aA/ab

B->bB/ba

Output:

  1. abbabba
  2. aabbbabba
  3. bba

Explanation:

The above grammar satisfies the question because the question says that there is a combination of string made by 'a' and 'b' which ends with 'ba' and there is somewhere 'bb' in the string. Prove of the above grammar is as follows--

  • Take the 'S' and replace it with 'ABS'. Then 'A' will replace with 'ab' and 'B' will replace with 'ba' and 'S' will replace with 'bba' then the string will "abbabba", which is the first output.
  • Take the 'S' and replace it with 'ABS'. Then A will replace with 'aA' and 'B' will replace with 'bB' and 'S' will replace with 'bba' then further 'A' will replace with 'ab' and 'B' will with 'ba' and then the string will "aabbbabba", which is the second output.
  • Take the 'S' and replace it with "bba" and the string will "bba".

So the question says that there is a string ending with 'ab' and there exits 'bb' in anywhere. so all the output define above satisfies the condition and all other output also satisfies the condition.

You might be interested in
What color line appears under a word that is spelled incorrectly in power point
strojnjashka [21]

Answer:a wavy red line

Explanation:

Hope this helps

Can I have brainliest pls

7 0
3 years ago
Read 2 more answers
I don't understand how to write code for this in Java using nested for loops only. The official question is: write a program tha
Bingel [31]

Answer:

public class Triangle

{

public static void main( String[] args )

{

show( 5 );

}

public static void show( int n )

{

int i,j,k;

for (i = 0; i < n - 1; i++ )

{

for (j = 0; j < i; j++ )

{

System.out.print( " " );

}

for (k = n - i; k > 0; k-- )

{

System.out.print( "* " );

}

System.out.println();

}

for (i = 0; i < n; i++ )

{

for (j = n - i; j > 1; j-- )

{

System.out.print( " " );

}

for (k = 0; k < i + 1; k++ )

{

System.out.print( "* " );

}

System.out.println();

}

4 0
3 years ago
How can you know if the person or organization providing the information has the credentials and knowledge to speak on this topi
Minchanka [31]

Answer:

The affiliation of the writer is that She is on the staff at the Center for Food Safety (CFS).

Explanation:

CFS stands for the Center for Food Safety which is the national non-profitable public environmental and interest advocacy organization that is working for protect the human health and environment by the curbing use of the harmful food productions technologies and by the promoting an organic and other form of the sustainable agriculture.

7 0
3 years ago
For the best night photographs, you’ll need to have a camera with a shutter speed of about 3 to 30 seconds
Alex_Xolod [135]
What are you trying to ask?

8 0
3 years ago
A linear gradient can be positioned from left to right, top to bottom, or on any angle?
Harman [31]

from left to right because it is used more in expressions

3 0
3 years ago
Other questions:
  • An application programming interface (API) is ________. A) the code the application software uses to take advantage of code writ
    11·1 answer
  • - If we place records from different tables in adjacent____________, it would increase efficiency of a database.
    14·1 answer
  • After modifying the font of the Subheading1 style, you notice that the font of Subheading2 has also changed. What is the most li
    12·2 answers
  • A newly opened law firm in Kirkland decides to create a small website that provides a brief introduction of the firm, its missio
    8·1 answer
  • Is badlion safe and how ?
    14·1 answer
  • A local bank has an in-house application which handles sensitive financial data in a private subnet. After the data is processed
    15·1 answer
  • What is python, the coding language
    6·2 answers
  • Alice recently purchased a new cell phone. After her vacation, Alice wanted to transfer her holiday photos to her computer to do
    8·1 answer
  • Fill in the Blank
    10·2 answers
  • Providing captions and transcripts for videos on your website is a way of ensuring what?.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!