Question

Problem 1. (10 points) For each of the following statements determine whether it is true or false. * (+1 for correct, 0 for b
0 0
Add a comment Improve this question Transcribed image text
Answer #1

1. True

because every time S will replace by aSb so number of 'a' must be equal to number of 'b'.

2. False

A CFG is said to be ambiguous if it has a string having more than one parse tree.

3.True.

Two different CFG could generate two different language.

Example.1. P: A->aA, A->abc , Language= {A,P,{a,b,c}}

2. P: S->aSb, Language = {P,S,{a,b}*}

Two CFG are different also there corresponding language also different.

4.False. There is no way to accept or reject the string without knowing the final state.

5. False.

CFL are not closed under intersection. so, Intersection of two contex free languages not always Context Free.

6. True.

A Context free language must be finite because automata is constructed using context free language and consist of only finite state. if the language is infinite, not able to construct an automata from it. so l=context free language must be finite.

7.False. a-SX this type of CFG is not possible beacause rules for constructing CFG states that set of terminal or non-terminal must be on the right side and and the replacable symbol must be on left side. Here S X are replaceable symbol so they must be on left sie.

Note: Not mentioned how much parts are required to solve . Hence given answer for first 7.

Add a comment
Know the answer?
Add Answer to:
Problem 1. (10 points) For each of the following statements determine whether it is true or...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Problem 3. f10 points for each of the following context-free grammars, i)use set notation to define...

    Problem 3. f10 points for each of the following context-free grammars, i)use set notation to define the language generated by the grammar, and ii) Show that it is ambiguous by drawing 2 different parse trees for a string. a) Grammar: S + SaSb Si S + Sja | SibT T + Tb Tac b) Grammar: S + 151 T T + 1X1 X X + 0X01

  • 9. Mark the best description (smallest language class) for each of the following lang • R...

    9. Mark the best description (smallest language class) for each of the following lang • R if it is regular • C if it is context free, but not regular . N if it is "bigger than" context free You do not have to prove your answer. L = {www: we {a,b}"} L2 = {a" : n > 2, m < 5} L3 = {a"m : n + m is even } LA = {w:na(w) + no(w) = n(w)} Ls...

  • 2. (10 points) Use the pumping lemma for context free grammars to show the following languages...

    2. (10 points) Use the pumping lemma for context free grammars to show the following languages are not context-free. (a) (5 points) . (b) (5 points) L = {w ◦ Reverse(w) ◦ w | w ∈ {0,1}∗}. I free grammar for this language L. lemma for context free grammars to show t 1. {OʻPOT<)} L = {w • Reverse(w) w we {0,1}*). DA+hattha follaurino lano

  • 1. Construct a DFSM to accept the language: L w E ab): w contains at least 3 as and no more than 3 bs) 2. Let E (acgt a...

    1. Construct a DFSM to accept the language: L w E ab): w contains at least 3 as and no more than 3 bs) 2. Let E (acgt and let L be the language of strings consisting of repeated copies of the pairs at, ta, cg. ge. Construct both a DFSM to accept the language and a regular expression that represents the language. 3. Let ab. For a string w E , let w denote the string w with the...

  • I need help with the following problems, any help you can provide is deeply appreciated! CSC...

    I need help with the following problems, any help you can provide is deeply appreciated! CSC 404 Exam 1 Question I continued - 9. The syntax rules for most languages ignore spaces. An exception is which tises indents and therefore spaces to form the indents) to group statements (a) FORTRAN (6) Pascal (e) Python (d) Lip (e) C++ 10. Identifiers, constants and operators are typical examples of (a) tokens. (b) leafons. (c) signifiers. (d) lexicons. (e) parsicles. 0) non-terminals. 11....

  • 3 points) Question Three Consider the context-free grammar S >SS+1 SS 1a and the string aa...

    3 points) Question Three Consider the context-free grammar S >SS+1 SS 1a and the string aa Give a leftmost derivation for the string. 3 points) (4 poiots) (5 points) (3 points) sECTION IWOLAttcmpt.any 3.(or 2) questions from this.scction Suppose we have two tokens: (1) the keyword if, and (2) id-entifiers, which are strings of letters other than if. Show the DFA for these tokens. Give a nightmost derivation for the string. Give a parse tree for the string i) Is...

  • 1. (1 point) Which of the following is true? A. Every regular language is a context-free...

    1. (1 point) Which of the following is true? A. Every regular language is a context-free language. B. Every context-free language is a regular language. C. If a language is context-free, then there exists a pushdown automata to recognize it. D. The set of context free languages is strictly larger than the set of regular languages. E. Each of A,C, and D is true. 2. (1 point) The following diagram shows a context free grammar with start variable S and...

  • 1. (1 point) Which of the following is true? A. Every regular language is a context-free...

    1. (1 point) Which of the following is true? A. Every regular language is a context-free language. B. Every context-free language is a regular language. C. If a language is context-free, then there exists a pushdown automata to recognize it. D. The set of context free languages is strictly larger than the set of regular languages. E. Each of A,C, and D is true. 2. (1 point) The following diagram shows a context free grammar with start variable S and...

  • If L1 and L2 are Regular Languages, then L1  ∪ L2  is a CFL. Group of answer choices...

    If L1 and L2 are Regular Languages, then L1  ∪ L2  is a CFL. Group of answer choices True False Flag this Question Question 61 pts If L1 and L2 are CFLs, then L1  ∩ L2 and L1 ∪ L2 are CFLs. Group of answer choices True False Flag this Question Question 71 pts The regular expression ((ac*)a*)* = ((aa*)c*)*. Group of answer choices True False Flag this Question Question 81 pts Some context free languages are regular. Group of answer choices True...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT