Question 3: (30 points) Sleepless Code
The software cooperative "The Sleepless Code"
in downtown Kingston is about to introduce the following
rules for promotion within the cooperative:
Let n be the number of workers.
Rule 1. Every worker starts with rank r=0.
Rule 2. Every worker with rank r=0 can promote herself to rank r=1.
Rule 3. To promote herself from rank r to rank r+1 an worker shall:
a) first, record herself as having rank r+1, and then
b) record herself as the last worker to have reached rank r+1.
Rule 4. Every worker in ranks 0<r<n can promote herself to rank r+1 iff
a) she is not last worker to have reached rank r, or
b) all other workers have ranks below hers.
Rule 5. Workers with rank n are boss; after a finite amount of time
they have to demote themselves back to rank 0.
Unfortunately, the workers at the cooperative are not entirely sure
if these rules ensure a crucial property they have come to value
over the years:
- Single-Boss property: "At any given time, there is never
more than one boss!"
Note that the workers are quite ok with occasionally not having
a boss at all.
Hand in:
- Part a): Brief explanation
- Parts b), c), and d):
Listing of your BIR code (together w/ electronic submission by
email (see below))
and "yes/no" answers for Parts c) and d)
- Part e): "yes/no" answer together with brief, intuitive
explanation why proproty still holds (if your answer is "yes"),
or counter example showing violation (if your answer is "no").