-1

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.

  • 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. – Misha Lavrov Mar 15 '21 at 16:52
  • @MishaLavrov He keeps cheating, my god, look at his most recent question, it's a cheat as well. https://math.stackexchange.com/questions/4079070/object-in-hexagonal-grid/4079108#4079108. Is there any way to suspend him? – Some Guy Mar 27 '21 at 18:09
  • @SomeGuy If the questions are flagged for moderators every time, then the moderators will do whatever seems necessary along those lines. – Misha Lavrov Mar 27 '21 at 21:20

2 Answers2

3

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.

RobertTheTutor
  • 7,415
  • 2
  • 10
  • 34
1

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.

Mike Earnest
  • 75,930
  • 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. – ooga booga Mar 14 '21 at 19:12
  • I am afraid this is the only way I can imagine how to prove it. – Mike Earnest Mar 14 '21 at 22:37