Question

Asked Apr 5, 2019

138 views

Find context-free grammars for the following languages (with *n* ≥ 0, *m* ≥ 0, *k* ≥ 0): *L* = {*a*^{n}*b*^{m}*c*^{k}, *k* = *n* + *m*}.

Step 1

**Solution:**

Given language,

L = {a^{n}b^{m}c^{k}, k = n+m}

Consider the “G” as grammar production is given below:

Step 2

Here, we need to prove that L(G) = L

To attain above expression, we need to prove that “L is subset of L(G)” and “L(G) is subset of L”.

Derive the string “S” by following methods:

From the given language L, S can be derived as

Step 3

The “S-> anbmc(m+n)” statement consider as equation (1).

Here, the primary thing is to apply “*” to “S” with for string for “n” tim...

Tagged in

Q: How to write a function in python where it takes a list of string s. Where s= ["hello","lazyness","p...

A: The program has the following algorithm:Intitialize the counter counting string list position number...

Q: Write a PL/SQL block to accept a date from the user and print the day and the date as shown below. U...

A: Solution:Given data,The PL/SQL code read the user input of date and display the day and the date in ...

Q: Function Name: compliments Parameters: answer1 - a boolean (True or False) representing whether the ...

A: Solution:The following function displays the outputs as string of compliments.

Q: Visual Basic. Write the definition of a function named quadratic that receives three double paramete...

A: Formula for quadratic equation:

Q: Consider the languages below. For each, make a conjecture whether or not it is regular. Then prove y...

A: The given language L = {anbl : n/l is an integer} is not regular language because a DFA cannot be co...

Q: write a program to convert between KPH and MPH in either direction. in Eclipse.If you are driving ac...

A: Hey,,,We have to use scanner class to get input .So we will import scanner package to access the s...

Q: getRandomLib.h: // This library provides a few helpful functions to return random values// * getRand...

A: Program Instructions:Include the necessary header files.Print hello message and as for a response.De...

Q: Hi, Please,I have a question with Python,I have to create a Loop and terminate BMI calculation flow...

A: The loop of flow chart for BMI is given as:

Q: 11.7: Customer AccountsWrite a program that uses a structure to store the following data about a cus...

A: Program plan:Include the required header files.Define the structure “customerAccount”Declare the req...