CSCI 170 Homework #2 Solutions
1. Suppose you have two sets A and B, each with n elements consisting of real numbers in no
particular order. Let C be the Cartesian Product of sets A and B.
(a) Devise an algorithm which takes as input A, B, and C, and outp
CSCI 170 Homework #5 Solutions
1. Write your name, student ID Number, which lecture you attend (MW morning, MW afternoon, or TTh afternoon), and which discussion section you attend (Mon
4pm, Mon 6pm, Tues, or Wed). Multi-page submissions must be stapled.
CSCI 170 Homework #2 Solutions
1. Write your name, student ID number, lecture time, and discussion time. Multi-page submissions must be stapled. Failure to complete any of these items will result in delays in the
grading and return of your homework assign
CSCI 170 Homework #1
Due Date: Monday, September 8th
You may submit in class on the due date, or you may submit in the dropbox (Box 7, in the lobby
of PHE. Upon entering PHE, the boxes are tucked just out of sight by the window on the left).
1. Write your
CSCI 170 Homework #1 Solutions
1. Write your name, student ID number, lecture time, and discussion time. Multi-page submissions must be stapled. Failure to complete any of these items will result in delays in the
grading and return of your homework assign
CSCI 170 Homework #8 Solutions
1. Write your name, student ID Number, which lecture you attend (MW morning, MW afternoon, or TTh afternoon), and which discussion section you attend (Mon
4pm, Mon 6pm, Tues, or Wed). Multi-page submissions must be stapled.
CSCI 170 Homework #5 Solutions
1. Write your name, student ID number, lecture time, and discussion time. Multi-page submissions must be stapled.
2. A military has set up 4 ground stations G1 , G2 , G3 and G4 along the equator, with the
purpose of communic
CSCI 170 Homework #6 Solutions
1. Write your name, student ID Number, which lecture you attend (MW morning, MW afternoon, or TTh afternoon), and which discussion section you attend (Mon
4pm, Mon 6pm, Tues, or Wed). Multi-page submissions must be stapled.
CSCI 170 Homework #7 Solutions
1. Write your name, student ID Number, which lecture you attend (MW morning, MW afternoon, or TTh afternoon), and which discussion section you attend (Mon
4pm, Mon 6pm, Tues, or Wed). Multi-page submissions must be stapled.
CSCI 170 Homework #1
Due Date: Tuesday, January 28th, 2:30pm
Submit in class or the dropbox (Box 11, rst oor of SAL, opposite the Mens bathrooms).
1. Write your name, student ID Number, which lecture you attend (MW morning, MW afternoon, or TTh afternoon)
CSCI 170 Homework #1 Solutions
1. Consider a sequence indicating the cost to produce a constellation of satellites. Let Cn
denote the cost to produce the nth satellite. Assumedly each successive unit will cost less
as we improve eciency, so this will be r
CSCI 170 Spring 2015 Syllabus
Course Logistics
Instructor
Aaron Cote
Email
aaroncot@usc.edu
Oce
SAL 340
Michael Shindler
shindler@usc.edu
SAL 204
TA
Email
Anthony Shao
ashao@smad.com
Lecture
1
2
3
Instructor
Michael
Michael
Aaron
Discussion
1
2
3
Tian Zhu
CSCI 170 Homework #3 (Solutions)
1. Write your name, student ID number, lecture time, and discussion time. Multi-page submissions must be stapled.
2. There is a missile defense system controlled by its Security Council. The Security Council
consists of fo
CSCI 170 Homework #4 (Solutions)
1. Write your name, student ID number, lecture time, and discussion time. Multi-page submissions must be stapled.
2. The runtime for MergeSort can be specied by the following recurrence relation: f (n) =
2f ( n ) + n, f (1
CSCI 170 Homework #6 Solutions
1. Write your name, student ID number, lecture time, and discussion time. Multi-page submissions must be stapled.
2. For both of the follow graphs, indicate the following information: (i) whether it has an Euler
Circuit, (ii
CSCI 170 Homework #7 Solutions
1. Write your name, student ID number, lecture time, and discussion time. Multi-page submissions must be stapled.
2. Consider an undirected graph on a 1d cartesian coordinate system (that is, a line). There are
nodes at each
CSCI 170 Homework #8 Solutions
1. Write your name, student ID number, lecture time, and discussion time. Multi-page submissions must be stapled.
2. There are 8 dierent colored marbles in a bag, all the same size. The probability of choosing
the red marble
CSCI 170 Homework #9 Solutions
Due Date: Thursday, April 30th, 2:30pm
1. Write your name, student ID number, lecture time, and discussion time. Multi-page submissions must be stapled.
2. Please ll out the online evaluations for this course before submitti
CSCI 170 Homework #7
Due Date: Wednesday, July 6th, 1pm
You may submit in class on the due date, or at any time in the homework dropbox (Box 9, lobby
of PHE. Upon entering PHE, the boxes are tucked just out of sight by the window on the left).
1. Write yo
Discrete
Optimization
Local Search: Part VIII
Thursday, 13 June 13
Goal of the Lecture
Local search
meta-heuristics
multi-start search
simulated annealing
tabu search
2
Thursday, 13 June 13
Escaping Local Minima
3
Thursday, 13 June 13
Escaping Local
Discrete
Optimization
Local Search: Part IX
Thursday, 13 June 13
Goal of the Lecture
Local search
tabu-search
2
Thursday, 13 June 13
Tabu Search
3
Thursday, 13 June 13
Tabu Search
3
Thursday, 13 June 13
Tabu Search
3
Thursday, 13 June 13
Tabu Search
3
T
Discrete
Optimization
Local Search: Part VI
Goals of the lecture
Escaping local minima"
Connectivity
2
If you want guarantees, buy a toaster (C. Eastwood)
Local minima"
a configuration c is a local minima with
respect to neighborhood N if "
"
"
8 n 2
Library Research in Archaeology
Anthropological archaeology is a social science that draws on a number of other disciplines in
both the sciences and humanities in order to achieve its goals. As such, sources regarding
archaeological cultures can be found
CSCI 170 Homework #6
Due Date: Wednesday, June 29th, 1pm
You may submit in class on the due date, or at any time in the homework dropbox (Box 9, lobby
of PHE. Upon entering PHE, the boxes are tucked just out of sight by the window on the left).
1. Write y
Discrete Probability
An experiment is a procedure that yields one of a set of possible outcomes (such as
ipping a coin).
The sample space is the set of possible outcomes for the experiment (such as heads,
tails, on edge).
An event is a subset of the sa
Bayes Theorem and Expectations
There are two boxes. The rst contains 2 green balls and 7 red balls. The second contains 4
green balls and 3 red balls. You choose a box at random, then you choose a ball at random.
You draw out a red ball. What is the proba
CSCI 170: Program Correctness
Associated Reading: Textbook 5.5
Warm-Up : Recall the recursive factorial function from last lecture:
factorial(n)
if n = 0 then
return 1
return n factorial(n 1)
Re-write this as an iterative function.
Loop Invariants
If you
The Well-Ordering Property
The Well-Ordering Property states that every nonempty set of nonnegative integers has
a smallest element.
Well. duh? This simple property can be used to prove some surprising things.
For example, we used the Well-Ordering Proper
Graphs
An undirected graph is specified by G = (V, E).
V = the set of vertices/nodes. E = edges between pairs of
nodes.
By convention, n = |V |, m = |E|.
Nodes u, v are neighbors, or adjacent if they are connected by
an edge.
N(A) - set of nodes whic
CSCI 170 Spring 2017 Homework #1
Due Date: January 23, 2017 at 1:30 PM
You may submit in class on the due date, or at any time in the homework dropbox (Box 4, lobby of PHE.
Upon entering PHE, the boxes are tucked just out of sight by the window on the lef
CSCI 170 Homework #2
Due Date: Wednesday February 1, 2017 at 1:20 PM
You may submit in lecture on the due date, or at any time in the homework dropbox (Box 4, lobby of
PHE. Upon entering PHE, the boxes are tucked just out of sight by the window on the lef