Relates part of the grammar to a requirement

Assignment Help Basic Computer Science
Reference no: EM13305444

question1: Given the following grammars with start symbol <S>, specify the type (0, 1, 2 or 3) of each  one and give a reason that relates part of the grammar to a requirement for the grammar type. Note:  while technically any grammar is Type 0, the answer should be the highest number that is correct.
a. <S> = aaa<T>bb b. <S> = a<Q>bc | λ
<T> = a<T><T>b | λ <Q>= a<Q>b<T> | λ
b<T>bc = <S> | bbcc
<T>b = b<T>

question2: For each of the following languages on Τ={a, b, c}, construct the corresponding regular expression and regular grammar. All strings containing at most three b's.


question3: Find a regular grammar that produces the language aa*(ab ∪ a)*

question4: For the following expressions of binary operations, a) state whether it is prefix, infix,
postfix or none, b) if it is none, modify it to make it legal prefix and if it is one of {prefix, infix or
postfix}, state what it evaluates to. (All numbers are single digits.)
a. 5 4 * 3 +
b. 8 * 2 - 4
c. * + - 8 2
d. 3 9 2 + -
e. / + 6 4 - 5 3


question5: For programming assignment 1, you were required to scan a file and find the words, while
disregarding anything within <>. The following questions relate to this problem. You can use some
special symbols: > and < can represent the terminals < and >. You may also use symbols from Java's
Pattern class, e.g., p{Lower}, p{Upper}, p{Alpha}, p{Digit} and p{Punct}.
a. Give a grammar and a regular expression for the language consisting of words (which consist
of just letters) separated by punctuation or whitespace (use the special symbols from Java's
Pattern class for letters, numbers, punctuation and whitespace).
b. Assuming we decided to identify numbers, give a grammar and a regular expression for
identifying numbers both integers and floats (e.g., 1.2 365.492).
c. Assuming we decided to recognize headings in HTML (e.g., <h1>...</h1>), give a grammar
for recognizing headings h1 through h3 where the heading is "h" followed by a digit such that
the beginning and end digits match (your grammar does not need to include nested headings).

Reference no: EM13305444

Questions Cloud

Write out the steps for the aldol condensation reaction : Write out the steps for the aldol condensation reaction between the enolate anion of propanal with pentanal.
What is the slope of the security market line : A stock has a beta of 2.5 and an expected return of 11.8%. The risk-free rate is 2.8%. What is the slope of the security market line?
Determine its velocity for t along a straight line : A particle moving along a straight line is subjectd to a deceleration a=(-2v^3)m/s^2 where v is in m/s. If it has a velocity v=8 m/s when t=0, determine its velocity when t=4s.
Obtain the magnitude of the centripetal acceleration : A Geosync TV satellite of mass 2000 kg is in a circular orbit around the earth, making one revolution or orbit every 24 hrs, What is the magnitude of the centripetal acceleration
Relates part of the grammar to a requirement : question1: Given the following grammars with start symbol , specify the type (0, 1, 2 or 3) of each  one and give a reason that relates part of the grammar to a requirement for the grammar type. Note:  while technically any grammar is Type 0, the..
Determine the volume and mass of the liquid : A cylinder contains 3 kg of water and water vapor mixture in equilibrium at a pressure of 500 kN/m2. If the volume of the cylinder is 1.0 m3, calculate the following: a) Temperature of the mixture b) The volume and mass of the liquid
Determine time of flight when it return to original position : A ball is thrown vertically upward with a speed of 15m/s. Determine the time of flight when it returns to its original position.
What was the initial velocity he launched the bait : A fisherman casts his bait toward the river at an angle of 25 degrees above the horizontal. What was the initial velocity he launched the bait
Analyse the effectiveness of the qantas : You are required to analyse the effectiveness of the Qantas Online Air Ticketing system

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Potential vulnerabilities in making purchase with debit card

Recognoze any potential vulnerabilities in making purchase with debit card, and which area of CIA triad they apply to.

  Determine optimal objective function value of lp problem

Implement given LP problem in a spreadsheet. Use Solver to solve problem and create Sensitivity Report. Determine the optimal objective function value if RHS value for second constraint changes from 15 to 25?

  Which is the correct statement for constructor implemention

In a multifile, object-oriented C++ project, which is the correct statement for the constructor implementation, given that the constructor is correctly defined in the class definition file?

  Cmpute cpi and mips rating for processor

Determine the average CPI? On 500MHz Pentium III program takes 1 second. Compute MIPS rating for this processor? What is CPI?

  Why were the sections of the communication

Why were the sections of the Communications Decency Act (CDA) designed to protect children from concerns about Internet pornography so controversial?

  Write dimensions of memory containing bytes of storage

Write down the dimensions of a memory containing 1mb(2^20) bytes of storage? How large would the MAR be? how many bits are sent to the row column decoders?

  Design linked list class hold customer name and phone number

Design your own linked list (LL) class to hold customer names and phone numbers. The class should have member functions for appending, inserting, deleting, searching and displaying nodes.

  Describe the output following series of stack operations

Describe the output of the following series of stack operations: push(5),push(3), push(2), push(8), pop(), top(), push(9), push(1), pop(), push(7),push(6), top(), pop(), push(4), pop()

  Find the solution to each of these recurrence

Find the solution to each of these recurrence relations with the given intial conditions. Use an iterative approach.

  Web page makes effective and consistent use of headings

Use search engine to determine the example of Web page which makes effective and consistent use of headings to organize Web page content.

  Transmitting station montiors bus during transmission

If each transmitting station montiors bus during transmission, how long before it notices the interference in seconds? In bit times?

  Aspects of negotiation will point out it is proceeding well

What aspects of negotiation will point out it is proceeding well or poorly? What will tell you that it is time to arrange further meeting? What signs will you utilize to decide when change in negotiators is necessary?

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