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

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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