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
The protocol that enables computers on the Internet to communicate with each other is called _____.
dybincka [34]
"C" is the correct answer, if its correct please mark me brainliest.
5 0
3 years ago
Write a Scheme function called "sum" which takes an input function func and a nonnegative number n and outputs the value
solong [7]

Answer:

function sum(number) {

      if (number == 1) {

             return 1;

      }

      return number + sum(number -1);

}

Explanation:

This is a recursive function, it means that is a function that calls itself for example: if you call the function with sum(5) the process is :

sum(5)

   |______ 5 + sum(4)

                           |_______ 4 + sum(3)

                                                       |______ 3 + sum(2)

                                                                                   |_____2 + sum(1)

                                                                                                        |_____ 1

                                                                                                 

the result is 1+2+3+4+5 = 15

7 0
3 years ago
Suppose you have a class called Child with an instance data value called weight and height. Then it has a method called doubleWe
alexira [117]

Answer:

Explanation:

The following code is written in Java. I recreated the entire Child class as described with the instance variables and the doubleWeight method. Then created the getter and setter methods for both the weight and height variables.

class Child {

   double weight, height;

   public double doubleWeight() {

       double superWeight = weight * height;

       return superWeight;

   }

   public double getWeight() {

       return weight;

   }

   public void setWeight(double weight) {

       this.weight = weight;

   }

   public double getHeight() {

       return height;

   }

   public void setHeight(double height) {

       this.height = height;

   }

}

7 0
2 years ago
( answer goes here) are pictures that you can click on to tell your computer what to do.
rosijanka [135]
Um what are you asking here?
8 0
3 years ago
Read 2 more answers
Which can be used to code a simple web page? CSS JavaScript Text editor Web browser
melisa1 [442]

Answer:

option (C) Text editor is the correct answer in this question.

Explanation:Used to code a web page, an editor is required that  is a basic requirement.The other options are secondary ,text editors are provided with operating system and software development .Text editor specialized html editors can offer convenience and added functionality.Test editors require of html and any other web technology like Java script,and server-side scripting languages.

6 0
2 years ago
Other questions:
  • Classify the given items as belonging to the public domain or protected by copyright law.
    6·2 answers
  • A collection of related files that serves as a foundation for retrieving information is a: byte
    12·1 answer
  • Examples of apps include pop-up windows, validation of webform inpts and images that change when a cursor passes over them
    12·1 answer
  • Describe the functions of ALU, resisters, CU, BIU, Cache and FPU.
    7·1 answer
  • Define Turbo C++ and how is the use of Turbo C++.?
    15·1 answer
  • A company wants to build a new type of spaceship for transporting astronauts to the moon. What should the company do first?
    15·2 answers
  • When all the system testing and bugs correction has done, the software product will be delivered to the user for __________.
    15·1 answer
  • Can you guys give some samples of STEM-related studies?​
    7·2 answers
  • I have this questions i need to make it in a report format pages of atleast 3 pages and maximum of 5 pages​
    7·1 answer
  • What are some qualities of a good game critic? What are some qualities of a bad game critic?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!