/*! This file is auto-generated */ .wp-block-button__link{color:#fff;background-color:#32373c;border-radius:9999px;box-shadow:none;text-decoration:none;padding:calc(.667em + 2px) calc(1.333em + 2px);font-size:1.125em}.wp-block-file__button{background:#32373c;color:#fff;text-decoration:none} Free solutions & answers for Introduction to Theory of Computation Chapter 2 - (Page 3) [step by step] 9781133187790 | 91影视

91影视

Q35P

Page 157

Let G be a CFG in Chomsky normal form that contains b variables.

Show that if G generates some string with a derivation having at least 2b

steps, L(G)is infinite.

Q36P

Page 158

Give an example of a language that is not context free but that acts like a CFL in the pumping lemma. Prove that your example works. (See the analogous example for regular languages in Problem 1.54.)

Q37P

Page 158

Prove the following stronger form of the pumping lemma, wherein both pieces vandy must be nonempty when the stringS is broken up.

If Ais a context-free language, then there is a number k where, if s is any string inA of length at leastk , then s may be divided into five pieces,role="math" localid="1659706026393" s=uvxyz , satisfying the conditions:

role="math" localid="1659706054658" a.foreachi0,uvixyizA,b.vandy,andc.|vxy|k,

Q38P

Page 158

Refer to Problem 1.41 for the definition of the perfect shuffle operation. Show that the class of context-free languages is not closed under perfect shuffle.

{w|w=a1b1........akbkwhere鈥娾赌娾赌a1.......akA鈥娾赌娾赌and鈥娾赌娾赌b1.......bkB,each鈥娾赌aibi}.

Q39P

Page 158

Refer to Problem 1.42 for the definition of the shuffle operation. Show that the class of context-free languages is not closed under shuffle.

{w|w=a1b1........akbkwhere鈥娾赌娾赌a1.......akA鈥娾赌娾赌and鈥娾赌娾赌b1.......bkB,each鈥娾赌aibi*}.

Q3E

Page 155

Answer each part for the following context-free grammar G

RXRX|SSaTb|bTaTXTX|X|Xa|b

  1. What are the variables of G?
  2. What are the terminals of G?
  3. Which is the start variable of G?
  4. Give three strings in L(G).
  5. Give three strings not inL(G) .
  6. True or False: Taba.
  7. True or False: Taba.
  8. True or False:TT .
  9. True or False: TT.
  10. True or False:XXXaba .
  11. True or False: Xaba
  12. True or False:role="math" localid="1660812124187" TXX.
  13. True or False: TXXX.
  14. True or False: S.
  15. Give a description in English of L(G) .

Q40P

Page 158

Say that a language is prefix-closed if all prefixes of every string in the language are also in the language. Let C be an infinite, prefix-closed, context-free language. Show that C contains an infinite regular subset.

Q41P

Page 158

Read the definitions of NOPREFIX ( A) and NOEXTEND (A) in Problem .

a. Show that the class of CFLs is not closed under NOPREFIX.

b. Show that the class of CFLs is not closed under NOEXTEND.

Q42P

Page 158

Let

y={w|w=t1#t2#.......#tkfor鈥娾赌k0鈥娾赌娾赌each鈥娾赌ti1*,鈥娾赌and鈥娾赌titj鈥娾赌whenever鈥娾赌ij}.

Here={1,#}. Prove that Y is not context free.

Q43P

Page 158

For string W and t , write if the symbols of W are a permutation of the symbols of t . In other word,wt if t and W have the same symbols in the same quantities, but possibly in a different order.

For any string W , defines SCRAMBLE(w)={t|tw}. For any language A, let .SCRAMBLE(A)={t|tSCRAMBLE(w)鈥塮辞谤鈥塻辞尘别鈥wA}

  1. Show that if={0,1} , then the SCRAMBLEof a regular language is context free.
  2. What happens in part (a) if contains three or more symbols? Prove your answer.

Access millions of textbook solutions in one place

  • Access over 3 million high quality textbook solutions
  • Access our popular flashcard, quiz, mock-exam and notes features
  • Access our smart AI features to upgrade your learning
Access millions of textbook solutions in one place

Recommended explanations on Computer Science Textbooks