Homework set #7 solutions, Math 128A
J. Xia
Sec 4.4: 1a, 2a, 3a, 7abc, 17 1a. Compute by hand or use a program. Matlab code for the Composite Trapezoidal rule: function integral = cmptrap(a,b,n,f) h = (b-a)/n; x = [a+h:h:b-h]; integral = h/2*(2*sum(feval(

CS215 REVIEW EXERCISES
not graded Problem 1. (problem 7.15) Let UNARY-SSUM be the subset-sum problem in which all numbers are represented in unary. That is, each number k is encoded as a string of k 1s. (a) Show that UNARY-SSUM is in P. (b) Why does the N

Assignment #10-alt: Matrix Factorization and Matrix Norms Due date: Wednesday, November 24, 2010 (10:10am) For full credit you must show all of your work.
# 4 "12 8 & % ( 1. Consider the matrix A = %"12 40 "28( . % 8 "28 29 ( $ '
a. Derive the factorizati

CS 172, Midterm #1, Spring 1999
CS 172, Spring 1999 Midterm #1 Professor Manuel Blum
This is a CLOSED BOOK examination. Calculators ARE permitted. Do all your work on the pages of this examination. Problem #1 a) Define the number of steps taken by

CS 172 | Spring 1997 Computability and Complexity Problem 1. (30 points) a. Describe in words the language accepted by the following NFA:
0,1
Prelim 1 March 3, 1997
B
0 0 0,1 1 1
A
D
C
0,1
b. Write a regular expression that accepts the same lan

Name CS-172 David Wolfe Quiz 3
1 April 9, 1993
1. (20 points) Recall that any language, L, falls into one of four categories: (a) L is recursive (b) L is r.e. but not recursive (c) L is r.e. but not recursive (d) Neither L nor L are r.e. Note that

Name CS-172 David Wolfe 1. De ne
x
1 Quiz 2 March 12, 1993
Each of the following questions counts equally. Try to keep your answers succinct.
p
to be the parity bit of 2 f0 1g .
x p
x
=
0 if has an even number of 1's 1 if has an odd number of 1

Name CS-172 David Wolfe Quiz 1
1 February 12, 1993
Each of the following questions counts equally. Try to keep your answers succinct.
Pumping Lemma: If is regular then
(9n)(8z 2
L L
jzj
n)(9uvw
such that =
z L.
uvw
and juvj
n
and jvj 1)(8i)

CS 172: Computability and Complexity, Fall 2006
S.A. Seshia
Midterm 2
November 15. 2006
YOUR NAME:
Instructions: This exam is closed-book, open-notes. Please turn off electronic devices: cell phones, laptops, PDAs, etc. You have a total of 70 minutes. The

CS 172: Computability and Complexity, Spring 2010
S. A. Seshia & O. Etesami
Midterm 2
April 14, 2010
YOUR NAME :
Instructions:
This exam is open-book, open-notes. Please turn off and put away electronic devices such
as cell phones, laptops, etc.
You have

U.C. Berkeley CS172: Automata, Computability and Complexity
Professor Luca Trevisan
Practice Midterm
Dont panic.
The practice midterm has 9 problems.
The real midterm has 3 problems.
1
Practice Midterm
Feb 19, 2015
Problem 1
Let = cfw_0, 1. Let reverse

CS 172: Computability and Complexity, Spring 2010
S. A. Seshia & O. Etesami
Final Exam
May 11, 2010
YOUR NAME :
Instructions:
This exam is open-book, open-notes. Please turn off electronic devices: cell phones, laptops, PDAs, etc.
You have a total of 180

CS 172, Fall 2006, Midterm 1, Seshia
Problem 1: [True or False, with justification] (30 points)
For each of the following questions, state TRUE or FALSE. Justify your answer in brief, indicating only the proof idea or counterexample, drawing an annotated

CS 172: Computability and Complexity, Spring 2008
S. A. Seshia and A. Kulkarni
Midterm 1
February 26, 2008
YOUR NAME :
Instructions:
This exam is closed-book, open-notes. Please turn off and put away electronic devices such
as cell phones, laptops, etc.
Y

CS 172: Computability and Complexity, Spring 2010
S. A. Seshia and O. Etesami
Midterm 1
March 1, 2010
YOUR NAME :
Instructions:
This exam is open-book, open-notes. Please turn off and put away electronic devices such
as cell phones, laptops, etc.
You have

U.C. Berkeley CS172: Automata, Computability and Complexity
Professor Luca Trevisan
Solutions to Midterm 1
3/5/2007
Solutions to Midterm 1
1. Every day, a weather station records whether the day was sunny (S ), cloudy (C ) or rainy
(R). A sequence of reco

U.C. Berkeley CS172: Automata, Computability and Complexity
Professor Luca Trevisan
Solutions to Midterm 2
4/18/2007
Solutions to Midterm 2
1. Prove or disprove:
(a) Let M be a deterministic Turing machine that, on inputs of length n, uses space O(n2 ).
T

CS 172 | Fall 2000 Computability and Complexity
A = fw 2 f0 1g : w = wR g. B = fw 2 f0 1g : w 6= wR g. Here, wR is the word w reversed. Prove your answers.
Prelim 2 November 8, 2000
Problem 1. (50 points) Determine which of the following two langua

CS 172 | Spring 2000 Computability and Complexity Prelim #2 Solutions Solution 1. The language A is context free. We call a word w such that w = wR a palindrome. We build a CFG for palindromes based on a recursive de nition of a palindrome. Note that

CS 172 | Spring 2000 Computability and Complexity
Final Exam May 19, 2000
Problem 1. (100 points) Given a word w, the stutter reduction w] is the word that results from
w by deleting repeated adjacent occurrences of the same letter. For example, aa

CS172, Midterm 2, Spring 1999
CS 172, Spring 1999 Midterm Exam 2 Manual Blum
q q q q q
q
This is a CLOSED BOOK examination. Calculators ARE permitted. Do all your work on the pages of this examination. For most problems, you may answer YES, NO, "

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-wind

CS 172: Computability and Complexity
Introduction and Course Overview Sanjit A. Seshia EECS, UC Berkeley
Acknowledgments: L.von Ahn, L. Blum, M. Blum, R. Jhala
A Card Game: SET
A 'Set' is 3 cards in which for every feature: either it is the SAME o