ECS 120: Theory of Computation
UC Davis Phillip Rogaway
Handout ps4
January 31, 2012
Problem Set 4 Due Tuesday, February 7, 2012
Problem 1. Are the following statements true or false? Either prove the statement or give a simple
counter-example.
(a) If L L

DEPT. OF COMPUTER SCIENCE, UNIVERSITY OF CALIFORNIA, DAVIS
ECSIZO, WINTER 2015 INSTRUCTOR: ROB GYSEL
Midterm #1
January 30th, 2015
Name: So\ Vii—t on; Student ID:
' Do not open the midterm until instructed to do so.
- You 50 minutes to complete your t

ECS 120: Theory of Computation
UC Davis Phillip Rogaway
ps2-soln
April 11, 2014
Problem Set 2 Solutions
Problem 1 Draw DFAs for the following languages:
(a) A = cfw_x cfw_a, b : |x| 3
(b) B = the binary encodings of numbers divisible by 7. Allow leading z

ECS 120: Theory of Computation
UC Davis Phillip Rogaway
ps1-soln
April 3, 2015
Problem Set 1 Solutions
Problem 1 Call a number x N = cfw_1, 2, 3, . . . a palindromic number if, written as a decimal string
X without leading zeros, its a palindrome (X = X R

ECS122A Homework Assignment #3
Due: 4:00pm, February 5, 2014
1. What does the algorithm FindMaxSubarray1 returns when all elements of the array A are negative?
2. Write a pseudocode for the brute-force method of solving the maximum-subarray problem. Your

ECS 120: Theory of Computation
UC Davis Phillip Rogaway
ps2
April 4, 2014
Problem Set 2 Due Friday, April 11, 2013
Problem 1 Draw DFAs for the following languages:
(a) A = cfw_x cfw_a, b : |x| 3
(b) B = the binary encodings of numbers divisible by 7. Allo

ECS 122A: Introduction to Algorithms
UC Davis Vladimir Filkov
May 22, 2012
Problem Set 6
Due May 29 at 3:15 pm in 2131 Kemper
Exercises from the text (do not submit): 7.1, 7.2, 7.3, 7.6, 7.13, 7.16, 7.17, 7.18, 7.21, 7.22, 7.24, 7.26,
7.27, 7.31, 7.32, 7.

ECS 122A: Introduction to Algorithms
UC Davis Vladimir Filkov
May 22, 2012
Problem Set 5 Solutions
Exercises from text (dont submit): 5.33, 5.35b, 5.40, 5.48, 5.51, 5.57, 5.59, 5.61, 5.68, 6.11, 6.12, 6.31.
Problems (140):
(12) Problem 1. How many zeros d

ECS 122A: Introduction to Algorithms
UC Davis Vladimir Filkov
April 18, 2012
Problem Set 2 Solutions
(15) Problem 1. Give a direct proof of the following: If x is an odd integer and y is an even integer, then
x + y is odd.
Solution: Suppose x = 2k + 1, y

ECS 120: Theory of Computation
UC Davis Phillip Rogaway
ps4-soln
April 25, 2014
Problem Set 4 Solutions
Problem 1.
(a) Using the procedure shown in class, convert NFA into a regular expression for the same language.
b
a
0
1
2
c
b,c
c
(b) Using the procedu

ECS 120: Theory of Computation
UC Davis Phillip Rogaway
ps8
May 16, 2014
Problem Set 8 Due Friday, May 23, 2014
If you liked working with a partner and want to do so again, you may, turning in one problem set per
group. I dont recommend groups of more tha

ECS122A Homework Assignment #4
Due: 4:00pm, February 14, 2014
1. For the sequences X = B, C, A, A, B, A and Y = A, B, A, C, B ,
(a) Follow the pseudocode LCS-length to ll in the dynamic programming c and b tables. for
nding the longest common subsequence

ECS 120: Theory of Computation
UC Davis Phillip Rogaway
ps2
April 3, 2015
Problem Set 2 Due Friday, April 10, 2015
Problem 1 Draw DFAs for the following languages:
(a) A = cfw_x cfw_a, b : |x| 3
(b) B = the binary encodings of numbers divisible by 7. Allo

Gdel for Goldilocks: A Rigorous, Streamlined Proof
o
of (a version of ) Gdels First Incompleteness Theo
orem, Requiring Minimal Background1
Dan Guseld
Department of Computer Science, UC Davis
August 2014, Updated October 1, 2014
1
Introduction: Why I wrot

ECS 120: Theory of Computation
UC Davis Phillip Rogaway
ps1
March 30, 2015
Problem Set 1 Due Friday, April 3, 2015
Instructions: Read the course-information sheet. Remember to acknowledge anyone with whom you
discussed problems. Recall too that homeworks

ECS 120: Theory of Computation
UC Davis Phillip Rogaway
mt
November 6, 2012
Midterm Exam
Instructions:
Please write neatly: if I cant read it, it isnt right.
The exam is closed-book, closed-notes, closed-devices, closed-neighbors. Anyone violating these

Midterm study sheet for CS3719
Regular languages and nite automata:
An alphabet is a nite set of symbols. Set of all nite strings over an alphabet is denoted . A
language is a subset of . Empty string is called (epsilon).
Regular expressions are built r

ECS 120: Theory of Computation
UC Davis Phillip Rogaway
Handout MT
February 16, 2012
Midterm Exam
Instructions: The exam has six pages, including this cover page, printed out two-sided (no
more wasted paper). Please read the questions carefully, then answ

ECS 120: Theory of Computation
UC Davis Phillip Rogaway
Handout F1
June 17, 2004
ECS 120 Final Spring 2004
Hints for success:
Please read the questions carefully; maybe they ask something dierent from what you expect.
If you dont understand what a questio

ECS 120
Discussion 4/8
Denition review
An alphabet is a
. (nite, nonempty set)
A string is a
sequence of
A language is a
of
over
over
. (nite, characters, an alphabet).
. (set, strings, an alphabet).
A DFA M = ( , , , , ). (Q, , , q0 , F ).
Q is
. (a

ECS 120: Theory of Computation
UC Davis Phillip Rogaway
ps2
April 3, 2015
Problem Set 2 Due Friday, April 10, 2015
Problem 1 Draw DFAs for the following languages:
(a) A = cfw_x cfw_a, b : |x| 3
(b) B = the binary encodings of numbers divisible by 7. Allo

Introduction to Theory of Computation
Anil Maheshwari
Michiel Smid
School of Computer Science
Carleton University
E-mail: cfw_anil,michiel@scs.carleton.ca
October 3, 2012
ii
Contents
Contents
Preface
vi
1 Introduction
1.1 Purpose and motivation . . . . .

Dept. of Computer Science, University of California, Davis
ECS120
Instructor: Rob Gysel
January 24th , 2016
Homework #3: Due 2/1/16 by 11:59pm.
Vikas Ralmilay #998261540
February 1, 2016
Homeworks are to be turned in on Gradescope by the due date. No late

Dept. of Computer Science, University of California, Davis
ECS120
Instructor: Rob Gysel
January 24th , 2016
Homework #3: Due 2/1/16 by 11:59pm.
Vikas Ralmilay #998261540
February 1, 2016
Homeworks are to be turned in on Gradescope by the due date. No late

Reduibility
Problem A is reduible to problem B if a program for B an be used to onstrut a program
for A.
Finding the median is reduible to sorting.
Integer multipliation is reduible to addition.
Graph onnetivity is reduible to matrix mult.
If A redues to