{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# hwsoln09 - CS 341 Foundations of Computer Science II Prof...

This preview shows pages 1–3. Sign up to view the full content.

CS 341: Foundations of Computer Science II Prof. Marvin Nakayama Homework 9 Solutions 1. Let B be the set of all infinite sequences over { 0 , 1 } . Show that B is uncountable, using a proof by diagonalization. Answer: Each element in B is an infinite sequence ( b 1 , b 2 , b 3 , ... ) , where each b i ∈ { 0 , 1 } . Suppose B is countable. Then we can define a correspondence f between N = { 1 , 2 , 3 ,... } and B . Specifically, for n ∈ N , let f ( n ) = ( b n 1 , b n 2 , b n 3 , ... ) , where b ni is the i th bit in the n th sequence, i.e., n f ( n ) 1 ( b 11 , b 12 , b 13 , b 14 , b 15 , ... ) 2 ( b 21 , b 22 , b 23 , b 24 , b 25 , ... ) 3 ( b 31 , b 32 , b 33 , b 34 , b 35 , ... ) 4 ( b 41 , b 42 , b 43 , b 44 , b 45 , ... ) . . . . . . Now define the sequence c = ( c 1 , c 2 , c 3 , c 4 , c 5 , ... ) ∈ B over { 0 , 1 } , where c i = 1 b ii . In other words, the i th bit in c is the opposite of the i th bit in the i th sequence. For example, if n f ( n ) 1 (0 , 1 , 1 , 0 , 0 ,... ) 2 (1 , 0 , 1 , 0 , 1 ,... ) 3 (1 , 1 , 1 , 1 , 1 ,... ) 4 (1 , 0 , 0 , 1 , 0 ,... ) . . . . . . then we would define c = (1 , 1 , 0 , 0 ,... ) . Thus, c ∈ B differs from each sequence by at least one bit, so c does not equal f ( n ) for any n , which is a contradiction. Hence, B is uncountable. 2. Recall that EQ CFG = { ( G 1 ,G 2 ) | G 1 and G 2 are CFGs and L ( G 1 ) = L ( G 2 ) } . Show that EQ CFG is undecidable. Answer: We will reduce ALL CFG to EQ CFG , where ALL CFG = { ( G ) | G is a CFG and L ( G ) = Σ } . Sipser shows that ALL CFG is undecidable. 1

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

View Full Document
Define CFG G 0 = ( V, Σ ,R,S ) , where V = { S } and S is the starting variable.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern