Problem Set 2 Solutions
Prepared by Rachel Cummings
January 31, 2013
Note: For the following reductions, there are multiple algorithms that will also yield correct proofs. Full
credit was given on the homework for correct proofs, regardless of the algorit
Partial Solutions for Homework 8
Prepared by Rachel Cummings
Problem 1
Independent Set
(a)
An instance s of this problem is a graph G = (V, E) and a number k. The certificate t is a list of at least k
vertices that form an independent set
Certifier B(s,t)
Problem Set 3 Solutions
Prepared by Rachel Cummings
February 8, 2013
Problem 3
A dag is a directed acyclic graph. This means that your graph should have directed edges and no cycles.
A topological ordering is one where if there is a (directed) edge from s
Partial Solutions to Homework 7
Prepared by Rachel Cummings
Problem 2
This solution only presents the correct algorithm. For full credit, you needed to complete all parts of the
problem.
Input: Strings S1 , S2 , S3 , S4 of lengths n1 , n2 , n3 , n4 respec
Problem Set 1 Solutions
Prepared by Rachel Cummings
January 24, 2013
Problem 1
There are many examples
m1 m2 m3 m4 w1
w1 w4 w3 w2 m4
w2 w1 w4 w3 m3
w3 w2 w1 w4 m2
w4 w3 w2 w1 m1
with
w2
m3
m2
m1
m4
n=4
w3
m2
m1
m4
m3
and at least three stable matchings. B
Professor Xin Chen, Biometrics, Fall 2016
Assignment: Design and Evaluate an Iris Recognition System
Objective: The student will design and evaluate an iris recognition system using the
data provided and an open source iris recognition software.
Data
1. T
EECS 336
Homework 7
Problem 1
Solution:
We define v1 , v2 , ., vn as the n variables, c1 , c2 , ., cm as the m clause, ki represents the number of literals in the i-th clause, and Lj represents the j-th literal in the i-th clause.
Algorithm:
DNF-SAT(v1 ,
EECS 336
Homework 6
Problem 1
Solution:
The 0-1 knapsack problem is not always a polynomial-time problem.
This problem can be solved by dynamic programming algorithm.
Algorithm:
we can use i represent the i th item,
wi to represent the weight of i th item
EECS 336
Homework 8
Problem 1
Solution:
Algorithm:
The algorithm to deal with this problem is same as the randomized 2-approximation algorithm for MAX-3-CNF problem. Let us set every variable to 1 with probability 21 and to
0 with probability 12 independe
Lecture 1
1. Explain the difference between physical and behavioral biometrics.
Physical Biometrics is measured at an instant in time (e.g. fingerprint, face, iris), while
Behavioral Biometrics is measured dynamically overtime (e.g. voice, signature, gait
%
%
%
%
%
%
%
%
%
Face Recognition System
Version : 1.0
Date : 28.5.2012
Author : Omid Sakhi
Website : http:/www.facerecognitioncode.com
Please visit the website for complete program and guide
Original Paper :
H. Miar-Naimi and P. Davari A New Fast and Ef
Professor Xin Chen, Biometrics, Fall 2016
Assignment: Biometrics Systems Design and Evaluation
1. Plot imposter and genuine distributions and corresponding ROC curve according
to the case below.
A,B,C,D,E five subjects iris match scores are listed in the
Professor Xin Chen, Biometrics, Fall 2016
Assignment: Design and Evaluate a Face Recognition System
Objective: Students will design and evaluate a face recognition system using the
data provided and an open source face recognition software.
Data
Face imag
EECS 336
Homework 2
Problem 1
Solution:
Algorithm:
a) We can spilt the array X into 2 subarrays: X1 and X2, each of subarrays are in half size.
b) After that, we do a linear time equality operation to decide whether it is possible to find
second majority
EECS 336
Homework 5
Problem 1
Solution:
(a) In this problem, define i be the i-th operation in the min-heap, ni be number of elements
in the heap after the i-th operation.
ni
P
Let the potential function of this binary min-heap be (Di ) =
lgm
m=1
INSERT:
EECS 336
Homework 3
Problem 1
Solution:
We can use the Dynamic Programming to find the Shortest maximumweight common subsequence of X and Y that has the most occurrences of s1 among all shortest maximumweight
common subsequences of X and Y.
The pseudo Cod
EECS 336
Homework 4
Problem 1
Solution:
This algorithm is incorrect.
We can use a counter example to explain this:
X:BCDDDD
Y:DDDDCB
If we use the greedy approach mentioned in this paper to fine the LCS of sequence X and
Y, we will get the steps as follow
EECS 336
Homework 1
Problem 1
Solution:
(a): The ordering of these six functions:
(n + 1)! = (en ), en = (lgn)2lgn ), (lgn)2lgn = (42lgn ), 42lgn = (2lgn ), 2lgn = (lgn)
The following justifications explain the rankings:
(lgn)2lgn = n2lglgn , since algb =
Northwestern University
Electrical Engineering and Computer Science
EECS359/459: Art of Multicore Programming
Prof. Hai Zhou
Sept 22, 2016
Handout #1
Due: Sept 29
Homework 1
Questions will usually be given as exercise nubers from the textbook, but this fi
Northwestern University
Electrical Engineering and Computer Science
EECS359/459: Art of Multicore Programming
Prof. Hai Zhou
Sept 29, 2016
Handout #2
Due: Oct 6
Homework 2
The problems starting with Exercise are problems in the textbook. You can discuss p
1
Exercise 47. Prove Lemma ?.
Solution Let A0 , . . . , An1 be the n threads. Consider the sequence of initial states s0 , . . . , sn where A0 , . . . , , Ai1 have inputs 1 and Ai , . . . , An1 have
inputs 0. (That is, s0 has all inputs 0 and sn all input
EECS395/495 Solution #4
29.
Yes. Every method call must finish in finite steps to be wait-free. We
prove it by contradiction. If there is a method call that takes infinite
steps to finish. The thread calling the method is only possible to finish
finite nu
EECS395/495 Solution #5
43.
If read() does not overlap write(), then read() call returns the most
recently written value. For overlapping method calls, the reader may
read either the old or new value, which is regular.
46.
a. regular register. Both mutual
EECS395/495 Solution #6
61.
type A broadcast has consensus number of 1.
Proof sketch: Assume we have a consensus protocol for two threads P
and Q. The protocol has a critical state s. Without loss of generality, we
can assume P's next move (broadcast) tak
EECS395/495 Solution #1
1. There are 2^n 1 possible results. Each y_i can be either 0 or 1,
except that cfw_y_i = 0 for all i is an impossible result.
Proof: There are two separate things we need to prove,
First, cfw_y_i = 0 for all i is impossible. If we
Hw#2 Solution
11.
a. It satisfies mutual exclusion
Proof: Suppose not. Let A and B be two threads concurrently in critical section.
Inspecting the execution sequence, we have
A: turn = A A: busy = false A: busy = true A: turn = A
B: turn = B B: busy = fal
EECS395/495 Solution #3
14.
The modification is simple, just replace
for (int i = 1; i < n; +)
with
for (int i = 1; i < n - l + 1; i+)
The proof of l-exclusion and l-starvation-free are similar as in the
textbook.
16.
a. Proof: By contradiction. Assume th