Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Fake Hospital with Real Issues The Great Fake Hospital ( TGFH ) wants its doctors to work over the holidays, but wants them to have

Fake Hospital with Real Issues
The Great Fake Hospital (TGFH) wants its doctors to work over the holidays, but wants them
to have a choice in the matter. So, they ask each doctor to let them know on which holidays
they are available to work.
For the next n holidays, TGFH has determined the exact number of doctors they want on duty.
Thus, on holiday i, they have a requirement that exactly pi doctors be present. Note that they
do not want more than pi or less than pi number of doctors, it must be exactly equal to pi. If
the number of doctors present is less than the requirement, they will have to turn away some
patients (and lose money). If the number of doctors present is more than the requirement,
they have to pay extra salaries!
TGFH has a total of k doctors. Each doctor is asked to provide a list of holidays on which
they are willing to work. Thus, doctor j provides a set Lj of days on which they are willing
to work.
TGFH has collected all this information. But they don't know what to do with it. Nobody on
their team ever took a course on Intro. Algorithms
So, they ask you for help!!
You need to take these lists and try to return to each doctor j a list Lj' with the following
properties:
(A)Lj' is a subset of Lj, so that doctor j only works on days that they find acceptable.
(B) If we consider the whole set of lists L1',L2',dotsLk', it causes exactly pi doctors to be
present on day i for i=1,2,dotsn.
(a) Design a polynomial-time algorithm that implements this system.
(5 points)
Specifically, give a polynomial-time algorithm that takes the numbers p1,p2,dots,pn, and
the lists L1,L2,dots,Lk, and does one of the following two things:
Return lists L1',L2',dots,Lk' satisfying conditions (A) and (B); or
Report (correctly) that there is no set of lists L1',L2',dots,Lk' that satisfy both proper-
ties (A) and (B).
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data Concepts, Theories, And Applications

Authors: Shui Yu, Song Guo

1st Edition

3319277634, 9783319277639

More Books

Students also viewed these Databases questions

Question

what can i use instead of cerr

Answered: 1 week ago

Question

Consider some type of redress for the customer, such as a coupon.

Answered: 1 week ago

Question

Sell the quality of your brand or products.

Answered: 1 week ago