0% found this document useful (0 votes)
7 views2 pages

Rosen 7 e Extra Examples 1301

download and click the button see solution

Uploaded by

Bijay Nag
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views2 pages

Rosen 7 e Extra Examples 1301

download and click the button see solution

Uploaded by

Bijay Nag
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Show All Solutions

Rosen, Discrete Mathematics and Its Applications, 7th edition


Extra Examples
Section 13.1—Modeling Computation

— Page references correspond to locations of Extra Examples icons in the textbook.

p.852, icon at Example 8


#1. Let G = (V, T, S, P ) be a grammar where V = {S, A, B, a, b} is the vocabulary and T = {a, b} is the
set of terminal elements. Determine whether the following set of productions is a:
(i) a type 0 grammar, but not a type 1 grammar.
(ii) a type 1 grammar, but not a type 2 grammar.
(iii) a type 2 grammar, but not a type 3 grammar.
S → ABA, A → bB, B → ba.
See Solution
Solution:
It is a type 2 grammar because the left side of each production has a single nonterminal symbol. It is not a
type 3 grammar because of the form of the right side of the third production.

p.852, icon at Example 8


#2. Let G = (V, T, S, P ) be a grammar where V = {S, A, B, a, b} is the vocabulary and T = {a, b} is the
set of terminal elements. Determine whether the following set of productions is a:
(i) a type 0 grammar, but not a type 1 grammar.
(ii) a type 1 grammar, but not a type 2 grammar.
(iii) a type 2 grammar, but not a type 3 grammar.
S → AB, B → bAa, bAa → a.
See Solution
Solution:
It is automatically a type 0 grammar. It is not a type 1 grammar because the third production is not
noncontracting.

p.855, icon at Example 13


#1.
(a) What is the Backus-Naur form of the grammar described as follows:
1. a sentence is made up of a noun phrase followed by a verb phrase or else by a noun phrase followed
by a verb phrase followed by a noun phrase.
2. a noun phrase is made up of a noun, an adjective followed by a noun, or an article followed by a
noun.
3. a verb phrase is made up of a verb.
4. articles are a and the.
5. adjectives are lengthy, boring, and inaccurate.

1
6. nouns are book, newspaper, and information.
7. verbs are reads and contains.
(b) Explain how “the newspaper contains lengthy information” can be obtained.

Solution: See Solution


(a)
sentence ::= noun phraseverb phrase | noun phraseverb phrasenoun phrase
noun phrase ::= noun | articlenoun | adjectivenoun
verb phrase ::= verb
article ::= a | the
adjective ::= lengthy | boring | inaccurate
noun ::= newspaper | inf ormation
verb ::= reads | contains
(b) “the newspaper” is a noun phrase since it has the form articlenoun; “contains” is a verb phrase since
it has the form verb; “lengthy information” is a noun phrase since it has the form adjectivenoun.
Therefore “the newspaper contains lengthy information” is a sentence since it has the form
noun phraseverb phrasenoun phrase

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy