Cs445 Homework #1 Solutions
Asymptotic running time and recursions formulas
Due 2/1/06
1. Assume f1 (n) = O(g1 (n) and f2 (n) = (g2 (n). Prove or disprove:
(a) f1 (n) f2 (n) = O(g1 (n) g2 (n)
Answer:
We are given that there exists an c1 > 0 and n1 such th
Cs545 Homework #1
Augmeting data structures, hash functions and
some amortize analysis
Due 9/25/06
September 12, 2006
Instructions. All assignments are to be completed on separate
paper. Use only one side of the paper. Assignments will be due
at the begin
Cs445 Homework #8
Approximation, SkipList, Union/Find and other
good things
This homework is optional. If it its graded is better than the lowest grade of a
homework of yours, it would replace this grade.
1. Let X = cfw_p1 . . . pn be a set of points, an
CSc 445 Homework #4 Solution
1. Propose an algorithm, which accepts two strings X and Z , that determines in time
O(|X | + |Z |) if Z is a subsequence of X . Prove the correctness of your algorithm.
Answer:
The following algorithm determines whether Z is
Cs445 Homework #1. Due 2/7/2012
Instructions.
1. Solution can be submitted by students in pairs. So each pair
can submit one assignment. The details (name and email) of
both the students should be specied.
2. You could submit either a pdf le or a paper so
CSc 445 Homework #5 Solution
Network Flow and Matching in Bipartite Graphs
1. 26.1-6. (from CLRS) Given a ow network G = (V, E ), let f1 and f2 be functions
from V V to R. The ow sum f1 + f2 is the function from V V to R dened by
(f1 + f2 )(u, v ) = f1 (u
Cs445 Homework #8
Approximation, SkipList, Union/Find and other
good things
Due: May 6 2006, midnight, either via email to .
This homework is optional. If it its graded is better than the lowest grade of a
homework of yours, it would replace this grade.
1
CSc 445 Homework #7
Convex Hull, Closest Pair and Stable Matching
Due 5/3/06
1. Prove that if A and B are convex sets, then A
1
B is a convex sets.
2
1
2
Figure 1: The lines 1 and
whereas, 1 and 2 are not.
2
are the pair of parallel lines with minimum dis
CSc 445 Homework #7 Solutions
Convex Hull, Closest Pair and Stable Matching
1. Prove that if A and B are convex sets, then A
B is a convex sets.
Answer:
A subset S is convex if and only if for every p, q S , pq S , where pq is the line
segment with p and
Cs445 Homework #5
Network Flow and Matching in Bipartite Graphs
Due: 4/24/2012
1. 26.1-6. Given a ow network G = (V, E ), let f1 and f2 be functions from V XV
to R. The ow sum f1 +f2 is the function from V xV to R dened by
(f1 + f2 )(u, v ) = f1 (u, v ) +
Cs445 Homework #2
Stable Marriage, SkipList and augmented data
structures
Instructions.
1. Solution can be submitted by students in pairs. So each pair can submit
one assignment. The details (name and email) of both the students
should be specied.
2. You
Cs445 Homework #3
Sorting, Median Selection and Dijkstra
Instructions.
1. Solution can be submitted by students in pairs. So each pair can submit
one assignment. The details (name and email) of both the students
should be specied.
2. You could submit eith
Cs445 Homework #6
Due: 5/1/2013
1. CLRS (second and third editions) 29-1-6
2. CLRS (second and third editions ) 29-1-7
3. CLRS (second edition) 29-2-7
4. Let G(V, E ) be a network ow where the capacity of every edge is 1. Suggest an
algorithm that nds in
CSc 445 Homework #4
Due April 11 2013
1. You have run Floyd algorithm on the graph G(V, E ), where V = cfw_v1 . . . vn . The
version of the algorithm studied in class returns a matrix D[1.n, 1.n] where D[i, v ]
contains the length of the shortest path vi
Cs445 Homework #3
2-3 trees, B-trees and Dynamic Programming
Instructions.
1. Solution can be submitted by students in pairs. So each pair can submit one
assignment. The details (name and email) of both the students should be
specied.
2. You could submit
Cs445 Homework #5
Network Flow, Matching, LP and ILP
Due: 4/24/2013
1. 26.1-6. Given a ow network G = (V, E ), let f1 and f2 be functions from
V V I . The ow sum f1 +f2 is the function from V V I dened by
R
R
(f1 + f2 )(u, v ) = f1 (u, v ) + f2 (u, v )
fo
CSc 445 Homework #6 Solutions
Tries, Sux Trees and Segments Intersection
1. Create a trie for the set of words S = cfw_ab, ba, ca, caa, caaa, baaa over the alphabet
= cfw_a, b, c.
Answer:
abc0
abc0
abc0
abc0
abc1
abc1
abc1
abc0
abc1
abc1
abc1
2. Consider
Cs445 Homework #8 Closest pair and convex hull Due last day of class
This homework is optional if you opt to submit it, its grade would replace the second lowest grade of your previous homeworks. 1. Run the algorithm studied in class for computing the con
8
Parameter Estimation
8
8.1
1
Parameter Estimation
Introduction
Parameter Estimators
An estimator, , is a statistic (function of data) used to estimate the
value of a parameter . Since estimators are functions of random
variables, they are themselves ran
Cs445 Homework #6
Due: 5/1/2012
1. Prove the correctness of the algorithm for Initializing an array in O(1) discussed
in class. That is, prove that if the code reports IsGarbage(A, i)=TRUE if and
only if no valued was assigned to A[i] since last init oper
9
Properties of Point Estimators & Methods of Estimation
9
9.1
Properties of Point Estimators &
Methods of Estimation
Consistency
Example: n is the number of tosses of a fair coin, p: chance of getting
a tail, X is the number of tails obtained among n ips
10
Hypothesis Testing
10
Hypothesis Testing
Hypothesis testing is used to investigate whether or not data are
consistent with some theory, when that theory can be quantied
through a particular value of a (population) parameter.
10.1
Four Basic Elements of
Cs445 Homework #2 Solutions
Sorting and Order Statistics
1. Let cfw_s1 . . . sm be a list of m strings, each over the alphabet cfw_a, b, . . . , z. You
are given an array P [1.m] such that P [i] is a pointer that points to si . Also
given an array of int
Homework 3 Rubric
March 6, 2006
1. Total 11 points.
Leave it blank or do not make any meaningful argument. (-11)
Do not suggest any data structures but argue the requirements of
the complexity of operations on the data structures. (-9)
Use wrong data s
Cs445 Homework #3
Prim Algorithm, and single-source shortest paths.
Due 3/01/06
Instructions:
All assignments are to be completed on separate paper.
Use only one side of the paper.
Assignments will be due at the beginning of class.
To receive full cre
Cs445 Homework #3 Radix Sort, MST and Human codes
Due: 28 February 2007 during class meeting. (Revised 2/21) Instructions. All assignments are to be completed on separate paper. Use only one side of the paper. Assignments will be due at the beginning of c
CSc 445 Homework #4
Bellman-Ford, Johnson, Floyd-Warshall and
Dynamic Programming
Due 3/22/2006
1. Propose an algorithm, which accepts two strings X and Z , that determines in time
O (|X | + |Z |) if Z is a subsequences of X . Prove the correctness of you