6
$\begingroup$

While walking through the forest, on the way to confess to your crush, you come upon an old house. Outside of this house is an old, damaged Brazen Head, with a hastily wired coin-slot appended beside it. You'd like to know how your crush feels before asking them, so you take out your coin-purse

But, before you can sacrifice your hard-earned pocket change to the Head, you notice a rather spirited discussion scrawled on the wall of the house. Reading this, you learn:

  • Due to damage, the Head needs about a pint of its nectar to answer one question, which is unfortunate as the leaky tank holds only 3 pints in total. Overfilling the tank will make it spill out and damage the machine (and your shoes)

  • The corroded pipes and poorly-made pump cause the Head to act differently with different fuel levels

    • When filled to 3 pints it manages to give a truthful answer to yes-no questions, otherwise keeping silent

    • When it's down to 2 pints it will only lie and try to answer unanswerable questions

    • When on its last pint it'll give out random answers

    • Once it's empty it won't say anything at all

  • The Head is much quicker when a question is repeated than when a new question is loaded in

  • The tins piled beside the Head are pint-sized and contain nectar to fuel the Head. They are also free to use, but rather short in supply

  • The Head shouldn't be refilled while it's working, but between questions it's perfectly safe

You can't tell how much fuel it already has, and you don't want to waste money on unnecessary questions. How many questions must you ask (in the worst case) in order to fill up the Brazen Head to 3 pints without overfilling it? A bonus if you can also use the least fuel and ask the fewest distinct questions

$\endgroup$
2
  • $\begingroup$ Is silence a "random answer"? $\endgroup$ Sep 16, 2022 at 1:22
  • $\begingroup$ @AxiomaticSystem No $\endgroup$ Sep 16, 2022 at 8:51

1 Answer 1

10
$\begingroup$

We can do it with 1 question asked twice at most.

Let F be the current quantity of fuel. F could be 0,1,2 or 3 presently.

Ask our 1 Question: 'Will you answer this question randomly?' (Equivalent to 'is F == 1?')
If F is 0, we get no answer. Add 3 tins of fuel -> Finished.
If F is 1, we get a random answer (I assume yes/no, if it answers Pineapple Decagons that makes the puzzle even easier)
If F is 2, we get the answer Yes (a lie)
If F is 3, we get the answer No (truth)

If the Answer to our first Question is Yes, we know F was 1 or 2, now 0 or 1. We can safely add 2 tins of fuel, now F is 2 or 3.
Ask the same Q again: 'Will you answer this question randomly?'
If F == 2, we get the answer Yes (lie). F goes down to 1, add 2 tins -> Finished.
If F == 3, we get the answer No (truth). F goes down to 2, add 1 tin -> Finished

If our answer to the first Question was no, we know F was 1 or 3, now 0 or 2.
Ask the same question 'Will you answer randomly?'
If F == 0, we get No reply -> Add 3 -> Finished.
If F is 2, we get the answer Yes (lie) -> F goes down to 1, Add 2 more -> Finished.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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