/*! 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} Q41P For languages A and B let the pe... [FREE SOLUTION] | 91Ó°ÊÓ

91Ó°ÊÓ

For languages A and B let the perfect shuffle of A and B be the language

{Ӭ|Ӭ=a1b1...ak bk,where  a1...ak ∈ A  and  b1...bk∈ B,each  ai,bi∈∑}.

Show that the class of regular languages is closed under perfect shuffle.

Short Answer

Expert verified

The class of regular languages is closed under perfect shuffle.

Step by step solution

01

The given two languages. The language is perfect shuffle on A and B is as follows

{Ӭ|Ӭ=a1b1...ak bk,where a1...ak ∈ A and b1...bk∈ B,each aibi∈∑.

Assume, DFAA=(QA,∑,δA,SA,FA)and DFAB=(QB,∑,δB,SB,FB)be the two DFAs that recognize the A and B respectively. DFAPerfect-shuffle=(Q,∑,δ,S,F), and also recognizes the language is perfect shuffle on A, and B

02

DFA for perfect shuffle switches

The DFA for perfect shuffle switches from DFAAto DFABafter each character is read and it tracks the current states of DFAA, and DFAB.

Each character should belong to DFAAor DFABi.e., ai,bi∈∑. For each character read,DFAPerfect-shuffle makes moves in the corresponding DFA(eitherDFAA or DFAB).

After the whole string is read, if bothDFAA and DFABreaches to the final state, then the input string is accepted by DFAPerfect-shuffle.

03

DFA

The DFAPerfect-shuffleis defined as follows:

Q=QA×QB×{A,B}: set of all possible states of DFAAand localid="1663235489142" DFABwhich should match with localid="1663235493556" DFAPerfect-shuffle.

The input alphabet for DFAPerfect-shuffleis.

q=qA,qB,A:qAand qBare the initial states for DFAAand DFABrespectively. DFAPerfect-shufflestarts with qAin DFAA, qBinDFABand the next character should be read from DFAA

F=FA×FB×{A}: FA andFB are the final states forDFAA andDFAB respectively. DFAPerfect-shuffle Accepts if bothDFAA andDFAB reaches to the final states and the next character should be read fromDFAA

.
04

Transition function

The transition function δis,

1.   δ((m,n,A),a)=(δA(m,a),n,B)

2.  δ((m,n,B),b)=(m,δB(n,b),n,A)

Consider, the current state of DFAAis m and the current state DFABof is n. Change the current state of A toδA(m,a) if the next character is to be readDFAA from when a is the next character. After the character is read, read the next character from DFAB.

Change the current state of B toδB(n,b) if the next character is to be read fromDFAB when b is the next character.

The language L is said to be regular if there exist an FA that recognizes the language L. Here, theDFAPerfect-shuffle is defined for the languageperfect shuffle.

Therefore, the class of regular languages is closed under perfect shuffle.

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

The pumping lemma says that every regular language has a pumping length P , such that every string in the language can be pumped if it has length p or more. If P is a pumping length for language A, so is any length p'⩾pThe minimum pumping length for A is the smallest p that is a pumping length for A . For example, if A=01*, the minimum pumping length is 2.The reason is that the string s=0is in A and has length 1 yet s cannot be pumped; but any string A in of length 2 or more contains a 1 and hence can be pumped by dividing it so that x=0,y=1,andzis the rest. For each of the following languages, give the minimum pumping length and justify your answer.

a).0001*b).0*1*c).001∪0*1*d).0*1+0+1*∪10*1

role="math" localid="1660797009042" e).(01)*f).∈g).1*01*01*h).10(11*0)*

i).1011j).∑*

Let D={w|wcontains an even number of a’s and an odd number of b’s and does not contain the substring ab}. Give a DFA with five states that recognizes role="math" localid="1663218927815" Dand a regular expression that generatesrole="math" localid="1663218933181" D.(Suggestion: DescribeD more simply.)

Question:

a. Let B={1ky|y∈{0,1}*and ycontainsatleastk1s,fork⩾1}. Show that B is a regular language.

b. Let C={1ky|y∈{0,1}* and ycontainsatmostk1s,fork⩾1}. Show that C isn’t a regular language.

For any string w=w1,w2,···,wn, the reverse of w, written wR , is the string w in reverse order,wn···w2w1. For any language A,letAR=wR|wA.Show that if A is regular, so is AR.

Let ∑2{[00],[01][10][11]}Here, contains all columns of localid="1663175934749" 0sand1sof height two. A string of symbols in gives two rows of 0sand1s. Consider each row to be a binary number and let C={w∈Σ*2|thebottomrowofwisthreetimesthetoprow}. For example, [00][01][11][00]∈cbut [01][01][10]EC. Show that C is regular. (You may assume the result claimed in Problem 1.31.)

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.