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
WRITE A JAVA PROGRAM TO PRINT THE PATTERN<br> 13579<br> 2468<br> 357<br> 46<br> 5
Inessa05 [86]

Answer:

import java.util.Scanner;

import java.lang.*;

class Main

{

  public static void main(String args[])

  {

     int n;

     //For capturing the value of n

     Scanner scanner = new Scanner(System.in);

     System.out.println("Enter the value of n:");

     //The entered value is stored in the var n

     n = scanner.nextInt();

     int k=1;

     printnum(n,k);  

  }

  public static void printnum(int n,int k)

  {

       if(n%2==0)

       {

       for(int i=k;i<=n-1;i=i+2)

            {

                System.out.print(i);

            }    

        System.out.println("");

       }

       else

        {

       for(int i=k;i<=n-1;i=i+2)

            {

                System.out.print(i);

            }    

        System.out.println("");

        }

      n--;

      if(n<=1)

      {

         System.exit(0);

      }

      else

      {

          printnum(n,k+1);

      }

   }

}

Explanation:

The program is self explanatory.

4 0
3 years ago
_______ an embedded Word table to activate the Word features.
Bess [88]
The answer is C. double-click
3 0
3 years ago
What is a URL (Please explain)?
GalinKa [24]
Definition

URL a.k.a uniform resource locater, is simply the address of a World Wide Webpage.

Sentence example:

"Type a URL into a browser's address bar."
5 0
3 years ago
The best way for employees to improve their skills online is to enroll in a digital
Maksim231197 [3]

The best way for employees to improve their skills online is to enroll in a digital office.

office.

<u>Explanation:</u>

In the present innovation-driven world, upskilling is turning out to be progressively significant just in light of the fact that innovation changes so quick.

A key preferred position for workers in web-based learning is that representatives can finish their preparation voluntarily and as indicated by their own timetables.

Enrolling in a digital office would allow an individual to learn at their ease, pace and comfort. It will definitely help the individual to expand and acquire skills.

So now full-time workers or the individuals who essentially don't have the opportunity to return to college full-time have a lot of chances to discover low maintenance courses.

6 0
3 years ago
Read 2 more answers
The space between letters in a word is an example of what kind of space?
777dan777 [17]

Answer:

Explanation:

While the words are positive space, you have two kinds of negative space in text passage. Micro-space refers to the small spaces between letters and words. Macro-space, however, refers to the spaces between the big or major elements in a design, like the space between lines and columns of text.

4 0
3 years ago
Read 2 more answers
Other questions:
  • An effective team would never have​
    9·1 answer
  • Look up and list the number of a local taxi or car service in your community. Include the company name and telephone number.
    13·1 answer
  • What is the Matlab command to create a vector of the even whole numbers between 29 and 73?
    11·1 answer
  • A byte is made up of 8 bits (binary digits). You have a programming language that uses one byte to represent characters and are
    5·1 answer
  • What conclusion did Freud reach when attempting to understand the connection between psychological and physical problems?
    12·1 answer
  • Written Hawaiian also has fairly simple spelling rules for determining if a word is a valid word in the language (even if the me
    9·1 answer
  • You are creating a query for a website. The query
    5·1 answer
  • susan wrote the recursive formula for the sequence represented by the exploit formula An=3+2n. put an C net to any correct state
    13·1 answer
  • How to check the at&amp;t internet speed on my computer
    9·1 answer
  • Many programmers think object-oriented programming is a superior approach to procedural programming. Others think it adds a leve
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!