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

  Find monthly break-even volume for company

Variable cost per pound of fertilizer is $0.15. Evergreen sells fertilizer for $0.40 per pound. Find out the monthly break-even volume for company.

  Dynamic programming

Please provide with a detailed answer using DYNAMIC PROGRAMMING

  Explaining benefits of reconnaissance tools

Write down some popular reconnaissance tools? Compare three reconnaissance tools and describe the benefits and limitations of each.

  Find whether bit string contains two consecutive one bits

You wish to find out whether bit string contains two consecutive 1 bits. Obviously, you can do this using n probes. For which values of n in range {3, 4, 5, 6, 7} can this be done using fewer than n probes?

  Select a current trend in area of telecommunications

Research and select a current trend in the area of telecommunications. Find the topic and send to instructor for approval. Then, prepare a 10-15 page paper in Microsoft Word.

  Class polygon which draws a hexagon for a set of numbers

Write a class Polygon which draws a hexagon for a set of numbers given by the user. You must only use method drawLine of class Graphics (other fill or draw methods won't be accepted).

  Program to compute each semester tuition for each student

write a program to compute each semester the tuition for each student. Studient is taking 12 credit or less, tuition is 675 oer credit if student is taking more than 12 credits the total tuition is 6300.

  Show how you would read the status of 100 students

Sample input and the results are shown below. Please enter 10 numbers: 10 31 2 73 24 65 6 87 18 9 Your numbers are: 10 9 31 18 2 87 73 6 24 65

  Enforcing mandatory access control environment

Users dont seem to understand that they need to handle certain documents with more care and control than others. Which of the following will improve this situation?

  Why information technology is a business pressure

Explain in detail why Information Technology (IT) is a business pressure and also an enabler of response activities.

  Explaining downtick in project success rates of it projects

What is the likely reason or reasons for the downtick in project success rates of IT projects and what recommendations would you make to improve the success rates? Be specific.

  Technology in home-workplace has negative impact on women

What technology in the home and workplace has a negative impact on women, if any; and (b) do women roles still remain largely associated with the home and domestic chores.

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