1
$\begingroup$

A nurse is tending 100 patients, ranked from 1 to 100, where patient 1 is the important and patient 100 is the least important. A patient's health will go down each day that the nurse doesn't see him/her or if the nurse saw a patient with a lower ranking(a bigger number) since the last time she visited him/her. Each day, the nurse sees the highest ranked who's health is going down. For example, the nurse will see patient 1 on the first day, then patient 2 on the second day, then patient 1 on the third day, then patient 3 on the fourth day, then patient 1 on the fifth day, etc.

Describe the set of patients that will wake on the $n$th day feeling worse then the day before.


*Clarification

The nurse will very likely get sick, but let's assume he/she does not. Whenever the nurse sees a patient, the patient will feel better, until the nurse sees someone that is ranked lower(in this case, a rank with a higher number) then him/her. The ranking will not change for the patients. The ranking is just a representation of how important each patient is.

  • 0
    Then on third day nurse see 1 but not 2 so 2 goes down so why is she seeing 3 on the fourth day ?2017-02-20
  • 0
    @zwim The nurse is seeing patient 1 on the third day because she saw patient 2 on the second day and patient 1 is feeling worse. Patient 2's health will not decline until the nurse sees someone ranked lower than hiim/her.2017-02-20
  • 0
    I had some difficulty with the words "each day that the nurse doesn't see him/her." I thought this meant the health of 99 patients goes down every day since the nurse sees only one. (The "higher number" clause seemed redundant.) But that would mean each time after seeing patient 1 the nurse must see patient 2. Now I think the condition actually is "if the nurse _has never yet seen the patient_ or if the nurse saw a higher-numbered patient that day." Is that right?2017-02-20
  • 0
    @DavidK Correct. I understand that my choice of words were confusing.2017-02-20
  • 0
    This is a question on the MathCamp qualifying quiz. https://www.mathcamp.org/prospectiveapplicants/quiz/index.php2017-02-21
  • 0
    This question is a slightly changed version of problem 1 from the Canada/USA Mathcamp 2017 qualifying quiz (see [this pdf](https://www.mathcamp.org/2017/qquiz.pdf)). The deadline for the application is [10 March 2017](https://www.mathcamp.org/prospectiveapplicants/deadlines.php), and this question will remain locked with answers temporarily deleted until after this date.2017-02-21

3 Answers 3

2

I will try to think about this problem in terms of an OK list:

On day 0, no one is on the OK list.

When a patient is seen, they go on the OK list.

When patient $n$ is seen, anyone with rank $

The nurse will see the most'important' (i.e. With lowest rank number) patient not on the OK list.

A patient feels worse on day $n$ when on day $n-1$ they were not on the OK list, and they were not seen on day $n-1$.

The nurse visits the patients in this order:

1,2,1,3,1,2,1,4,1,2,1,3,1,2,1,5,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1,6,1,2,1,...

This means that patient 1 will feel worse on days 1,3,5,7,...

Patient 2 will feel worse on days 1,2,5,6,9,10,...

Patient 3 will feel worse on days 1,2,3,4,9,10,11,12,17,18,19,20,...

In general, patient $k$ will feel worse worse on day $n$ iff $\lfloor \frac{n-1}{2^{k-1}} \rfloor$ is even.

To see this function at work, I'll evaluate the function for different $n$ and $k$, and output 1 if the function indicates that the patient feels worse:

\begin{array}{|c|c|c|c|C|} \hline n (day) & (Patient) k= 1 & 2&3&4\\ \hline 1&1&1&1&1\\ \hline 2&0&1&1&1\\ \hline 3&1&0&1&1\\ \hline 4&0&0&1&1\\ \hline 5&1&1&0&1\\ \hline 6&0&1&0&1\\ \hline \end{array}

  • 0
    Actually, think about it. The nurse sees patient 2 on the sixth day. All the other patients are feeling worse except patient 2 and patient 3, because the nurse already saw patient 3 and patient 2 is ranked higher than patient 3. So 98 patients feel worse on day 6.2017-02-20
  • 0
    Also, could you describe which patients felt worse on day $n$?2017-02-20
  • 0
    @EmilyDush and here I thought the rules on when a patient feels worse were clear to me ... I guess still not ...2017-02-20
  • 0
    @EmilyDush On day 6, why does patient 1 feel worse, given that the nurse just saw patient 1 the day before?2017-02-20
  • 0
    Your reasoning is very close. Now think about this. On which day does the nurse see patient $n$ for the first time?2017-02-20
  • 0
    that would be on day $1 + \lfloor log \: n \rfloor$ (log base 2 that is)2017-02-20
  • 0
    Right, I got a bit mixed up. That was not a good example. Instead think about day 4, when the nurse sees patient 3 for the first time. Only 98 was feeling worse that day.2017-02-20
  • 0
    How about the nurse seeing patient $n$ on day $2^{n-1}$ for the first time?2017-02-20
  • 0
    @EmilyDush So 3 does not feel worse on day 4 because *on that very day* 3 gets helped, is that it? So who else does not feel worse? I am still not clear on the rules ... Sorry!2017-02-20
  • 0
    @EmilyDush Yeah, that's better, my formula looked at how many patients were seen on day $n$ or before.2017-02-20
  • 0
    Actually, patient 3 does feel worse when he/she wakes up on day 4. Let's only look at the results when the patients wake up.2017-02-20
  • 0
    @EmilyDush Hmmm, ok, can we maybe start at day 1 again and see who feels worse then and why, and then move to day 2 and do the same thing. I am still very confused about the basic rules here ... Or maybe day 1 doesn,t matter ... But on the morning of day 2 ... Who feels worse and why? Everyone except patient 1 because 1 just got seen by the nurse the day before?2017-02-20
  • 0
    That sounds good. On day 1, all the patients feel worse because they never saw the nurse before. On day 2, 99 patients feel worse because only patient 1 saw the nurse. On day 3, 99 patients feel worse because the nurse saw patient 2 and patient 1 is ranked higher. On day 4, 98 patients are feeling worse because patient 1 and 2 are all sort out. On day 5, 99 patients feel worse again because the nurse saw patient 3 and patients 1 and 2 are ranked higher. On day 6, 98 patients feel worse because patient 2 still has not seen the nurse. On day 7, 98 patients feel worse because of patient 1.2017-02-20
  • 0
    Comments can only hold so much characters... Anyways, on day 8, only 97 people wake up feeling worse because patients 1, 2, and 3 are all sort out.2017-02-20
  • 0
    @EmilyDush OK, I think I am starting to get it ... Maybe it's best to keep an 'feels ok' list. So every patient at the start is not ok. Every time a patient gets seen that patient gets on the OK list. But if a patient of rank $n$ gets seen, then all patients with rank $2017-02-20
  • 0
    @EmilyDush OK, I worked with the OK list idea and I think I have a function for who feels worse on what day in my answer now.2017-02-20
  • 0
    Test some examples in, does it match the ones I provided?2017-02-20
  • 0
    @EmilyDush I evaluated it for the first few values and the 0's in the table match the people you said were OK on those days.2017-02-20
  • 0
    Okay, so what did you get?2017-02-20
  • 0
    @EmilyDush I added a table in my answer. It's only the beginning of course, but the pattern of 1's and 0's I got is exactly what it should be, so I am confident the equation works.2017-02-20
2

Let's play Hanoi with the nurse.

  • She has to tends for 100 patients [she has to move 100 disks]
  • A patient health goes down if not visited [unmoved disks are wainting to be moved]
  • She takes care of the highest patient whose health degraded first [she moves the bigger disk that can move]
  • a patient cannot move until a lower patient get treated [a disk can move if smaller disks above it are removed]

So according to this woolly analogy, the sequence follows a Sierpinski pattern.

Disk 1 moves every 2 days

Disk 2 moves every 4 days

Disk 4 moves every 8 days

...

Disk N moves every 2^N days

Moving disk : $1213121412131215121312141213121612131214121312151213121412131217...$

Sequence A001511

I don't know if it is the good answer or if I smoked the carpet, but I find this funny.

  • 0
    Great observation! Can you describe the patients that feel worse on day $n$?2017-02-20
0

The examples given for the order in which the nurse visits patients follow the pattern that the nurse visits patient $k$ on day $n$ if $n$ is an odd multiple of $2^{k-1},$ that is, if the rightmost $1$ in the binary representation of $n$ is in the place with place-value $2^{k-1}.$ This suggests (but does not prove) that all visits will follow a pattern based on binary representations of numbers.

The rules for who feels better or worse each day seem a little imprecise, so I'll try to make them precise. Let a patient be "declining on day $n$" if they wake up on day $n$ feeling worse than the day before, and "stable on day $n$" if they are not declining on day $n.$ By assumption, all patients are declining on day $1.$ In general, on day $n$ the nurse sees the lowest-numbered patient who is declining on day $n.$ If the nurse sees patient number $k$ on day $n,$ then patient $k$ is stable on day $n+1$; furthermore, patients numbered higher than $k$ are stable on day $n+1$ if and only if they were stable on day $n.$ But all patients are aware of their ranks of "importance" from $1$ to $100$ and all are hypochondriacs with a sense of entitlement over all "less important" (higher-numbered) patients, so on the day after the nurse visits patient $k,$ patients $1$ through $k-1$ (inclusive) all are declining. (They wake up complaining that they feel worse than the day before.)

To prove a correspondence between the nurses visits and the digits of binary numbers--or better still, to prove a correspondence between the set of who feels worse each morning than they did the day before and the digits of binary numbers, begin by letting $b_{99}b_{98}b_{97}\ldots b_3b_2b_1b_0$ be a binary numeral of up to $100$ digits, with all digits to the left of the most significant non-zero digit set to zero. That is, we write the decimal number $8$ as $000\ldots01000$ instead of just $1000.$

Then patient $k$ is declining on the $n$th day if and only if the binary representation of $n-1$ has a zero in the place for place value $2^{k-1}.$

We can prove this by induction. As a base case, for $n = 1$ the binary representation of $n-1$ has all zeros. But on the first day (day $n = 1$) all patients are declining, hence the statement is true for $n = 1.$

Now suppose the statement is true for some value of $n \geq 1,$ that is, the patients who are declining on the $n$th day are exactly the ones for which the corresponding digits of the binary representation of $n-1$ are $0.$ On the $n$th day, the nurse will see the most important patient who is declining on that day; that is, a patient whose digit in the binary representation of $n-1$ is $0,$ while the digits corresponding to all lower-numbered patients are all $1.$ Then on the $n+1$st day the patient the nurse saw on the $n$th day will be stable (digit $1$) and all lower-numbered patients will be declining (digit $0$). All higher-numbered patients will have the same status on the $n+1$st day as on the $n$th day. But of course when we add $1$ to the binary representation of $n-1,$ the rightmost $0$ in $n-1$ changes to $1,$ all digits to the right of it change from $1$ to $0,$ and all digits to the left if it are unchanged. Hence the statement is true for $n+1,$ that is, the patients who are declining on the $n+1$st day are exactly the ones for whom the corresponding digits of the binary representation of $n$ are $0.$

Notice that this exactly matches Bram28's answer, since the digit with place value $2^{k-1}$ in the binary representation of $n-1$ is $0$ if and only if $\left\lfloor \frac{n-1}{2^{k-1}} \right\rfloor$ is even. Moreover, see what happens if you reverse the columns of the table (so $k=1$ is rightmost) and invert all the digits (change $0$ to $1$ and simultaneously change $1$ to $0,$ since Bram28 uses $1$ to signify declining whereas I use $0$): you get a table in which the $n$th row is the binary representation of $n-1.$

The correspondence with the Towers of Hanoi mentioned in zwim's answer is that the identity of the moving disk in the $n$th move of the Towers of Hanoi relates in the same way to the binary representation of $n$ as does the identity of the patient whom the nurse sees on the $n$th day.