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
Elanso [62]
3 years ago
6

Give CFG for the following languages,

Computers and Technology
1 answer:
polet [3.4K]3 years ago
8 0

Answer:

a.  

CFG for {a^{n}b^{m}, m=n-1 and n=1,2,3… …}

Here we can have a string containing only a single a and no b.

For that the production rule is S → aT, T → ε

Now  to get the strings with at least one b, the production rule is to be

T → ATB/ ε

A → a

B → b

Now merging two set of production rules:

S → aT

T → ATB/ε    [As T → ε is in both set, so one occurrence is taken]

A → a

B → b

Now let us generate “aaabb”

S → aT → a ATB → aAATBB → aaATBB → aaaTBB → aaaεBB → aaaεbB →aaaεbb → aaabb

b.  

CFG for {a^{n}b^{2n}, n=1,2,3… …}

Here for every single a, we have to generate two b’s.

So the production rule is to be:

                          S → aSbb/ε

Each time S will generate two b’s for one a.

You might be interested in
The letters LAN stand for Area Network.
Slav-nsk [51]

The letter LAN stand for : Local Area Network

8 0
3 years ago
Read 2 more answers
Code a program that gets all possible solutions of a string using 3 for loops. Actual question attached
Nikitich [7]

\tt x=int(input("Enter\:first\:no:"))

\tt y=int(input("Enter\:second\:no:"))

\tt z=int(input("Enter\:third\:no:"))

\tt for\:x\:in\: range (3):

\quad\tt for\:y\:in\:range(3):

\quad\quad\tt for\:z\:in\:range(3):

\quad\quad\quad\tt if\:x!=y\:and\:y!=z\:and\:z!=x:

\quad\quad\quad\quad\tt print(x,y,z)

8 0
2 years ago
Which of the following need to be assessed during unit testing?
diamong [38]
E) both C and D Erro handling and execution paths
8 0
4 years ago
A que generacion pertenecen los gadgets?
alukav5142 [94]

Answer:

English please

Explanation:

8 0
3 years ago
The P in SOAP stands for Persuasion. <br> a. True<br> b. False
fredd [130]
The answer is false.
  P in soap stands for purpose. SOAPS stands for Subject(what is being discussed), Occasion(what is the context of events), Audience(to whom the message is directed), Purpose(what is the recommended action for the reader) and the Speaker(what or who is the source).
4 0
3 years ago
Read 2 more answers
Other questions:
  • What was the han dynasty and the roman empire known for?
    5·1 answer
  • Which type of network is created when you use encrypted tunnels between a computer or a remote network and a private network thr
    13·1 answer
  • Some cars are 100 percent efficient at converting energy from gasoline to energy of motion.
    11·2 answers
  • Match the terms with their definitions.
    5·2 answers
  • Why did artists use pinhole cameras during the renaissance?
    8·1 answer
  • Blank are back and forth movement of matter that create sound​
    15·1 answer
  • If Asa changes the text to bold, he has changed the style. True False
    8·2 answers
  • A program that will read each player’s name and golf score as keyboard input,
    9·1 answer
  • A photographer uses which of these tools to form an argument?
    14·2 answers
  • Are all the computer users known as programmer ​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!