-1
$\begingroup$

King Bubba III has 1024 potions, 1022 of which are just water while two of them are magical gives him superpowers (the special potions are colorless, odorless, etc.). Bubba, who is an intellectual, has a machine that tells him whether a particular sample of liquid is magical or not. However, he has calculated that he can mix the potions and still use the machine - if he takes a set of potions and inputs it into his machine, the machine will return positive if there is magic in any of the bottles and negative if none of the bottles are magic. There is, however, two limitations on the machine - firstly, because mixing too many potions dilutes magic, he can mix at most 32 potions an receive an accurate result from the machine, and secondly, the machine will return all the results at once, in 7 days (which means Bubba cannot base future tests off of the result of past tests). What is the minimal amount, up to a factor of 2, of times he needs to use the machine and identify both magical potions?

I think the answer actually should just be $1024$, because I've tested many other strategies you can use but still we must consider the least optimal case, which makes reducing this number significantly rather difficult. (there is a slight optimization you can use to reduce the number of uses to $1023$ but I really dont care

I believe the a similar, well-known variant of this problem has been posted here and here, but I'm not sure how the ideas can be cross applied - there are extra restrictions in this problem.

$\endgroup$
3
  • $\begingroup$ What you are doing is cheating. You are cheating on problem 5b of the Mathcamp qualifying quiz whose deadline is March 18th. This goes against Math StackExchange's contest problem policy, and also against Mathcamp's application policy. I have flagged your question for the moderators here. $\endgroup$ Commented Mar 15, 2021 at 16:52
  • $\begingroup$ @MishaLavrov He keeps cheating, my god, look at his most recent question, it's a cheat as well. math.stackexchange.com/questions/4079070/…. Is there any way to suspend him? $\endgroup$ Commented Mar 27, 2021 at 18:09
  • $\begingroup$ @SomeGuy If the questions are flagged for moderators every time, then the moderators will do whatever seems necessary along those lines. $\endgroup$ Commented Mar 27, 2021 at 21:20

2 Answers 2

3
$\begingroup$

The significance of the numbers $1024$ and $32$ is important here. Imagine arranging all of the bottles in a $32x32$ square. Make a mix for every row, and make a mix for every column. That's 64 tests. That's almost enough information right there--if there were only one magic bottle, it would be enough. If you get rows $a$ and $b$ to test positive, and columns $c$ and $d$ to test positive, then there are only two possible arrangements: $(a,c)$ and $(b,d)$, or $(a,d)$ and $(b,c)$. If I understand the problem wording right, then 64 is the answer.

If not, the question now is how to distinguish them without knowing in advance which ones to test. Imagine making a mix of every down diagonal, which is 63 more tests. That would enable you to distinguish which of the two options applies. There is probably an even more efficient way to do it, but that's what I've got so far.

$\endgroup$
3
  • 2
    $\begingroup$ You can improve this to $96$ total tests if you let the diagonals wrap around. $\endgroup$ Commented Mar 14, 2021 at 5:16
  • $\begingroup$ Thank you, I knew I was missing something! $\endgroup$ Commented Mar 14, 2021 at 5:20
  • $\begingroup$ wow this is actually genius, but the problem also asks to show that 48 doesn't work. does anyone have an idea for this? i think this is the main gist of the problem, actually. $\endgroup$ Commented Mar 14, 2021 at 6:49
1
$\begingroup$

We can prove that at least $57$ tests are necessary, using an information-theoretic argument. Assuming the two bottles were chosen uniformly at random, the probability $p$ of a any particular test returning negative would be $$ p={1024-32 \choose 2}\Big/{1024 \choose 2} $$ It follows that the entropy of a single test is $H(p)=-p\log p-(1-p)\log (1-p)\approx 0.333579$ (Wolfram|Alpha calculation). This means that every test gives roughly one third of a bit of information on average. Since there are $\log_2 \binom{1024}2\approx 19$ bits of uncertainty, it should take at least $19/ 0.333579\approx 57$ tests to eliminate all uncertainty.

We can make this reasoning precise. Let $E_1,E_2,\dots,E_n$ denote the results of the $n$ tests, let $X$ denote the unknown pair of bottles (chosen uniformly at random, and suppose there exists a function $f$ for which $$ X=f(E_1,\dots,E_n) $$ Then these two entropy inequalities are what you need to make my reasoning precise:

  • For a random variable (or vector) $Y$, and a deterministic function $f$, $H(f(Y))\le H(Y)$.

  • For a joint distribution $(E_1,\dots,E_n)$, $H((E_1,\dots,E_n))\le H(E_1)+\dots +H(E_n)$.

This implies that $H(X)\le n H(E_1)$, so you need at least $H(X)/H(E_1)$ tests.

$\endgroup$
2
  • $\begingroup$ Apologies for being annoying, but I don't quite have the knowledge of information theory to understand your answer. I do, however, like the idea of maybe looking at expected value, which might lead to a more elementary solution? Your time and dedication is, of course, appreciated in any case. $\endgroup$ Commented Mar 14, 2021 at 19:12
  • $\begingroup$ I am afraid this is the only way I can imagine how to prove it. $\endgroup$ Commented Mar 14, 2021 at 22:37

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.