Homework 2 - For each string s in a language L , j i i a a...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Robert L. Anderson 2/7/2008 CSCI 2400-01 HW2 1.   0 : n a ab L n NFA: to DFA: 2. Define: second( ) = With string n a a a s 2 1 , the operation second( s ) =   0 : 2 k a k (the concatenation of all letters of s having an even subscript). This is the same as raising a letter to the power of zero if the modulus of its index is 0. Applied to a language, second( L ) =   L s k s k , 0 : 2 where s n is the n th letter of a string. If we have an NFA for a language L : ...we can add lambda transitions so that it accepts second( L ), thus proving second( L ) produces a regular language. q 0 q 1 q 2 q 3 q 4 a 1 a 2 a 3 a 4 ... q 0 q 1 q 2 q 3 q 4 a 1 a 2 a 3 a 4 ... {q 0 } {q 1 } b a {q 2 } a Ø b a,b a,b q 0 q 1 b a q 2 a       ) , ( ) , ( ) , ( ) , ( ) , ( ) , ( 2 2 1 1 2 1 0 1 0 b q a q q b q q a q b q q a q
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Robert L. Anderson 2/7/2008 CSCI 2400-01 HW2 3. We can prove that a language is regular by constructing an NFA for it.
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: For each string s in a language L , j i i a a a s 1 and i j j R a a a s 1 . The reverse is defined as L s s L R R : . Thus, the NFA for L R would have the same states as the NFA for L , but would have the direction of the transitions reversed and the initial state and accepting state would be swapped. becomes: For a language L , with alphabet , the complement L L * . Thus, the NFA for L will accept everything the NFA for L rejects, and vice versa. becomes: q i q j q i q j q j q i q j q i...
View Full Document

This homework help was uploaded on 04/07/2008 for the course CSCI 2400 taught by Professor Carothers during the Spring '08 term at Rensselaer Polytechnic Institute.

Page1 / 2

Homework 2 - For each string s in a language L , j i i a a...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online