CPSC 320 Notes, Clustering
January 25, 2017
You're working on software to manage people's photos. Your algorithm receives as input:
a bunch of uncategorized photos,
the number of categories to group t
CPSC 320 Summer 2017 Term 2
Tutorial 1
1
Formulating an algorithm
1. An initial instinct to solve many problems we encounter is to simply use brute force. In the case of
the Stable Matching Problem, t
CPSC 320 Sample Midterm 2
November 2014
[12] 1. Answer each question with True or False, and then justify your answer briefly.
[2] (a) The Master theorem can be applied to the recurrence relation
T (n
CPSC 320 Summer 2017 Term 2
Assignment 2
1
Due 22:00 Monday, July 17, 2017
This assignment is to be submitted via GradeScope at https:/gradescope.com .
This assignment may be completed in a group of u
CPSC 320 Summer 2017 Term 2
Assignment 3
1
Due: 22:00, Monday, July 31, 2017
1. A popular pastime of computer scientists is fantasizing about how we can use our knowledge to get
rich playing the stock
CPSC 320 Sample Midterm 1
October 2013
[9] 1. State whether each of the following statements is true or false. Justify each of your answers
briefly.
[3] a. You should use decision trees if you want to
CPSC 320 Sample Midterm 2
November 2013
[9] 1. Sorting and Order Statistics
[3] a. Why is RandomizedQuicksort (Quicksort using a random pivot) better than the regular (non-randomized) version of Quick
Dynamic Programming
Shortest path
Sequence alignment
July 26, 2017
Geoffrey Tien
1
Shortest Path
Suppose that every arc of a digraph has length (cost,
weight.) ()
but now we allow negative edge weig
BRANCH PREDICTION
-a CPU does not need to execute out of order to benefit
from branch prediction
Branch Predictor
-predicts direction of branch (taken vs. not taken)
-In 5-stage MIPS, we do not need t
LECTURE 1 ISA
Def: The subset of hardware features visible to the programmer
-data, computation,storage/retrieval, flow control
Leveled compilation (high -> low)
High Level program > compiler > Assemb
Problem Set 2
Due date: Feb 9, 2018 at 9pm
1. (3 pts) Given two matroids M1 and M2 defined on the same universe U , the intersection of
the two matroids is the set of their common independent sets, i.
CPEN 411 (2017 W1)
Problem Set 4
Page 1 of 3
PROBLEM 1
The following problem concerns basic cache lookups:
The memory is byte addressable.
Memory accesses are to 1-byte words (not 4-byte words).
Ph
CPSC 340 Assignment 3 (due Friday, Feb 9 at 9:00pm)
Instructions
Rubric: cfw_mechanics:3
The above points are allocated for following the general homework instructions on the course homepage.
Contents
CPSC 320 Sample Midterm 1
October 2014
[13] 1. Short Answers
[3] a. In the version of the Gale-Shapley stable matching algorithm where women propose,
is it possible for every man to get his worst poss
CPSC 320 Summer 2017 Term 2
Tutorial 3
1
Divide and Conquer
Consider an unordered array of elements. A majority element is any element occurring in more than
2 positions. Assume that the only operatio
CPSC 320 Notes: DP in 2-D
March 4, 2017
A and B is the longest string whose letters appear in
A and B. For example, the LCS of eleanor and naomi
2 string ao).
The Longest Common Subsequence of two str
CPSC 320 Notes, Reductions and Resident Matching: A
Residentectomy
January 6, 2017
A group of residents each needs a residency in some hospital.
A group of hospitals each need some
number (one or more
CPSC 320 Sample Solution, Reductions and Resident Matching: A
Residentectomy
January 6, 2017
A group of residents each needs a residency in some hospital.
A group of hospitals each need some
number (o
CPSC 320 2016W2: Assignment 1
January 13, 2017
Please submit this assignment via GradeScope at https:/gradescope.com. Detailed instructions about
how to do that are pinned to the top of our Piazza boa
CPSC 320 2016W2: Quiz 3 Sample Solution
February 9, 2017
1
Greedy banks resequencing debits
Predatory banks take the debits to an account that occur over the day and reorder them to maximize
the fees
CPSC 320 Sample Solution, The Stable Marriage Problem
January 4, 2017
1
Trivial and Small Instances
1. Write down all the
trivial instances of SMP. We think of an instance as trivial roughly if its so
CPSC 320 Notes, The Stable Marriage Problem
January 3, 2017
The major goal of CPSC 320 is, of course, romantic advice. That's a heavy topic over which to meet
your classmates. So, we use candy and bak
CPSC 320 2016W2, Sample Solution: Assignment #2
February 4, 2017
1
Cluedo Something to Me
The new game Clue II (CII, for short) is about a group of
n people, each intent on stealing one of n objects.
CPSC 320 Sample Soln: Memoization and Dynamic Programming,
Part 2
March 1, 2017
1
If I Had a Nickel for Every Time I Computed That
1. Rewrite
CCC,
this time storingwhich we call memoizing, as in take
CPSC 320 Sample Solution: Physics, Tug-o-War, and
Divide-and-Conquer
February 4, 2017
In tug-o-war, two teams face each other and
carefully pull on a well-selected rope (to avoid injury).
The team tha
CPSC 320 Sample Solution, Clustering
February 4, 2017
You're working on software to manage people's photos. Your algorithm receives as input:
a bunch of uncategorized photos,
the number of categories
CPSC 320 2016W2: Assignment #2
January 23, 2017
Please submit this assignment via GradeScope at https:/gradescope.com. Detailed instructions about
how to do that are pinned to the top of our Piazza bo
CPSC 320 Summer 2017 Term 2
Assignment 4
1
Due: 22:00, Friday, August 11, 2017
This assignment is to be submitted via GradeScope at https:/gradescope.com .
This assignment may be completed in a group
Copyright Notice: UBC retains the rights to this document. You may not distribute this document without permission.
CPSC 320: Intermediate Algorithm Design
2016 Summer Term 1
Tutorial 10 Solutions
Pro
CPSC 320: Intermediate Algorithm Design
2016 Summer Term 1
Tutorial 8 Solutions
Prof. Nick Harvey
University of British Columbia
Recurrences describing the value of optimal solutions to subproblems Dy
Copyright Notice: UBC retains the rights to this document. You may not distribute this document without permission.
CPSC 320: Intermediate Algorithm Design
2016 Summer Term 1
Tutorial 11 Solutions
Pro
CPSC 320: Intermediate Algorithm Design
2016 Summer Term 1
Tutorial 10
Prof. Nick Harvey
University of British Columbia
Reductions between problems, showing that some problems are algorithmically hard
CPSC 320: Intermediate Algorithm Design
2016 Summer Term 1
Tutorial 8
Prof. Nick Harvey
University of British Columbia
Recurrences describing the value of optimal solutions to subproblems Dynamic Prog