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

  What are the primary tasks of a system administrator

what are the primary tasks of a system administrator? 2. What does each task accomplish

  Prepare database design documents using the data definition

Prepare database design documents using the data definition, data manipulation, and data control language components of the SQL language.

  Context-free languages is closed under the regular opeations

Show that the class of context-free languages is closed under the regular opeations, union, concatenation, and star.

  Discuss the different reasons for terminating a process

discuss the different reasons for terminating a process and the commands used for this purpose.

  Main attributes of product in plug-ins change process

What are some main attributes of product and how may it help operations of organization? How do third-party plug-ins change process of diagnosing and troubleshooting errors in application?

  Explaining major provisions of telecommunications act

Write down some of the major provisions of the Telecommunications Act of 1996?

  Create a method that prints rectangle characters to console

Create a method that prints a rectangle of characters to the console

  How to boost over company-s former speed champ

Explain the definition (or definitions) of performance which you think the company utilzed. Do you believe the news release is misleading?

  Flowchart, psuedocode and desk check

Flowchart, psuedocode and desk check

  Identification of the concept of a target audience

You are working on a new Web site for Cruzes, Inc. The Web site is aimed at providing travel information to consumers interested in cruises. When meeting with Jason, the marketing manager of Cruzes, Inc

  Explaining health insurance portability-accountability act

Based on your knowledge of IT security management, argue for or against assertions that Epworth system is in compliance with Health Insurance Portability and Accountability Act (HIPAA).

  How much would it have cost to have corrected fault

How much would it have cost to have corrected the fault during the specification phase? What should be the best answer to this question by a software engineering?

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