Warning: foreach() argument must be of type array|object, bool given in /var/www/html/web/app/themes/studypress-core-theme/template-parts/header/mobile-offcanvas.php on line 20

Recall that string x is a prefix of string y if a string z exists where xz=y, and that x is a proper prefix of y if in addition x6=y. In each of the following parts, we define an operation on a language A. Show that the class of regular languages is closed under that operation.

a)NOPREFIXA={wโˆˆA|noproperprefixofwisamemberofA}.b)NOEXTENDA={wโˆˆA|wisnottheproperprefixofanystringinA}.

Short Answer

Expert verified

NOEXTENDAis also regular.

Step by step solution

01

To Prefix of string operationa) NOPREFIXA = {wโˆˆA| no proper prefix of w is a member of A}.

a)NOPREFIX(A)=wโˆˆA|noโ€Šproperโ€Šprefixโ€Šofโ€Šwโ€Šisโ€Šaโ€Šmemberโ€Šofโ€ŠA

LetM=Q,โˆ‘,ฮด,qo,Fbe a DFA recognizing .

Initially, find all words that have a proper prefix in A. The language L is represented as

L=wโˆˆโˆ‘*:xโˆˆAโ€Šandโ€Šzโˆˆโˆ‘*โ€Šsuchโ€Šthatโ€Šxz=y.

Now, construct the NFA M1=Q1,โˆ‘,ฮด1,q01,F1for all its components such that:

Q1=Qโˆชqfand qfโˆ‰Q

For qโˆ‰Q1and aโˆˆโˆ‘define

qo1=qoF1=qf

02

Step 2:To Prefix of string operation b) NOEXTEND(A) = {wโˆˆA| w is not the proper prefix of any string in A}.

If w is a string in Language L, there is a string y in A. Here, x is a proper prefix of y such thatxz=yandx is non-empty.

Ifwis taken as input of M1, the computation on x ends at an accepting state in M and some computationz on ends at stateqf

So,wis accepted by M1, which means that there is a computation that ends at qf.

From the construction of M1, the computation arrives at one of the accepting states in M before it reaches qf.

As, NOPREFIX (A) is defined asAโˆฉLยฏand class of regular languages are closed under intersection and complement, NOPREFIX (A) is also regular.

03

To Simplify the DFA language

b)NOEXTENDA=wโˆˆA|wโ€Šisโ€Šnotโ€Šproperโ€Šprefixโ€Šofโ€Šanystringโ€Šinโ€ŠA

LetM=Q,โˆ‘,ฮด,qo,F be a DFA recognizingA.

Assume that the DFA for language M accepts that only the strings reaching the final state but not those strings that are added to reach a final state again.

So, the strings exactly ending in final states are accepted.

For a state qโˆˆF, check whether there is a path fromqโˆˆQ to any state inF(or a cycle involvingq) using Depth First Search.

LetF1โŠ†F be the set of all the states from which there is no such path.

Now, changing the set of final statesF toF1 gives a DFA forNOEXTEND(A).

Thus, NOEXTEND(A) is also regular.

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 Vaia!

One App. One Place for Learning.

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

Get started for free

Study anywhere. Anytime. Across all devices.

Sign-up for free