Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
b) Write the CFG for the following language over alphabet Σ= {p,q ,r}
L={ pqr, ppqrr, pppqrrr, ppppqrrrr, pppppqrrrrr, ……………..}
Hint : pn q rn where n>=1
Note: derive at least four strings for the given CFG
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 2 steps
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
- Write the code in java and here is the lab 12 code read the question why I gave you lab 12 code : public class lab12daneshelahi { public static void main (String[]args) { CanadianAddress testAddress = new CanadianAddress (); CanadianAddress SMUAddress = new CanadianAddress ("923 Robie St.", "Halifax", "Nova Scotia", "B3H 3C3"); System.out.println ("The testAddress is created as:"); testAddress.printAddress (); System.out.println (); System.out.println ("The SMUAddress is created as:"); SMUAddress.printAddress (); System.out.println (); System.out.println ("The testAddress is equal to SMUAddress? :( " + testAddress.equalAddress (SMUAddress)); System.out.println (); testAddress.setStreetAddress ("923 Robie St."); testAddress.setCity ("Halifax"); testAddress.setProvince ("Nova Scotia"); testAddress.setPostalCode ("B3H 3C3"); System.out.println ("The testAddress is updated as: :D "); testAddress.printAddress (); System.out.println (); System.out.println…arrow_forwardLet L = { w ∈ { a, b, c }* | w contains exactly one b or starts with ac }.a) Construct an NFA that recognizes L.b) Construct an NFA that accepts any positive number of occurrences of various strings (not empty string)from this language concatenated together.arrow_forwardQuestion 2. Find a regular expression that describes the given language:(2.a) Language of strings over Σ = {a, b, c} in which every character c is followed by the character a.(2.b) Language of strings over Σ = {a, b} which contain both substrings abb and bab. Note that thesubstrings can occur in any order and can overlap, so for example the string babb is in this language.(2.c) Let Σ = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, −, .}. The language L contains all strings that form a properdecimal representation of some number.Some examples of strings in the language: 42, -999, 0, 12.333, -0.14, 5.000.Some examples of strings that are not in the language: 028 (leading zero), 75. (decimal point but nodecimal part), -.5 (no integer part), -0 (there is no negative zero), 4..2-6 (malformed nonsense).You can use the shorthand [0−9] to stand for (0 + 1 + 2 + ···+ 9).arrow_forward
- Here's the code: /* Recursive Descent Parser for the Expression Grammar:S → (L) |aL' →,SL'|εL → SL'Valid inputs: (a,(a,a)) and (a,((a,a),(a,a)))Invalid inputs:(aa,a)*/#include <stdio.h>#include <string.h>int S(), Ldash(), L();char *ip;char string[50];int main() {printf("Enter the string\n");scanf("%s", string);ip = string;printf("\n\nInput\t\tAction\n ------------------------------\n");if (S()){printf("\n------------------------------------------------\n");printf("\n String is successfully parsed\n");}else{printf("\n ------------------------------------------------\n");printf("Error in parsing string\n");}}int L(){printf("%s\t\tL →SL' \n", ip);if (S()){if (Ldash()){return 1;}elsereturn 0;} elsereturn 0;}int Ldash(){if (*ip == ','){printf("%s\t\tL' →, SL' \n", ip);ip++;if (S()){if (Ldash()){return 1;}elsereturn 0;}else return 0;}else{printf("%s\t\tL' →ε \n", ip);return 1;}}int S(){if (*ip == '('){ printf("%s\t\tS →(L)…arrow_forwardEach of the following languages are composed of two simpler languages over the alphabet Σ = {a, b, c}. For both, construct the DFA’s for the simpler languages, then combine them using the construction of the closure proof:a. {w : w starts with a and has at most one b}b. {w : w has an odd number of b’s or ends in c}arrow_forwardUse the Pumping Lemma to show that L = {wwR|w E E*} is not a regular language.arrow_forward
- Theory of autometaarrow_forwardWrite regular expression for the following languages, alphabet {0,1}a. The set of strings that do not end with 11b. The set of strings that do not contain substring 01c. The set of strings having 0 at every 3rd position.d. Describe the language given by the regular expression 0*10*10*1(1|0)* e. Set ofall strings that are at least of length 4 and contains an even number of 1’s.arrow_forwardUse the CYK algorithm to determine whether the strings abb, bbb, aabba andabbbb are in the language generated byS → AB,A → BB|a,B → AB|b.arrow_forward
- Construct regular expressions over Σ = {0,1} representing the following languages: The set of strings over alphabet {0,1} contains a single 1.arrow_forwardBased on the following C code: { int x, y, z, sum, total; int *pt1, *pt2, *ptc; x = 99; y = 86; pt1 = &y; pt2 = pt1; ptc = &x; z = (*(&y))/2 + (*pt2)/3 + 5; sum = (x + y + *pt1 + *pt2 + z)/3; total = sum + *ptc + *pt1; } (1) What is the value of z? (2) What is the value of sum? (3) What is the value of the total? (4) What is the address of the data 86?arrow_forwardNeed help with part (c). Thank you :)arrow_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