Computer Science: An Overview (13th Edition) (What's New in Computer Science)
13th Edition
ISBN: 9780134875460
Author: Glenn Brookshear, Dennis Brylow
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 6, Problem 41CRP
Program Plan Intro
Syntax diagram:
Syntax diagram is the
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
The language composed of all strings over the alphabet {a,b} of the
form: zero or more a's followed by zero or more b's, i.e., {"", a, b,
aa, ab, bb, aaa, aab, abb, bbb, ...}, where "" is the empty string, is
a regular language: show why this is. Note that you may use any line
of argument on regular languages, e.g., by showing
that it can be constructed using the properties ("Regular
Language: a formal definition"), or by drawing the finite state
automaton (FSA), or giving its description.
. Prove that the intersection of two context-free languages is not necessarily context-free. This is unlike the
case of regular languages which are closed under intersections. Hint: Do something similar to what we did on
Activity #21 to show something about two of the languages below and then use what we proved in class about
the remaining language. Write several sentences to explain your reasoning.
L₁ = {ww has the form a"b"c" for some whole numbers n and m}
L2 = {ww has the form amb"c" for some whole numbers n and m}
L3 = {w|w has the form a"b"c" for some whole number n}
Thank you in advace for quick response for both questions. Thanks
1. Build a FA that accepts the language of strings, over alphabet {a, b}, that start with a followed by b or with b followed by a and that end with a.
Problem 4:
2. Build a TG that accepts the language of strings, over alphabet {a, b}, that start with ab and end with ba or those that start with ba and end with ab.
Chapter 6 Solutions
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
Ch. 6.1 - In what sense is a program in a third-generation...Ch. 6.1 - We can summarize the imperative programming...Ch. 6.1 - Prob. 4QECh. 6.2 - Why is the use of a constant considered better...Ch. 6.2 - Prob. 2QECh. 6.2 - Prob. 3QECh. 6.2 - Identity some common control structures found in...Ch. 6.2 - What is the difference between an array and an...Ch. 6.3 - Prob. 1QECh. 6.3 - Prob. 2QE
Ch. 6.3 - Why do many programming languages implement I/O...Ch. 6.3 - Prob. 4QECh. 6.3 - Prob. 5QECh. 6.4 - Prob. 1QECh. 6.4 - What is a symbol table?Ch. 6.4 - What is the difference between a terminal and a...Ch. 6.4 - Prob. 4QECh. 6.4 - Prob. 5QECh. 6.4 - Prob. 6QECh. 6.5 - What is the difference between an object and a...Ch. 6.5 - Prob. 2QECh. 6.5 - Suppose the classes PartTimeEmployee and...Ch. 6.5 - What is a constructor?Ch. 6.5 - Why are some items within a class designated as...Ch. 6.6 - Prob. 1QECh. 6.6 - Prob. 2QECh. 6.6 - Prob. 3QECh. 6.7 - Prob. 2QECh. 6.7 - Prob. 3QECh. 6.7 - Prob. 4QECh. 6 - Prob. 1CRPCh. 6 - Translate the following Python program into the...Ch. 6 - Prob. 3CRPCh. 6 - Why was it necessary to identify the type of data...Ch. 6 - Prob. 6CRPCh. 6 - Suppose the function f expects two numeric values...Ch. 6 - Suppose f is a function that returns the result of...Ch. 6 - Prob. 9CRPCh. 6 - Summarize the distinction between a machine...Ch. 6 - John Programmer argues that the ability to declare...Ch. 6 - Summarize the distinction between declarative...Ch. 6 - Explain the differences between a literal, a...Ch. 6 - a. What is operator precedence? b. Depending on...Ch. 6 - Prob. 16CRPCh. 6 - What is the difference between the meaning of the...Ch. 6 - Draw a flowchart representing the structure...Ch. 6 - Prob. 19CRPCh. 6 - Prob. 20CRPCh. 6 - Draw a flowchart representing the structure...Ch. 6 - Rewrite the following program segment using a...Ch. 6 - Summarize the following rats-nest routine with a...Ch. 6 - Prob. 24CRPCh. 6 - Prob. 25CRPCh. 6 - Suppose the variable X in a program was declared...Ch. 6 - Prob. 27CRPCh. 6 - Why would a large array probably not be passed to...Ch. 6 - Sometimes an actual parameter is passed to a...Ch. 6 - Prob. 32CRPCh. 6 - What ambiguity exists in the statement X = 3 + 2 ...Ch. 6 - Suppose a small company has five employees and is...Ch. 6 - Prob. 35CRPCh. 6 - Prob. 36CRPCh. 6 - Prob. 37CRPCh. 6 - Prob. 38CRPCh. 6 - Prob. 39CRPCh. 6 - Design a set of syntax diagrams that describes the...Ch. 6 - Prob. 41CRPCh. 6 - Prob. 42CRPCh. 6 - Add syntax diagrams to those in Question 5 of...Ch. 6 - Prob. 44CRPCh. 6 - What code optimization could be performed by a...Ch. 6 - Simplify the following program segment Y = 5 if (Y...Ch. 6 - Simplify the following program segment while (X !=...Ch. 6 - In an object-oriented programming environment, how...Ch. 6 - Describe how inheritance might be used to develop...Ch. 6 - What is the difference between the public and...Ch. 6 - a. Give an example of a situation in which an...Ch. 6 - Describe some objects that might be found in a...Ch. 6 - Prob. 53CRPCh. 6 - Prob. 54CRPCh. 6 - Prob. 55CRPCh. 6 - Prob. 56CRPCh. 6 - Prob. 57CRPCh. 6 - Prob. 58CRPCh. 6 - Prob. 59CRPCh. 6 - In general copyright laws support ownership rights...Ch. 6 - By using a high-level programming language, a...Ch. 6 - Prob. 3SICh. 6 - Prob. 4SICh. 6 - Prob. 5SICh. 6 - Suppose an amateur programmer writes a program for...Ch. 6 - Prob. 7SI
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Design a Turing Machine that accepts the language L = {a"b" | n ≥ 0}. Provide a formal description, i.e., a state diagram. You must submit a JFLAP file and in your report 5 strings that are accepted and 5 strings that are not accepted.arrow_forwardFormalize the following sentence in english: 3X. elephant(X)|arrow_forwardFor this exercise, we will work on a regular grammar to recognize a comment in a C++ or Java program. A comment starts with /* and ends with */ and anything else in between can be ignored. We won't consider the case of nested comments. Keep in mind that you can have any number of * characters at the beginning, at the end, and in between. • Write a regular grammar recognizing such comments. • Draw the finite state machine for this grammar. • Draw a table for this grammar such as the ones for table-driver scanners in the class notes and in the book.arrow_forward
- Context-free grammars are sometimes used to model natural languages. In this problem you will model a fragment of the English language using context-free grammars. Consider the following English sentences: The girl is pretty. The girl that the boy likes is pretty. The girl that the boy that the clerk pushed likes is pretty. The girl that the boy that the clerk that the girl knows pushed likes is pretty. This is a special type of sentence built from a subject (The girl), a relative pronoun (that) followed by another sentence, a verb (is) and an adjective (pretty). Give a context-free grammar G that models this special type of sentence. Your terminals should be words or sequences of words like pretty or the girl. Is the language of G regular? If so, write a regular expression for it. If not, prove using the pumping lemma for regular languages. Can you give an example of a sentence that is in G but does not make sense in common English?arrow_forward1. Give a CFL for the language L (over the alphabet {a, b}), where L = {w | w has exactly the same number of a's as b's.}2. Draw a nondeterministic PDA for the language from the previous question.arrow_forwardFormalize the following sentence in english: Vx. (person(x ) A ay. (like(x,y) ^ food(y) A¬contain(cheese)))arrow_forward
- 1. For each of the following regular expressions find a language (i.e., a set of strings) over A = {a,b,c} that can be represented/described by that expression. a. a*bc + bc* b. b*aaac* а. b.arrow_forwardWrite a grammar for Boolean expressions , assuming that we already have rules in our grammar for arithmetic expressions . Arithmetic expressions might be simple literals like 3 or 97 or may be more complex syntactic units like (3+x)/4. They evaluate to a number. You needn't concern yourself with their structure; just that they can be used as below. Boolean expressions include the literals TRUE and FALSE; they can be combined with the unary operator ! (meaning NOT) and binary operators && and || (meaning AND and OR). Also, arithmetic expressions can be combined with the following binary operators to form new Boolean expressions: , =, !=. When your grammar is complete, you should be able to derive parse trees for expressions like the following: TRUE || FALSE FALSE && !TRUE 27 = TRUE | FALSEarrow_forwardWe place ourselves on a language with a constant me (the person speaking) and three binary relations: - friend(x, y) if x is the friend of y - enemy(x, y) if x is the enemy of y (x is my enemy then it corresponds to enemy(x, me)) - x = y if x and y are equal Translate the following formulas into English: ∀x, ¬friend (x, me) ⇒ enemy(x, me) ∃x, ∀y, ¬friend(y, x) ∀x, ∃y, enemy(y, x)arrow_forward
- Let Σ = {a, b, c}. Design an NFA that accepts the language L = {a}, which consistsof exactly one word a. PLEASE DESIGN AN NFA THAT ACCEPTS THE LANGUAGE L={a}arrow_forwardDraw an equivalent DFA for the language “All possible strings that has two or three 1’s over ∑ = {0 , 1}” and also write down an equivalent regular expression for the language "All possible strings whose each a is followed by double b’s over ∑ = {a , b}.arrow_forwardCreate a Deterministic Finite Automaton (DFA) for the language L that is defined over the input alphabet E = {a, b} and has all of the following properties: i. Second and third letters of its words are the same, ii. Its words are longer than four letters, and iii. Its last letter cannot be the letter b. My answer is true or wrong? If it is wrong can you fix it? 96 91 92 a a. 95 9. 96arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education