1
UNIVERSITY OF WATERLOO
MIDTERM EXAMINATION
Fall TERM 2016
Solutions
Surname:
First Name:
Signature:
Id.#:
Course Number
Course Title
Instructors
Date of Exam
Time Period
Duration
Paper type
Number of pages (including cover)
CO370
Deterministic OR Models
C&O 330 ASSIGNMENT 1
Suggested Solutions Fall, 2016
1. Suppose that is a set of positive integers of size at least 3, and that T is a tree with
vertex set . Let m be the smallest element of that is a leaf (a vertex of degree 1) in T ,
let k be the vertex
C&O 330 ASSIGNMENT 3
Suggested Solutions, Fall 2016
1 (a) Prove that the number of binary trees with n vertices, k of which have up-degree 2, is
equal to
nk
1 n
2n12k ,
n k
n 1 2k
for n 2k + 1, k 0.
(b) Determine the average number of vertices with up-d
C&O 330 ASSIGNMENT 4
Due Friday, November 18 at 2 p.m., in MC 6024
1. If M is a square matrix of rank at most 1, prove that
det (I + M ) = 1 + trace M.
2. Define
XX
=
xi1 . . . xi2m ,
m0
where the inner sum is over strings i1 . . . i2m [n]2m such that i1
C&O 330 ASSIGNMENT 4
Suggested Solutions, Fall 2016
1. If M is a square matrix of rank at most 1, prove that
det (I + M ) = 1 + trace M.
Solution: [5 marks] If M is n n, then the (i, j)-entry of M is of the form ui vj for some
scalars u1 , . . . , um , v1
C&O 330 ASSIGNMENT 6 - Fall 2016
Not to be submitted, solutions will be posted Friday, December 9
1 (a) Let a2n denote the number of permutations on 1, 2, . . . , 2n in which all cycles have
length 2. Prove that
X
x2n
x2
a2n
= exp .
(2n)!
2
n0
(b) Deduce
C&O 330 ASSIGNMENT 5
Suggested Solutions, Fall 2016
1 (a) Use the Maximal Decomposition Theorem to prove that the number of strings with i1
1s, ., in ns and k maximal increasing substrings is given by
1
P
[uk xi11 . . . xinn ]
.
1 m1 u(1 u)m1 em
(b) Deduc
C&O 330 ASSIGNMENT 2 - Fall 2016
Due Friday, October 21 at 2 p.m., in MC 6024
1 (a) Prove that the number of binary trees with n vertices, k of which have up-degree 2, is
equal to
!
!
1 n
nk
2n12k ,
n k n 1 2k
for n 2k + 1, k 0.
(b) Determine the average
C&O 330 ASSIGNMENT 2
Suggested Solutions, Fall 2016
1. (a) Use a partition generating function to prove that every nonnegative integer has a
unique representation of the form
X
fi i!, where 0 fi i, i 1.
i1
(We refer to the fi as the digits in the factoria
CO 250 - Assignment 7
Fall 2016
Page 1
Assignment #7: (Due on Friday, November 4, 11:59 pm)
Recommended reading:
Sections 4.1, 4.2 of the textbook.
Document posted on Learn: Writing the Dual of a Linear Program https:/learn.uwaterloo.
ca/d2l/le/content
C&O 330 ASSIGNMENT 1 - Fall, 2016
Due Friday, September 23 at 2 p.m., in MC 6024
1. Suppose that is a set of positive integers of size at least 3, and that T is a tree with
vertex set . Let m be the smallest element of that is a leaf (a vertex of degree 1
CO 250 - Assignment 10
Fall 2016
Page 1
Assignment #10: (Due on Friday, November 25, 11:59 pm)
Recommended reading: Sections 6.1 and 6.2 of the textbook.
Question 1
(20 points)
2
2
Consider the polyhedron P = cfw_x R2 : Ax b where A =
2
2
2
2
and b = 3
C&O 330 ASSIGNMENT 6
Suggested Solutions, Fall 2016
1 (a) Let a2n denote the number of permutations on 1, 2, . . . , 2n in which all cycles have
length 2. Prove that
X
x2n
x2
a2n
= exp .
(2n)!
2
n0
(b) Deduce from part (a) that
a2n = (2n 1)!,
n 0,
where (
C&O 330 ASSIGNMENT 2 - Fall, 2016
Due Friday, October 7 at 2 p.m., in MC 6024
1. (a) Use a partition generating function to prove that every nonnegative integer has a
unique representation of the form
X
where 0 fi i, i 1.
fi i!,
i1
(We refer to the fi as
CO 250 - Assignment 11
Fall 2016
Page 1
Assignment #11: (Due on Sunday, December 4th, 11:59 pm)
All answers must be justified, unless otherwise stated.
Recommended reading: Sections 7.3, 7.4 and 7.5 of the textbook.
Question 1 (18 points)
NOTE: Parts (e
C&O 330 ASSIGNMENT 5 - Fall 2016
Due Friday, December 2 at 2 p.m., in MC 6024
1 (a) Use the Maximal Decomposition Theorem to prove that the number of strings with i1
1s, ., in ns and k maximal increasing substrings is given by
1
[uk xi11 . . . xinn ]
.
P
CO 331: Assignment 2: Solutions
1. (a) q = 55 = 3125.
(b) The (equivalence classes of) polynomials in Z5 [x] of degree less than 5.
(c) 5.
(d)
i. 2x4 + 2x3 + x + 4.
ii. 3x4 + 2x3 + x (expand and simplify using the identity x5 = x + 3.)
k
iii. Note that a5
C&O 331: Midterm Test
Duration: 1 hour 15 minutes
March 2, 2017
Aids: None
Total marks: 60
1. [15 marks] Let C be a binary (n, k)-code.
(a) How many codewords are in C? (Explain)
There are 2k codewords in C. This is because C is a k-dimensional vector spa
CO 331: Assignment 3 Solutions
1. (a) Since H is a 2 10 matrix of rank 2, C is a (10, 8) code. Since none of the columns of H are zero,
and no column is a multiple of another column, it follows that C has distance at least 3. Finally,
since C has at least
CO250 I NTRODUCTION TO O PTIMIZATION , W INTER 2017
A SSIGNMENT 3 SOLUTIONS
el
Due: Friday, January 27, 2017, at 4:00 p.m.
ao
,L
.T
un
Exercise 1 (25 marks). [Integer Programming]
Milton Industries has a number of employees ei and machines mj . On a given
CO 370 A SSIGNMENT 3 - SOLUTIONS
Material copyrighted, B. Guenin, University of Waterloo. This document is for personal use only. Uploading
to any non UW website (such as course hero) assignments, solutions, or any related material is an academic
offence
CO 370 A SSIGNMENT 4 - SOLUTIONS
Material copyrighted, B. Guenin, University of Waterloo. This document is for personal use only. Uploading
to any non UW website (such as course hero) assignments, solutions, or any related material is an academic
offence
CO 370 A SSIGNMENT 7 - SOLUTIONS
Material copyrighted, B. Guenin, University of Waterloo. This document is for personal use only. Uploading
to any non UW website (such as course hero) assignments, solutions, or any related material is an academic
offence
CO 370 A SSIGNMENT 8 - SOLUTIONS
Material copyrighted, B. Guenin, University of Waterloo. This document is for personal use only. Uploading
to any non UW website (such as course hero) assignments, solutions, or any related material is an academic
offence
CO 370 A SSIGNMENT 5 - SOLUTIONS
Material copyrighted, B. Guenin, University of Waterloo. This document is for personal use only. Uploading
to any non UW website (such as course hero) assignments, solutions, or any related material is an academic
offence
CO 370 A SSIGNMENT 5 - SOLUTIONS
Material copyrighted, B. Guenin, University of Waterloo. This document is for personal use only. Uploading
to any non UW website (such as course hero) assignments, solutions, or any related material is an academic
offence
CO 327 - Spring 2017 - Assignment 2
Due: Wednesday May 31 at the BEGINNING of class
1. Example of a Multiperiod Problem: Investing
A person has $21,000 and plans to invest it over the next 3 years. Their financial advisor has suggested three investments t
CO 327 - Spring 2017 - Assignment 2
Due: Wednesday May 31 at the BEGINNING of class
1. Example of a Multiperiod Problem: Investing
A person has $21,000 and plans to invest it over the next 3 years. Their financial advisor has suggested three investments t