ECE 606, Fall 2019, Assignment 6: Zhijie Wang, Student ID Number: 20856733 Zhijie - Wang@uwaterloo - Ca October 22, 2019
ECE 606, Fall 2019, Assignment 6: Zhijie Wang, Student ID Number: 20856733 Zhijie - Wang@uwaterloo - Ca October 22, 2019
[email protected]
October 22, 2019
w1n
un un−1 ...
w(n−1)n
1
1 1 1
u1 u2 ... un
−1
3. Proof. Here we consider about an output, G = {g1 , g2 , . . . , gk } that this greedy choice result in, vs. an
optimal set of meetings, T = {t1 , t2 , . . . , tm }. Suppose we represent the start time of a meeting as a
function, s(·), and finish time as a function, f (·). We assume, without any loss of generality, that the
meetings in the two sets are ordered by latest start time.
Firstly, we need to prove that for every i = 1, . . . k, s(gi ) ≥ s(ti ). By induction on i. For the base case,
consider i = 1. The greedy choice is to pick a meeting with the latest start time. This guarantees that
s(g1 ) ≥ s(t1 ). For the step, assume that the assertion is true for i = 1, . . . , p − 1. For i = p, we know that
s(gp−1 ) ≥ s(tp−1 ) ≥ f (tp ). Thus, the meeting tp dose not conflict with gp−1 , and therefore, is available to
be chosen after gp−1 is chosen. Thus, s(gp ) ≥ s(tp ) because we choose the meeting with the latest start
time.
Hence, we need to prove k = m. Assume otherwise, for the purpose of contraction, and that m > k.
Then, there exists a meeting tk+1 in T . But by the claim above, s(gk ) ≥ s(tk ), thus, the meeting tk+1
dose not conflict with gk , and is available to be chosen after gk is chosen, which contradicts the claim that
no more meetings are left that can be chosen after gk is chosen.
4. a6p4.py