/*! 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} Q18P a). Let C be a context-free lang... [FREE SOLUTION] | 91Ó°ÊÓ

91Ó°ÊÓ

a). Let C be a context-free language and R be a regular language. Prove that the languageC∩Ris context free.

b). Let A= { w|w∈{a,b,c}*andwcontains equal numbers of a’s,b’s,andc’s}. Use part(a) to show that A is not a CFL

Short Answer

Expert verified
  1. The languageC∩R is context free.
  2. A is not a CFL.

Step by step solution

01

Consider the information

Consider C be the context-free language. Consider be the regular language. The objective of the question is to prove that the intersection of two languages and is context-free.The intersection of two languages is the set of the strings that both languages has in common.

02

Prove that C ∩ R is context free

Let N=(QN,∑,δN,q0,FM)be a DFA recognizing R . Let M=(QN,Γ,∑,δM,q0,FM)be a PDA that recognizes C .

Combine the machines to construct a PDA machine. The PDA machine recognizesC ∩ R . Each state of this PDA consists of two states (p,q).

Here, P is a state of PDA and q is a state of N .

The formal definition is:

M'=(QM,QN,∑,Γ,δM,(poq0),FM×FN)

The transition function δM' is defined by

δM'((p,q),a,x)={((p',q'),y)|(p',y)∈δM(p,a,x)andδN(q,a,)=q'}

Thus, this shows that C ∩ R is context-free.

03

Prove that language is not CFL language

Assume A is a context free grammar. Let B be the regular language a*b*c*. Then, by Part (a), A∩Bis context-free. But A∩B= {anbncn|n≥0}this language is not context-free.

Thus, A is not a context free language.

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with 91Ó°ÊÓ!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

In certain programming languages, comments appear between delimiters such as #and #/. Let Cbe the language of all valid delimited comment strings. A member of Cmust begin with #/and end with #/but have no intervening #/. For simplicity, assume that the alphabet for Cis ∑={a,b,/,#}.

a. Give aDFA that recognizes C.

b. Give a regular expression that generates C.

This problem is inspired by the single-player game Minesweeper, generalized to an arbitrary graph. Let Gbe an undirected graph, where each node either contains a single, hidden mine or is empty. The player chooses nodes, one by one. If the player chooses a node containing a mine, the player loses. If the player chooses an empty node, the player learns the number of neighboring nodes containing mines. (A neighboring node is one connected to the chosen node by an edge.) The player wins if and when all empty nodes have been so chosen.

In the mine consistency problem, you are given a graphG along with numbers labeling some of G’s nodes. You must determine whether a placement of mines on the remaining nodes is possible, so that any node v that is labeled m has exactly m neighboring nodes containing mines. Formulate this problem as a language and show that it isNPcomplete.

Consider the language B=L(G), where Gis the grammar given in

Exercise 2.13. The pumping lemma for context-free languages, Theorem 2.34,

states the existence of a pumping length p for B . What is the minimum value

of p that works in the pumping lemma? Justify your answer.

Modify the proof of Theorem 3.16 to obtain Corollary 3.19, showing that a language is decidable if some nondeterministic Turing machine decides it. (You may assume the following theorem about trees. If every node in a tree has finitely many children and every branch of the tree has finitely many nodes, the tree itself has finitely many nodes.)

Examine the following formal descriptions of sets so that you understand which members they contain. Write a short informal English description of each set.

  1. {1,3,5,7,...}
  2. {...,-4,-2,0,2,4,...}
  3. {n|n=2mfor someminN}
  4. {n|n=2mfor someminN, andn=3kfor somekinN}
  5. {w|wis a string of0sand1sandwequals the reverse ofw}
  6. {n|nis an integer andn=n+1}
See all solutions

Recommended explanations on Computer Science Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.