/*! 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} Q48P Let. ∑={0,1}Let C1 be the lan... [FREE SOLUTION] | 91Ó°ÊÓ

91Ó°ÊÓ

Let. ∑={0,1}LetC1 be the language of all strings that contain a 1 in their middle third.

Let C2be the language of all strings that contain two 1s in their middle third. So C1={xyz|x,z∈∑*andy∈∑*1∑*,where|x|=|z|≥|y|}and C2={xyz|x,z∈∑*and y∈∑*1∑*1∑*, â¶ÄŠwhere |x|=|z|≥|y|}.

a.Show that C1is a CFL.

b. Show thatC2 is not a CFL

Short Answer

Expert verified

a.It can be shown that C1is a CFL.

b. It can be shown that C2is not a CFL

Step by step solution

01

Explain Context-free language

Context-free grammar generates context-free grammar. The regular languages are the subset of the context-free languages that are an identical set of languages accepted by pushdown automata.

02

Step 2:Show that C1is a CFL.

a.

Consider the given,C1={xyz|x,z∈∑*andy∈∑*1∑*,where|x|=|z|≥|y|}where ∑={0,1}.

Construct the pushdown automata p to determine the language C1. The p can be defined as(Q,∑,Γ,δ,q0,F), where .Q={q0,q1,q2},∑={0,1},Γ={x},F={q2}

The PDA is as follows,

Thus, the PDA accepts the given language C1.

Therefore, C1is a Context-free Language and it has been proved.

03

Step 3:Show that C2 is not a CFL.

b.

Consider the given languageC2, C2={xyz|x,z∈∑*and y∈∑*1∑*1∑*, â¶ÄŠwhere |x|=|z|≥|y|}accepts all the string that has two 1’s in the middle of the string.

Consider the pumping lemma to show that C2is not a context-free language. Assume that C2is a CFL and prove its contradiction by the pumping lemma l.Consider the string ,S that is divided into pieces asS=abcde.

  • For each i≥0,abicdie∈C2
  • |bd|>0
  • |bcd|≤l

Where, a=0l+2,b=1,c=0l,d=1,e=0l+2. Let i=1, after pumping S=0l+210210l+2. The new string |10l1|≤lfails, and thus it is not a CFL.

Therefore, the languageC2 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

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}

Question: Answer all parts for the following DFA and give reasons for your answers.

a.Is<M,0100>∈ADFA?b. Is<M,011>∈ADFA?c. Is<M>∈ADFA?d. Is<M,0100>∈AREX?e. Is<M>∈EDFA?f. Is<M,M>∈EQDFA?

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.

Show thatif,.NP=PSATthenNP=coNP

For each of the following languages, give two strings that are members and two strings that are not members—a total of four strings for each part. Assume the Σ=a,balpha-alphabet in all parts.

a.a*b*b.aba*bc.a*∪b*d.aaa*e.Σ*aΣ*bΣ*aΣ*f.aba∪babg.(ε∪a)bh.(a∪ba∪bb)Σ*

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.