For languages AandB, let the shuffle of AandBbe the language

{ω|ω=a1b1...akbk,where  a1...akA  and  b1...bkB,each  ai,bi}.

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

Short Answer

Expert verified

The class of regular languages is closed under shuffle.

Step by step solution

01

Introduction 

The given two languages AandB is shuffle on theAandB is as follows:

{ω|ω=a1b1...akbk,where  a1...akA  and  b1...bkB,each  ai,bi}..

Assume, DFAA=(QA,,δA,SA,FA) and DFAB=(QB,,δB,SB,FB)be the twoDFA s that recognizethe, Aand Brespectively. DFAPerfect-shuffle=(Q,,δ,S,F), and also recognizes the language is perfect shuffle on,A and B.

02

Explanation

TheDFA for perfect shuffle switches fromDFAA toDFAB after each character is read and it tracks the current states of DFAAand DFAB.

Each character should belong to DFAAor DFABi.e., ai,bi. For each character read, DFAPerfect-shufflemakes moves in the correspondingDFA (either DFAAor DFAB).

After the whole string is read, if bothDFAA andDFAB reaches to the final state, then the input string is accepted byDFAPerfect-shuffle.

q=q0

03

Simplification

The DFAPerfect-shuffleis defined as follows:

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

The input alphabet for DFAPerfect-shuffleis .

q=(qA,qB,A):qAandqBare the initial states forDFAA and DFABrespectively.DFAPerfect-shuffle starts withqAin DFAA,qBin DFABand the next character should be read from DFAA.

F=FA×FB×{A}: FAand FBare the final states forDFAA andDFAB respectively. DFAPerfect-shuffleAccepts if both DFAAand DFABreaches to the final states and the next character should be read from DFAA.

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 DFAAism and the current state ofDFAB is n. Change the current state of AtoδA(m,a)if the next character is to be read fromDFAA whenais the next character. After the character is read, read the next character from DFAB.

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

The languageL is said to be regular if there exist anFA that recognizes the language L. Here, the DFAPerfect-shuffleis defined for the language perfect shuffle.

Therefore, the class of regular languages is closed under 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

A finite state transducer (FST) is a type of deterministic finite automaton whose output is a string and not just accept or reject. The following are state diagrams of finite state transducers T1andT2.

Each transition of an FST is labeled with two symbols, one designating the input symbol for that transition and the other designating the output symbol. The two symbols are written with a slash, I, separating them. In T1, the transition from q1toq2has input symbol 2 and output symbol 1. Some transitions may have multiple input–output pairs, such as the transition in T1from q1to itself. When an FST computes on an input string w, it takes the input symbols w1···wnone by one and, starting at the start state, follows the transitions by matching the input labels with the sequence of symbols w1···wn=w. Every time it goes along a transition, it outputs the corresponding output symbol. For example, on input 2212011, machine T1enters the sequence of states q1,q2,q2,q2,q2,q1,q1,q1and produces output 1111000. On input abbb, T2outputs 1011. Give the sequence of states entered and the output produced in each of the following parts.

a. T1on input011

b. T1on input211

c. T1on input121

d. T1on input0202

e. T2on input b

f. T2on input bbab

g. T2on input bbbbbb

h. T2on input localid="1663158267545" ε

Use the pumping lemma to show that the following languages arenot regulara.   A1={0η1η2η|n0}b.   A2={ωωω|ω{a,b}*}c.   A3={a2η|n0}(Here,a2ηmeansastringof2ηa's.)a.   A1={0η1η2η|n0}b.   A2={ωωω|ω{a,b}*}c.   A3={a2η|n0}(Here,a2ηmeansastringof2ηa's.)

Let the rotational closure of language A be.

RC(A)={yx|xyA}

a. Show that for any language A, we have RC(A)=RC(RC(A)).

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

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.

Question: Prove that the following languages are not regular. You may use the pumping lemma and the closure of the class of regular languages under union, intersection, and complement.

a.{0n1m0n|m,n0}b.{0m1n|mn}c.{w|w{0,1}*isnotapalindrome}d.{wtw|w,t{0,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.

Sign-up for free