Use the above grammar to derive the string

Assignment Help Basic Computer Science
Reference no: EM13215284

Here is a context-free grammar that can be used to generate algebraic expressions via the arithmetic operators (addition, subtraction, multiplication, and division), in the variables p, q, and r. The letter E stands for expression:

Rule 1: E -› p

Rule 2: E -› q

Rule 3: E -› r

Rule 4: E -› E + E

Rule 5: E -› E - E

Rule 6: E -› E X E

Rule 7: E -› E/E

Rule 8: E -›(E)

(i). Use the above grammar to derive the string given by the mathematical expression E = (p + q) X p - r X p/(q + q)

(ii). Provide a parse tree for this derivation.

 

Reference no: EM13215284

Questions Cloud

Operations of organization during contingency operations : The CP policy is the formal policy that will guide the efforts of the subordinate teams in developing their plans, and the overall operations of the organization during contingency operations.
How complete manufacturing cost schedule has been prepared : Fortress Inc. manufactures pistons for custom motorcycles within a relevant range of 300,000 to 375,000 pistons per year. Within this range, the following partially completed manufacturing cost schedule has been prepared: Complete the cost schedul..
Institution of slavery was firmly entrenched : In 1860, the institution of slavery was firmly entrenched in the United States; by 1865, it was dead. How did this happen?
Which of the following statements is true : Which of the following statements is true?
Use the above grammar to derive the string : Here is a context-free grammar that can be used to generate algebraic expressions via the arithmetic operators (addition, subtraction, multiplication, and division), in the variables p, q, and r.
Define environment and general good of society : In particular do you think subjects like customer and employee safety, environment and general good of society fits in this framework or they essentially ignored?
Calculate the net profit for all the products : Given the list of all the product prices and wholesale prices as well as a list of all the items sold for each product calculate the net profit for all the products.
Considering the current political and social circumstances, : Considering the current political and social circumstances, who really won the Scopes Trial? What did Sinclair mean when he said, "I aimed for the reader's heart and hit him in the stomach?"
Plans call for the following numbers of washing machines : Bindley Corporation has a one-year contract to supply motors for all washing machines produced by Rinso Ltd.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Marie program that will input a variable

To develop a MARIE program that will input a variable number of user entered Decimal whole number grades, validating each one (0-100) in a subroutine

  Explore and estimate software programs

Explore and estimate software programs based on following criteria: Needs assessment -- Why would the prospective user require program? Write down the features of the program?

  Use the mvc design pattern to create a gui program

Use the MVC design pattern to create a GUI program for Triangle objects. Include a form for users to enter values for a triangle;s three sides and a button that when clicked, displays data from the Triangle object created from the input.

  How many instructions can the processor execute

Assume that we are working on a workstation with an instruction rate of 500 MIPS. How many instructions can the processor execute between the receipt of each individual bit of the message?

  Reads in three integers

Write a program that reads in three integers and determines and prints the smallest number numerically in the group. The values are NOT necessarily entered in numeric order.

  How to design a new isa

How to design a new ISA? What should take into consideration?

  Examine each of the principles discussed

Examine each of the principles discussed in Sec. 2.1.4 and tell whether they are so important (assuming that high performance is still desired).

  What is an erp system

What is an ERP system? What are the top three reasons companies choose to use it as the basis for designing their information systems?

  Write files which do not reside at root or master directory

Provide the example of names of three files from own computer that do not reside at the root or master directory. For each file, list both therelative filename and its complete filename.

  Systems analyst modifying the sales order process

Suppose that you are a systems analyst on a project that involves modifying the sales order process. How many do you need to sample if you want 95 percent certainty that you have covered all variations?

  Discuss difference between microcontroler and microprocessor

Discuss the differences between microcontrollers and microprocessors.

  Recognize ten different areas where software helps

In spreadsheet, recognize at least 10 different areas where software could help you, like collecting rent, performing tenant background checks, and scheduling building maintenance.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd