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 do you think about the use the top song on a video you are creating
stepladder [879]

Hiya!


Using a popular song in a video your making is most definitely going to attract more viewers. It's all about making the video appeal to the person.

^Hope this helps

3 0
3 years ago
Read 2 more answers
The ________ occurs when the user presses the enter key without typing a value for an input operation.
Morgarella [4.7K]

The empty input occurs when the user presses the enter key without typing a value for an input operation.

4 0
3 years ago
Are used in the Excel application to create calculations
OlgaM077 [116]

Answer:

I think the answer is formulas

6 0
3 years ago
Read 2 more answers
Which keys can be pressed to change the cuboid/frame selector color on remotasks lidar course
Dmitry_Shevchenko [17]

Answer:

c h b l

color palette and a lightbulb

5 0
3 years ago
Write a for loop to print all elements in courseGrades, following each element with a space (including the last). Print forwards
ozzi

Answer:

The missing part of the code is:

for (i = 0; i < courseGrades.length; ++i) {

           System.out.print(courseGrades[i]+" ");         }

       System.out.println();

       for (i = courseGrades.length-1; i >=0 ; --i) {

           System.out.print(courseGrades[i]+" ");         }

       System.out.println();

Explanation:

This iterates through the array

for (i = 0; i < courseGrades.length; ++i) {

This prints each element of the array followed by a space

           System.out.print(courseGrades[i]+" ");         }

This prints a newline at the end of the loop

       System.out.println();

This iterates through the array in reverse

       for (i = courseGrades.length-1; i >=0 ; --i) {

This prints each element of the array (reversed) followed by a space

           System.out.print(courseGrades[i]+" ");         }

This prints a newline at the end of the loop

       System.out.println();

6 0
3 years ago
Other questions:
  • Provide an example of a time in your personal or work life when you used the household measuring system and measured out an exac
    6·1 answer
  • Lucinda works at a recycling center. She noticed an increase in glass recyclables entering the center. She collects data regardi
    7·2 answers
  • Create a dictionary named letter_counts that contains each letter and the number of times it occurs in string1. Challenge: Lette
    14·1 answer
  • ____________ is a widely accepted international best practices framework for implementing information systems security.
    12·1 answer
  • Write a program that takes the radius of a sphere (a floating-point number) as input and then outputs the sphere’s: Diameter (2
    7·1 answer
  • Taking a group of recipes and identifying the similarities is an example of _____.
    13·1 answer
  • Examples of application software​
    7·2 answers
  • Write a function in Java to implement the following logic:
    13·1 answer
  • Blockchain is often associated with Bitcoin and the financial services industry. However, it is applicable to almost every indus
    13·1 answer
  • An opening inside the system unit in which you can install additional equipment can be known as
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!