Sipser 1.41 - 1.41 For languages A and B let the perfect...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1.41) For languages A and B, let the perfect shuffle of A and B be the language {w|w = a1b1, a2b2,...ak,bk, where a1,...ak A and b1,...bk B, each ai,bi } 1. Let MA = (QA,, A, qA, FA) and MB = (QB,, B, qB, FB) be DFAs that recognize A and B, respectively 2. There exists another DFA Mshuffle which recognizes the perfect shuffle of A and B. This DFA functions by mimicking both MA and MB, alternating between these two parallel sets in order to ensure that it reads the "perfect shuffle" of A and B. 3. Mshuffle = (Q, , , q, F) 4. Q = {A,B} x QA x QB. This allows Mshuffle to track the states in both MA and MB, and which one should be matched. 5. Let a be some character in . : ((w, x,A), a) = (A(w, a), x,B) ((y, z,B), b) = (y, B(z, b),A) Essentially, if the current state of Mshuffle indicates that it's MA compenent is in the w state, it's MB compenent is in the x state, and the character read (a) should act in MA, then the current state of the MA compenent must shift to A(w, a), while the current state of the MB compenent should remain unchanged, but should be accessed for the next character. A similar process is followed for when the character read should act in MB . 6. q = (qA, qB,A) Start in the start states for A and B, respectively; the first character should be in MA. 7. F = FA FB {A} This indicates that Mshuffle should accept the string if both MA and MB are in accept states, and the next character read should be in MA (that is, the last character was read in DB). 8. As Mshuffle is a DFA recognizing the perfect shuffle of A and B, the class of regular languages is closed under perfect shuffle. ...
View Full Document

This note was uploaded on 04/06/2008 for the course EECS 376 taught by Professor Stout during the Spring '08 term at University of Michigan.

Ask a homework question - tutors are online