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
Assume you have thefollowing declaration int beta[50];.Which of the following is a valid elementof beta?
ANEK [815]

Answer:

A - beta[0]

Explanation:

Beta[0] is the first element of the array, therefore automatically it is a valid element of beta. B and C are disqualified because you would not use single quotations when referring to an element. D is disqualified because the element starts at 0 (beta[0]) and has 50 elements declared, therefore it would end at 49, with beta[49] being the last element.

4 0
3 years ago
The set of instructions that allows a particular program to complete a task.
Savatey [412]
Interpreter is doing task to complete the task
8 0
3 years ago
Which internetworking device makes computers that are connected to separate segments appear and behave as if they're on the same
Temka [501]

NIC Ports use which RJ connector? RJ-45 internetworking device makes computers that are connected to separate segments appear and behave as if they're on the same segment.

There's a lot of confusion out there about which NIC ports use which RJ connectors. RJ-45 internetworking devices make computers that are connected to separate segments appear and behave as if they're on the same segment. So, which one do you use?

The answer is actually quite simple. If you're connecting two computers together, you'll need to use an RJ-45 cable. If you're connecting a computer to a modem or router, you'll need to use an RJ-11 cable.

RJ-45 cables are actually quite common and can be found at most electronics stores. If you're not sure which one you need, just ask a sales associate for help.

Learn more on internetworking device here:

brainly.com/question/28342757

#SPJ4

3 0
2 years ago
When considering the purchase of a major software application, managers need to also consider the following potential downside:
Anastasy [175]

Answer:

The answer is B.The package seldom totally fits the company's needs

Explanation:

7 0
4 years ago
If you create a keyIterator and a valueIterator for the same dictionary,a. the number of items in keyIterator is smaller than th
irga5000 [103]

Answer:

b. the number of items in keyIterator is equal to the number of items invalueIterator

Explanation:

A dictionary in python is an unordered and unindexed data structure. It stores data in key-value pairs, this means that for every key in a dictionary, there must be a value. A keys() method is used to create an iterator of dictionary keys. The items of this iterator can be used in a list comprehension, using the dictionary name and the item key to get the values of the dictionary, creating a list of the dictionary values. The values attribute can also be used for this purpose but cannot be used to get the keys.

5 0
3 years ago
Other questions:
  • Can you give me a long list of old kid's cartoons
    8·1 answer
  • In most signal "timing diagrams" (like the one below) the signals do not change from low to high, or from high to low, abruptly.
    5·1 answer
  • A ____ is text and graphics that print at the top of each page
    14·1 answer
  • "the most common way to access the internet is through ________."
    5·1 answer
  • The smallest network
    13·1 answer
  • How do humans acquire voltage in their bodies
    8·1 answer
  • Say you write a program that makes use of the Random class, but you fail to include an import statement for java.util.Random (or
    10·1 answer
  • Suppose the inventory is unordered (!) and a sequential search is done to locate a specific artifact. Given that the search is e
    5·1 answer
  • What is the missing line of code?
    7·1 answer
  • What happens when you apply a theme to a form?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!