1. Exercise 23.1-3 and 23.1-8 on Page 629.
2. Problem 23-4 on Page 641: Alternative minimum-spanning-tree algorithms. For each of the
three algorithms, either give a counterexample or prove that it always outputs a minimum
spanning tree. Make sure your pr
CSOR 4231 Final Exam
December 17, 2003, 9AM
Rules; Answer each question completely and concisely. When you give an
algorithm, be sure to give the most efficient one you can, to prove that it is
correct, and to analyze its running time. Any NP-completeness
CSOR 4231, Fall 2015
Problem Set 6 Solutions
Problem 1. Exercises 25.2-6. 25.1-10. All pairs shortest paths.
25.2-6
If any shortest-path distances from node i to itself, i.e., the main diagonal, becomes negative
then there is a path from i to itself, i.e.
CSOR 4231 Sketch of Solutions to Final Exam
December 17, 2003, 9AM
Rules; Answer each question completely and concisely. When you give an
algorithm, be sure to give the most efficient one you can, to prove that it is
correct, and to analyze its running ti
CSOR 4231, Fall 2015
Problem Set 5 Solutions
Problem 1. Exercises 22.2-6, 22.2-7, breadth first search.
Suppose we have a graph G = (V, E) and select a set of tree edges E E to form a new graph
G = (V, E ) as following:
S
S
a
b
a
b
c
d
c
d
G = (V, E)
G =
CSOR 4231 Midterm Exam
November 5, 2015, 4:10PM
Rules; Answer each question completely and concisely. When you give an
algorithm, be sure to give the most efficient one you can, to prove that it is
correct, and to analyze its running time.
Problem 1. [10
Chapter-3
Greedy Method
3.1 Greedy Technique Definition
Constructs a solution to an optimization problem piece by piece through a sequence of
choices that are: feasible, i.e. satisfying the constraints locally optimal (with respect to some
neighborhood de
Master method for Solving Recurrences
Introduction
Consider a problem that can be solved using a recursive algorithm such as the
following:
Procedure T( n : size of problem ) defined as:
if n < 1 then exit
Do work of amount f(n)
T(n/b)
T(n/b)
.repeat for
CSOR W4231: Homework 5
TA Solutions
November 30, 2016
1. Problem 1 (Graded by Keyu)
For every edge (u, v) in the original graph, we can construct the edge (C[u], C[v]) in quotient graph.
Since there may exists multiple nodes in the same part i pointing to
CSOR W4231: Homework 6
TA Solutions
December 3, 2016
1. Problem 1 (Graded by Daniel) (25 pts) There are two ways to solve this problem, one more general
than the other:
Less generally: assume that all edges have integer weight. Then pick some that is les
function g = sigmoid(z)
%SIGMOID Compute sigmoid function
%
J = SIGMOID(z) computes the sigmoid of z.
% You need to return the following variables correctly
g = zeros(size(z);
% = YOUR CODE HERE =
% Instructions: Compute the sigmoid of each value of z (z
Algorithms for Data Science
CSOR W4246
Eleni Drinea
Computer Science Department
Columbia University
Identifying important nodes on the Web:
Hubs and Authorities, and PageRank
Outline
1 The structure of the WWW
2 Identifying important pages via link analys
CSOR W4246 Fall 2015
Homework 3 solutions
1. Problem 1
The value of the max flow is 11. A max flow vector is:
fsa = 7, fsb = 3, fsd = 1
fab = 0, fac = 2, fat = 5
fbc = 3, fct = 5
fdb = 0, fdc = 0, fdt = 1
A cut of minimum capacity is (cfw_s, a, b, c
W4246 Algorithms for Data Science
1
Homework Solution #2
Problem 1
This algorithm is a modified BFS, starting at node v. For each node u processed by
BFS, we record two values: the number of shortest v u path u.num, and the length
of the shortest paths u.
1. (20 points) True or False? Circle the correct answer (no explanation required).
i.
T
F
ii.
T
F
iii.
T
F
iv.
T
v.
T
vi.
T
F
F
F
2. (i) Construct graph G = (V, E) where intersections become nodes and there is a directed edge
from node u to node v if ther
Homework 0, due Monday September 12
COMS 4772 Fall 2016
Problem 1 (Values). Name one or two of your own personal, academic, or career values, and
explain how you hope CS/ML theory can be of service to those values.
1
Problem 2 (Stuff you must know). The c
CS 140
Midterm Review
Administrivia
Project 2: User Programs was due today at
noon
Midterm Quiz Monday Feb. 10, 4:15-5:30pm
in Gates B01.
Open book
Open notes
No electronic devices
Midterm Coverage
Processes/Threads
Concurrency
Scheduling
Virtual Mem
COMS 4231: Analysis of Algorithms I, Fall 2016
Problem Set 6, due Saturday December 3, 11:59pm in pdf format on
Courseworks.
Note the due date: We plan to post solutions in preparation for the final, so
no late homeworks will be accepted.
Please follow th
CSOR W4231: Homework 3
TA Solutions
October 20, 2016
1. Problem 1 (20 points) (Graded by Michael)
a. The number of ways to divide 2n numbers into two sorted lists with n numbers is
2n
(2n)!
(2n)!
=
=
n
n!(2n n)!
n!n!
This counts the number of ways to se
CSOR W4231: Homework 4
TA Solutions
November 15, 2016
1. Problem 1 (15 points) (Graded by Daniel) For our solution, we will design a greedy algorithm, and
then evaluate its runtime and prove its correctness using the methods given in class.
Solution: Plac
CSOR W4231: Homework 2
TA Solutions
October 6, 2016
1. Problem 1 (18 points) (Graded by Michael)
a. T (n) = 4T (n/2) + n2
We use the master theorem. The parameters are a = 4, b = 2, f (n) = n2 and nlogb a = nlog2 4 = n2 . Case
II of the master theorem app
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by Ca
COMS 4231: Analysis of Algorithms I, Fall 2016
Problem Set 4, due Thursday November 10, 11:59pm in pdf format on
Courseworks.
Please follow the homework submission guidelines posted on courseworks.
As usual, for each of the algorithms that you give, inclu
COMS 4231: Analysis of Algorithms I, Fall 2016
Problem Set 5, due Tuesday November 22, 11:59pm in pdf format on
Courseworks.
Please follow the homework submission guidelines posted on courseworks.
As usual, for each of the algorithms that you give, includ
CSOR4231: Analysis of Algorithms
Fall 2016
Alex Andoni
Lecture 10, 10/6/16
Last time
Problem: Dictionary
Min/max, succ/pred, insert/delete
Data Structure: Binary Search Trees
Operations: ()
Balanced Trees
Trees with height = log always
2
Today
Bala
CSOR4231: Analysis of Algorithms
Fall 2016
Alex Andoni
Lecture 9, 10/4/16
Last time
Problem: Priority Search
Data Structure: Heaps
Heap Sort
2
Today
Problem: Dictionary
Data Structure: Binary Search Trees
Balanced Trees
3
Dictionary:
Searching / Ind