CS172 hw1 - CS 172 Computability and Complexity Spring 2008...

• Homework Help
• PresidentHackerCaribou10582
• 1

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

CS 172: Computability and Complexity, Spring 2008 S. A. Seshia & A. Kulkarni HW 1: Introduction to DFAs and NFAs Assigned: January 24, 2008 Due in class: January 31, 2008 Note: Take time to write clear and concise solutions. Confused and long-winded answers may be penalized. Consult the course webpage for course policies on collaboration. 1. (4 points) A palindrome is a binary string which is equivalent to its reversal. For example, 1, 1001 and 00100 are palindromes, but 1011 is not. Prove that any even-length palindrome must have the same number of ones in its first half as in its second half. (be sure to include your proof idea/sketch as well as the complete proof) 2. (6 points) (a) Design and draw a DFA which reads in a non-negative integer written in binary, least significant bit first, and accepts exactly when the input is divisible by four. (There is no sign bit in the representation.) Specify what Q , Σ , δ , q 0 , and F are for your DFA. (b) Now suppose that before the least significant bit, there is a bit indicating the sign of the integer: 0 for a negative number, and 1 for a positive number. How would you modify
This is the end of the preview. Sign up to access the rest of the document.
• Spring '08
• Seshia
• Negative and non-negative numbers

{[ 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