16
$\begingroup$

This is a puzzle that I thought up whilst taking a course of meds. I currently haven’t solved it, and would be curious to know if anyone has a solution for it. Here goes:

Scenario: John has a box of 15 tablets. He needs to take half a tablet per day for 30 days. Each day he takes the box and removes a tablet randomly (i.e. the chance of him removing a whole tablet is equal to him removing a half tablet when the number of whole- and half-tablets are equal. E.g. if there were 5 whole and 1 half tablet in the box, then p(half) = 1/6). If the tablet he removes is a whole one, he breaks it in half, eats one half, and returns the other half back to the box. If he removes a half tablet, he just consumes it. This continues for 30 days.

Question: On which day (on average, assuming infinite re-runs of the process) is he first going to be equally/more likely to remove a half tablet than a whole one?

I already have given this some thought, but even counting the number of permutations is impossible for me extrapolation from a 1 to 2 to 3 to 4 tablet simplification of the 15 tablet scenario above.

Any ideas/solutions welcome. Preferably the solutions would be hidden in a spoiler box, as for the time being I’m still trying to work it out myself.

Many thanks!

$\endgroup$
  • 3
    $\begingroup$ Welcome to Puzzling! (Take the Tour!) I'm glad you’re interested in contributing this question here but I fear it likely falls on the wrong side of our policy on math problems vs puzzles — see Are math-textbook-style problems on topic? for some discussion. It’s an interesting question to want an answer to, but probably not enough on-topic to be here. $\endgroup$ – Rubio Aug 12 at 0:18
  • 4
    $\begingroup$ @Rubio IMO this is on the fence, but I think it should be ok. It's definitely not a textbook question for sure, and I do find it quite an interesting problem. So, I personally have no problem with this question, but I'd like to know what everyone else thinks. $\endgroup$ – greenturtle3141 Aug 12 at 2:12
  • 1
    $\begingroup$ @greenturtle3141 The solution path is mechanical, the answer is pretty much what I'd expect, and there's no particular magic about the answer—those are pretty much the hallmarks of "problem". Having said that, I (like you) am on the fence enough that I feel I need to leave it up to the community to decide. :) $\endgroup$ – Rubio Aug 12 at 3:39
  • $\begingroup$ As a person who submitted an answer, I have to agree that this didn't feel like a puzzle. I had fun finding an answer, but it was more of a coding problem than a puzzle. I think there might be a more elegant solution that involves thinking about the problem in forward time and backward time, but even then it would probably be a math problem. $\endgroup$ – hdsdv Aug 12 at 9:24
  • 1
    $\begingroup$ "removes a tablet perfectly randomly": Are we to assume that it's as likely that he'll pick a half as a whole, or that it's half as likely (because there's only one end to grasp but two ends of the whole tablet making the latter easier to choose)? Or should we work that out for ourselves as part of the solution? $\endgroup$ – msh210 Aug 12 at 9:48
10
$\begingroup$

It turns out that on the 14th (edited from 13th - I was using zero index before) day, you are more likely to pick a half pill than a whole pill. On that day, the expected number of whole pills is ~5.597 and the expected number of half pills is ~5.807.

To do this,

I just wrote a Python program that enumerates all the possible outcomes each day, along with the probability that each outcome would occur. To compute tomorrow's possible outcomes, you take each possible situation S from today and check each "branch" that can happen - selecting a whole or half pill. Each branch has a probability of occurring (based on how many of each are in S), and a resulting situation (one less half pill, or one less whole pill and one more half pill). You multiply the probability of being in S by the probability of taking the branch, and add that to tomorrow's probability for S', the new situation that we just created.

Finally,

For each day, you can compute the expected number of whole pills (just multiply the number of whole pills in each situation by the probability of the situation). The total expected whole pills for the day will be the sum of all of these values. The same can be done for the half pills (and if you want to check your work, 2*expected_whole + expected_half should equal (30 - day), since that's how many total half-pills you still have left).

I can give you the Python code if you want. Not sure it can be spoilered (I've never learned how to have multi-line spoilers).

Python Code

$\endgroup$
  • 3
    $\begingroup$ Rather than post code here, you should probably post it at (say) tio.run and link to it here - that way people can run it without having to download it and/or a python interpreter. $\endgroup$ – Rubio Aug 12 at 0:06
  • 2
    $\begingroup$ Thanks for the suggestion! Done. $\endgroup$ – hdsdv Aug 12 at 0:26
  • $\begingroup$ Re "Each branch has a probability of occurring": You may want to see my comment on the question. $\endgroup$ – msh210 Aug 12 at 9:49
  • $\begingroup$ I think if John were half as likely to choose a half pill than a whole pill, that would have been specified. It seems like a pretty important detail to leave out when everything else was specified unambiguously. This wasn't presented as a "find the small detail that I intentionally left out" puzzle. $\endgroup$ – hdsdv Aug 12 at 10:15
  • 1
    $\begingroup$ @MSH210 et al. Thank you for your responses. I’m a newbie here, I’m sorry if this doesn’t comply to your definition of a puzzle. Thanks for your responses in any case. Regarding “remove a tablet perfectly randomly”: Perhaps I should have expressed it differently. I imagined that John tips a (half) tablet out of the box, and the chance that it is a whole one reflects the proportion of whole tablets in the box (so for example if there are 6 whole and 2 half tablets in the box, p(whole)=0.75, p(half)=0.25. I hope that makes ig clear. $\endgroup$ – David Aug 12 at 20:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.