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

  How would you deallocate memory in a destructor

We can use the destructor to deallocate memory for an object. How would you deallocate memory in a destructor?

  How an object would be instantiated using both types

explain what constructors do and when they are executed. Explain the two types of constructors. Provide an example class that includes both types of constructor functions and demonstrate how an object would be instantiated using both types of cons..

  Design a circuit that takes two 3-bit binary number

design a circuit that takes two 3-bit binary numbers A2A1A0 and B2B1B0 as inputs and that has single output L that is "one" if and only if A2A1A0 is less than B2B1B0. Your design can make use of NOT gates, XNOR gates, AND gates and OR gates as requir..

  Who are getting advantages from piracy robberies

Why are (were) pirates difficult to eliminate? What to you believe about pirates as moder-day Robin Hoods? Who are getting advantages from piracy robberies?

  Distinguish distances that moved their shopping carts

Performing 200 Nm of work. Both Brian and Dawn are exerting same amount of force (20 N). Distinguish the distances that Brian and Dawn moved their shopping carts.

  Can you identify the gaps in your knowledge

Compile a list of at least four skills that are listed as essential or desirable from the advertisments you have sighted, that are unrelated to the specifics of the discipline area.

  Explain make-buy decision for management prerogative

Make-buy decision is the significant management prerogative. You are manager of software organization which has average software development cost of $20.00/LOC.

  How structured approach associates to creating programs

When building the house, structured, modular approach is better than haphazard approach. Describe how structured approach associates to creating programs.

  A network analyzer displays the following ip datagram

A network analyzer displays the following IP datagram that carries a UDP segment. Use the IP and UDP headers to answer the following questions

  Research details of ad of current web site or magazine

Pick a current web site or magazine ad for a complete, working computer system, including computer, monitor, keyboard, and software, together with extra devices such as a mouse or printer

  With replacement order matters

Given an alphabet of size N=9. Write a c++ program that compares the number of possible sequences of the length L that can be generated inder the following assumptions: With replacement order matters, without replacement order matters, and without..

  Problem of determining whether a dfa

Consider the problem of determining whether a DFA and a regular expression are equivalent. Express this problem as a language and show that it is decidable.

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