a) Define a phrase-structure grammar.
b) What does it mean for a string to be derivable from a string w by a phrase-structure grammar G?
To define a phrase-structure grammer.
Answer to Problem 1RQ
“ A phrase structure grammer is denoted by set
Explanation of Solution
Given:
Phrase structure grammer.
Concept: Definition of phrase structure grammer involves following description of few alphabets :
V: It is a finite, non empty set of elements called symbols.
T : It is a subset of set V that consisting of terminal ( non replacing symbols of vocabulary) symbols.
S : It is a starting symbol ( element of vocabulary, used to start a sentence ) from V.
P : It stands for production. These are the rules that specify the replacement of one string from another in the sentence.
Meaning for a string to be derivable from another string
Answer to Problem 1RQ
A string
Explanation of Solution
If two strings of a production of phrase-structure-language are be replaced in such a way, then it is said that one string is a derivation of another string. And it is represented by symbol
Want to see more full solutions like this?
Chapter 13 Solutions
Discrete Mathematics and Its Applications ( 8th International Edition ) ISBN:9781260091991
- 5. Using the following context free grammar give a parse tree for the strings. E → E +T|T T → TxF|F F → (E)\a (a) a+a+a (b) ((a))arrow_forwardShow that ADFA ∈ L, where ADFA = {< B,w > |B is a DFA that accepts input string w}.arrow_forwardA palindrome is a string that reads the same backward as it does forward, that is, a string w, where w = wr, where wr is the reversal of the string w. Find a context-free grammar that generates the set of all palindromes over the alphabet { 0, 1 }.arrow_forward
- Let A, B and C be 3 languages over the same alphabet: AtLeast2(A.B.C) = {w|w is in at least 2 of the 3 languages A, B and C } Show that if A, B and C are regular languages, then so is AtLeast2(A.B.C). Hint: Write "AtLeast2(A,B,C)" in the form of some set operations (intersection, union, complement,.) on "A", "B", and "C". Then use closure properties of regular languages.arrow_forwardd, e, farrow_forward120 High school students have to do 3 final exams to be able to enter to the university. There are exams in Math, CS and Language. We know: - 60 students passed Math - 40 students passed CS - 30 students passed CS and Math - 30 students passed Language and Math - 25 students passed CS and Language - 20 students passed Language and Math and CS - 50 students – failed all 3 exams. Draw a Venn Diagram to illustrate sets of students passing different exams. How many students passed Language?arrow_forward
- Please check the image for the question:arrow_forwardLet s be a string of length 2 with characters from {0, 1, 2}, and define statements a, b, c, and d as follows:a = “the first character of s is 0”b = “the first character of s is 1”c = “the second character of s is 1”d = “the second character of s is 2”. Describe the set of all strings for which each of the following is true. Attachmentarrow_forward14 Below is the state diagram for an NFA N. В 1 start A a) Which of the following strings are accepted by N? (Simply write "accept" or "reject" after each.) • 101 • 0100 • 0101 • 0011 • 1001 • 01100 b) Design a DFA that accepts the same language as N using a general method that works for all NFAS. c) Construct a regular grammar for this language using a general method that works for all NFAS.arrow_forward
- 3: a) Prove that the set { !} is an adequate set of connectives. b) As a result of a) above or otherwise, re-write the statement form -P - QA -R using only the !connective.arrow_forwardLet U be the set of all animals alive today, g(x) be "x is a gibbon" and c(x) be "x is carnivorous." a. Express "All gibbons are carnivorous" in symbolic form. Use Rule Q3 to derive the symbolic form for "Some gibbons are not carnivorous." b. Express "Some gibbons are carnivorous" in symbolic form. Use Rule Q4 to derive the symbolic form for "No gibbon is carnivorous."arrow_forwardConsider strings that are made up of characters from the set S = {a, b, c, d, e}. We call a string "acceptable" if there is at least one character from S that does not appear in that string. For example, abcd is acceptable, bbb is acceptable; edcba is not acceptable. How many acceptable strings of length n exist? Justify your answer.arrow_forward
- Discrete Mathematics and Its Applications ( 8th I...MathISBN:9781259676512Author:Kenneth H RosenPublisher:McGraw-Hill EducationMathematics for Elementary Teachers with Activiti...MathISBN:9780134392790Author:Beckmann, SybillaPublisher:PEARSON
- Thinking Mathematically (7th Edition)MathISBN:9780134683713Author:Robert F. BlitzerPublisher:PEARSONDiscrete Mathematics With ApplicationsMathISBN:9781337694193Author:EPP, Susanna S.Publisher:Cengage Learning,Pathways To Math Literacy (looseleaf)MathISBN:9781259985607Author:David Sobecki Professor, Brian A. MercerPublisher:McGraw-Hill Education