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
Tara needs to select all of the text in a Word document. Which keyboard shortcut will achieve this goal?
user100 [1]
Ctrl + a im pretty sure
3 0
3 years ago
Read 2 more answers
Consider the following code segment: try : inputFile = open("lyrics.txt", "r") line = inputFile.readline() print(line) _________
aleksandrvk [35]

Answer:

The answer is "except IOError:"

Explanation:

It is part of the exception handling, that stands for input/ output operation fails, this exception aeries when we attempting to access an anti-existent file, in the program so, it will give the program related errors.

  • This type of error is handled in the try block, it also allows you to prepare the deal with the exceptional block.  
  • It also helps you to hide the bugs by using code, if you handle an unexpected error.
6 0
2 years ago
How to tell if screen or screen protector is cracked?
beks73 [17]
You will feel the screen protector crack
6 0
3 years ago
Read 2 more answers
Which tool is used to create a basic web page using HTML?
GuDViN [60]

Answer:

A text editor

Explanation:

A text editor is an application that enables a programmer edit and create codes in a programming language. These codes are then executed to do just what the programmer wanted them to do.

5 0
2 years ago
Read 2 more answers
The ___ appears at the bottom of the windows desktop; it is used to launch and manage programs.
asambeis [7]
<span>The taskbar appears at the bottom of the windows desktop. It is used to launch and manage programs. 
</span>The taskbar is part of the GUI (Graphical User Interface) . The most common uses of the taskbar is to<span> to locate and launch programs through the Start button, to view any program that is currently open, check the date an time.</span>
4 0
2 years ago
Other questions:
  • Building relationships during your career exploration is called
    9·2 answers
  • Can you plug a usb 2.0 into a 3.0 port on your computer
    12·1 answer
  • One of the attributes in a table in your database depends on another attribute for its meaning. What type of dependency has been
    14·1 answer
  • Which is a description of phishing?
    7·1 answer
  • Which tool allows multiple users to dynamically update a document at the same time? Question 3 options: Google Docs OneDrive Exc
    14·1 answer
  • Is badlion safe and how ?
    14·1 answer
  • The CMOS battery located on a computer's motherboard allows for maintaining the correct time and date information stored in CMOS
    7·1 answer
  • What is the second stage of information processing cycle​
    10·2 answers
  • Course Aggregation Many times, departments are only interested with how students have done in courses relative to a specific maj
    14·1 answer
  • A timer is set after each frame is sent before waiting an ACK for that frame, how long does the timer take to be expired?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!