Question

In: Computer Science

Give context free grammars for the languages below. To avoid mistakes, I recommend using scratch paper...

Give context free grammars for the languages below. To avoid mistakes, I recommend using scratch paper to check that your grammars produce the right set of string. This question is structured so that nonterminals (and associated rules) from an earlier subquestion might be useful in a grammar for a later sub-question. That’s why, rather than “S” as the start symbol, we will used different start symbols for each part. If you do use a nonterminal from an earlier sub-question, say something like “see part a”.

Let sigma ( Σ ) be the set {a, b}

d. Strings over sigma that contain exactly two b's (and any number of a's)  Use V as your start symbol

e. Strings over sigma that contain exactly three b’s (and any number of a's) Use W as your start symbol.

f) Strings over sigma that contain at most three b's (and any number of a's). Use X as your start symbol

Solutions

Expert Solution

Here, you have not provided option no. a),b) and c). So initially I'm solving from d). If any doubt you can ask anytime.


Related Solutions

Give context free grammars for the languages below. To avoid mistakes, I recommend using scratch paper...
Give context free grammars for the languages below. To avoid mistakes, I recommend using scratch paper to check that your grammars produce the right set of string. This question is structured so that nonterminals (and associated rules) from an earlier subquestion might be useful in a grammar for a later sub-question. That’s why, rather than “S” as the start symbol, we will used different start symbols for each part. If you do use a nonterminal from an earlier sub-question, say...
Closure under Context-Free Languages Show that the following operations are closed under context-free languages: union concatentation...
Closure under Context-Free Languages Show that the following operations are closed under context-free languages: union concatentation Kleene star
Prove the following Closure Properties with respect to Context Free Languages. 1. Show that Context Free...
Prove the following Closure Properties with respect to Context Free Languages. 1. Show that Context Free Languages are Closed under union(∪), concatenation(·), kleene star(*). (Hint: If L1 and L2 are Context Free languages then write Context Free grammar equivalent to L1 ∪ L2, L1 · L2, L∗ 1 ) 2. Show that if L1 and L2 are Context Free Languages, then L1 ∩ L2 is not necessarily Context Free. (Hint: Use Proof by Counter Example)
(a) How Context Free languages are different from Regular languages. (b) What are the automata accepting...
(a) How Context Free languages are different from Regular languages. (b) What are the automata accepting those languages and how they are different from DFA and NFA. (c) How the grammar of Context Free Languages looks different from those in Regular languages.
Prove that all regular languages are context free. Note: Proof must proceed by structural induction on...
Prove that all regular languages are context free. Note: Proof must proceed by structural induction on regular expressions Please prove by Structural Induction. Will Upvote for correct answer. Thanks
On your scratch paper, write the formulas for the slope and the y-intercept. Using the values...
On your scratch paper, write the formulas for the slope and the y-intercept. Using the values given in the summary table, record how to calculate by hand the slope and y-intercept of the lime. Show all steps. State the final results as the equation of the line. Summary Statistics r = 0.772724. mean length = 3517.94 standard deviation for length = 1623.46 mean duration = 126.4 standard deviation for duration = 43.6616 Within reasonable round off error, your equation should...
Give examples of languages L1 and L2 over {a, b} that satisfy the descriptions below: (a)...
Give examples of languages L1 and L2 over {a, b} that satisfy the descriptions below: (a) L1 is regular, L2 is nonregular, and L1 U L2 is regular; (b) L1 is regular, L2 is nonregular, and L1 U L2 is nonregular; (c) L1 is regular, L2 is nonregular, and L1 n L2 is regular; (d) L1 is nonregular, L2 is nonregular, and L1 U L2 is regular. (e) L1 is nonregular, L2 is nonregular, and L1 n L2 is regular.
Regular => Context-Free Give a proof by induction on regular expressions that: For any language A,...
Regular => Context-Free Give a proof by induction on regular expressions that: For any language A, if A is regular, then A is also context-free. You may assume that the statements from the previous Closure under Context-Free Languages problem are proved. R is a regular expression if RR is: a for some a∈alphabet Σ, the empty string ε, the empty set ∅, R​1​​∪R​2​​, sometimes written R​1​​∣R​2​​, where R​1​​ and R​2​​ are regular expressions, R​1​​∘R​2​​, sometimes written R​1​​R​2​​, where R​1​​ and...
Avoid plagiarism.. I want from your word please Q1 Give example of company using ABC costing...
Avoid plagiarism.. I want from your word please Q1 Give example of company using ABC costing and explain the process used in this company to assign costs in an ABC system? (Week 7: , ABC costing) Answer:       Q 2 Give examples of questions managers could ask to help them identify relevant qualitative factors that will be used before making decision? (Week 9: ,   Relevant information for decision making) Answer:       Q 3 Kadhim Co. manufactures product B which is...
Give a context-free grammar for {w ∈ {b, c}∗| #c(w) = #b(w)}.
Give a context-free grammar for {w ∈ {b, c}∗| #c(w) = #b(w)}.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT