Question: Problem 1 . Your coding club is organizing a long hackathon in a computer lab and you want to organize it in such a way

Problem 1. Your coding club is organizing a long hackathon in a computer lab and you
want to organize it in such a way that for every point during a time window [t0,tend),
at least one person is hacking in the lab.
Say you have n coders {p1,p2,dotspn}, and each person's availability to help out is
given by a continuous time interval, and that if they are going to code at all, they will
be coding for that entire interval. Formally, coder pi is available to help out in the time
interval [si,fi), and if they work at all, they will be in the lab from time si to time fi,
where iin{1,2,dots,n}. Assume that you already know that you have enough volunteers
so that at each point in the time window [t0,tend) there is at least one person able to
code. You therefore decide to solve the following coder selection problem: choose a
minimum number of volunteer coders to participate in the hackathon, to ensure there
will always be at least one person in the lab during the whole time window [t0,tend).
a)(10 points) Let P0 be the set of coders that are able to code in a time window that
includes t0. Written formally, this means
P0={pi:t0in[si,fi)}
Let p**inP0 be the person in this group with the latest finish time f** among all
members of P0. Prove that there exists an optimal solution to the coder selection
problem that uses p** as one of the coders.
b)(10 points) Algorithm 1 is pseudocode for a greedy procedure for choosing coders,
which takes in start times and finish times for the n coders and the time window
that needs to be "covered". You can assume that for each time t in [t0,tend], there
is at least one coder whose shift "covers" that time t.
This code continuously updates C,t, and Pt. Explain what each of these represents.
Then prove whether this code will produce the optimal solution to the coder selection
problem.
Problem 1 . Your coding club is organizing a long

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!