SOLUTIONS Homework 1, CS320, Fall 2015
1. Suppose you know that A = B is true.
(a) What does this fact tell you about the value of A, if anything?
Nothing. It could be either true or false.
(b) What does this fact tell you about the value of B, if anythin
Homework 1, CS320, Fall 2016
Your Name and CSU ID number:
Print out this sheet and fill in your answers in the spaces provided. Staple the sheets
together
Note: Suppose there is no life on Mars. Then the statement, All Martians are green
is a true stateme
Homework 1, CS320, Fall 2015, due Friday, 9/4 at the beginning of class
Revised 9/2 18:35 to x a typo in the three options for problem 13.
Your Name:
Print out this sheet and ll in your answers in the spaces provided. Staple the sheets
together
The statem
SOLUTIONS: CS 320 Final, Spring 13, McConnell
One surprise for me was the small number of people who got the rst ve problems. I
thought these were giveaways, given what I had promised in the study guide.
I either underestimated the diculty or many of you
A solution to the stable marriage problem
Emily Riehl
Harvard University
http:/www.math.harvard.edu/~eriehl
6 March 2013
Emily Riehl (Harvard University)
A solution to the stable marriage problem
6 March 2013
1 / 20
Stable marriages
A matching is stable i
CS 320: Assignment 5
Due: April 12th, 2016
Due at 12:30 on canvas
Problem 1 (25 points) A number is non-decreasing if every digit (except the first
one) is greater than or equal to previous digit. For example, 223, 4455567, 899, are nondecreasing numbers.
CS 320: Assignment 1
Due: February 2nd, 2016
Due at 12:30 before class
Problem 1 50 points) The version of the stable matching problem we considered in
class was aimed at producing a perfect matching, i.e. each person is matched to a single
person. In thi
CS 320: Assignment 7
Due: May 6th, 2016
Due at 12:30 before class on canvas
Problem 1 (30 points)
The partition problem is defined as follows: Given a set of integers, does there exist a
partition of the set into two subsets such their sum is equal. This
CS 320: Assignment 3
Due: March 1st, 2016
Due at 12:30 before class
Submit via Canvas!
Problem 1 25 points) The transitive closure G of a directed graph G = (V, E) is a
graph over the nodes of G with an edge (u, v) if and only if there is a path from u to
Name: _ Date: _
CS 160, Spring 2015
Homework 1
Inference Rule Proof
Please bring in a completed paper copy of this assignment at the beginning of your
first recitation the week of March 30th.
Data Structures and Algorithms - COMS21103
Stable Matching and Dijkstras Algorithm
Problem Sheet (with Answers)
A: Stable Matching A quick overview of the Gale-Shapley algorithm. For n men (m1 , m2 , . . . mn )
and n women (w1 , w2 , . . . wn ) each with
\documentclass[12pt,a4paper]cfw_article
\usepackagecfw_amssymb,url % This package is only needed for the use of math
% symbols as in $\mathbbcfw_R^3$. (See reference [2]).
\setlengthcfw_\parindentcfw_0pt
\setlengthcfw_\parskipcfw_5pt plus 2pt minus 1 pt
\
CS 160, Spring 2015
Homework 1 Answer Key
Inference Rule Proofs
1. (30 points) Prove using Rules of Inference and Logical Equivalences. State
specific rule for each step. Use as many steps as you need.
CS 160, Spring 2015
Homework 2 Answer Key
Math Proofs
1. (25 points) Direct Proof: Use a direct proof to show that 2x + 3y is odd
when x is an even integer and y is an odd integer. Note: Use as many
Name: _ Date: _
CS 160, Spring 2015
Homework 2
Math Proofs
Please turn in a paper copy of this assignment at the beginning of your first
recitation on the week of Monday, April 20th, no electronic
# Heap class: The internal variables are:
#
self._H: Heap array as defined in the book
#
self._allocation: size of self._H; some elements at the end of this
#
array might be unused. This is always a power of two.
#
self._size: Number of elements currently
Homework 2, CS320, Fall 2015, McConnell
Due Monday, 9/21 before class (extended)
Make sure that your program runs with the command ipython -i Heap.py
on the department Linux machines before you turn it it.
1. Solve problem 6, page 25, by reduction to the
Homework 3, CS320, Fall 2015, McConnell
Due Friday, October 9
Make sure that your program runs with the command ipython -i Heap.py
on the department Linux machines before you turn it it.
Work in Hw3.py. You can run several methods in it initially, includi
Quiz 9/2/15, proofs by contradiction, CS320, Fall 15, McConnell
Your Name:
When given a choice, circle the choice that best ts at the given location in the proof. You
have 15 minutes.
1. When G-S returns its solution, it is always the case that every pers
Study guide about Gale-Shapley proofs
The real subject of this material is how to do a proof by contradiction. These proofs are
just nice illustrations of the general techniques.
We will have a quiz on them next week, and this material will likely come up
Homework 5, CS320, Spring 2015, McConnell
Last modied 11/13 11:35
1. Master theorem: For each of the following, determine whether the master theorem
applies, and, if so, tell the big- bound it gives:
(a) T (n) = 3T (n/3) + n
(b) T (n) = 5T (n/2) + n3
(c)
Homework 6, CS320, Fall 2015, McConnell
Last modied 12/10/15 05:50 to amend problem 4
Study the posted NPC.pdf as you work through this assignment. I have kept the amount of
coding to a minimum because a lot of things are due at this time of year. Whether
10/31/12
Soviet Rail Network, 1955
Maximum Flow and Minimum Cut
Network Flow
Max flow and min cut.
Two very rich algorithmic problems.
Cornerstone problems in combinatorial optimization.
Beautiful mathematical duality.
Flow network.
Abstraction for materi
11/9/12
Efficient Certification
There is a big difference between FINDING a solution
and CHECKING a solution
P, NP and NP completeness
Independent set problem: in graph G, is there an
independent set S of size at least k?
v If I give you such a set S, the
9/21/12
The road trip algorithm
Greedy Algorithms
The road trip algorithm
Road trip from Fort Collins to Durango on a given route
with length L, and fuel stations at positions bi.
Fuel capacity = C miles.
Goal: make as few refueling stops as possible.
Kle
SOLUTIONS: Homework 3, CS320, Spring 2013, McConnell
1. In class, we discussed an algorithm for topological sorting a graph based on depth-rst
search.
(I showed you how to get part of this labeling and the initial prex. The most
important thing for the mi
Practicing reproducing a proof
CS320, Spring 13, McConnell
Last modied 1/25 11:22
A good exercise for strengthening your ability to prove things is to practice re-telling a
proof that you have seen. Nobody can remember all the details of a proof, so this
Quiz1: 1/31/2013, CS320, McConnell
1. Fill in whats missing from the following steps of the proof that every man gets his
highest attainable woman, that is, the highest woman on his list that he could ever
be married to in any stable-marriage arrangement.