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

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

{ω|ω=a1b1...akbk,wherea1...akAandb1...bkB,eachai,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...akbk,wherea1...akAandb1...bkB,eachaibi.

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

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

Let Σ2 be the same as in Problem 1.33. Consider the top and bottom rows to be strings of 0s and 1s, and letE={w*2| the bottom row of w is the reverse of the top row of w}. Show that is E not regular.

If A is any language, let A12− be the set of all first halves of strings in A so that ,

A12-={x|forsomey,|x|=|y|andxyA}.

Show that if A is regular, then so is A12

If A is a set of natural numbers and k is a natural number greater than 1, let

Bk(A)={w|wistherepresentationinbasekofsomenumberinA}.

Here, we do not allow leading 0s in the representation of a number. For example ,B2({3,5})={11,101}and B3({3,5})={10,12}.Give an example of a set A for which B2(A)is regular butB2(A) is not regular. Prove that your example works.

a. Let Abe an infinite regular language. Prove thatA can be split into two infinite disjoint regular subsets.

b. LetBandD be two languages. Write BDifBDand Dcontains infinitely many strings that are not in B. Show that if BandD are two regular languages whereBD , then we can find a regular languageC where BCD.

In the traditional method for cutting a deck of playing cards, the deck is arbitrarily split two parts, which are exchanged before reassembling the deck. In a more complex cut, called Scarne’s cut, the deck is broken into three parts and the middle part in placed first in the reassembly. We’ll take Scarne’s cut as the inspiration for an operation on languages. For a language A, let CUT(A)={yxz|xyzA}.

a. Exhibit a languageB for whichCUT(B)CUT(CUT(B)).

b. Show that the class of regular languages is closed under CUT.

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.

Sign-up for free