The CSAT and Practice[+] are designed by the Climb Foundation to help candidates. We are advocates for more opportunity to shine and less opportunity to fail, and we strive to level the playing field. # Practice Paper 4 Question 19

There are $$n$$ chemicals. One is magic, turning lead into gold in one day. You may (i) mix multiple chemicals with lead in one flask; (ii) add one chemical to multiple flasks. You have $$p$$ flasks, and an unlimited supply of lead and of each of the $$n$$ chemicals. What is the smallest number of days you need to guarantee you find the magic chemical?

The above links are provided as is. They are not affiliated with the Climb Foundation unless otherwise specified.

## Warm-up Questions

1. Bob choosse a letter randomly from the English alphabet. You may question a range (e.g. from 'a' to 'o' inclusively) and he will tell you whether the letter is within the range. You want to guess as few questions as possible. How many guesses do you need in the worst case?

## Hints

• Hint 1
How many chemicals can you distinguish in a single day with $$p=1$$ flask?
• Hint 2
How could you distinguish 2 chemicals with only one flask? And why would it be possible?
• Hint 3
What's the maximum number of chemicals you can distinguish in a single day using $$p$$ flasks?
• Hint 4
Remember rule (ii): you can add the same chemical to multiple flasks.
• Hint 5
For $$p=3,$$ we can distinguish up to $$8$$ chemicals.
• Hint 6
How would you extend this approach to $$d$$ days?
• Hint 7
In other words, if we can distinguish $$k$$ chemicals in one day with $$p$$ flask, how many chemicals can we distinguish in $$d$$ days?
• Hint 8
We can do much better than $$kd$$ chemicals.
• Hint 9
For up to $$n=16$$ and $$p=2,$$ it can be done in two days.
• Hint 10
Try writing out the integers from $$0$$ to $$15$$ as 4-digit binary numbers.

## Solution

We could start by asking: "What's the maximum number of chemicals I can distinguish in a single day using $$p$$ flasks?". That number then grows exponentially with the number of days. Hence the number of flasks $$p$$ necessary to distinguish $$n$$ chemicals grows logarithmically.

You should also realise that you can leave one chemical aside, which would be the gold'ing chemical if none of the other flasks turn to gold. Then, you should ask how many combinations there are, such that each flask can reveal a single gold'ing chemical. This leads to binary counting and exponentiation.

For example, for $$p=3$$ we can find the gold'ing chemical in a single day from $$n=8$$ chemicals:

0
1 x
2 x
3 x x
4 x
5 x x
6 x x
7 x x x

The $$0^{th}$$ chemical is left unused. If only flask 2 turns to gold, then it's the $$1^{st}$$ chemical. If only flasks 2 and 3 turn to gold, then it's the $$3^{rd}$$ chemical and so on. If none turn to gold, then it's the $$0^{th}$$ chemical.

If we can afford $$d$$ days, then we can do powers of $$2^p$$ each day, and therefore can distinguish $$n=2^{pd}$$ chemicals. We can get the answer for the reverse question (how many days) by rearranging to get $$d=\lceil \log_{2^p} n\rceil$$.

For $$n=16$$ and $$p=2,$$ we can find the gold'ing chemical as follows:

For example, if on both days, flask 2 turns to gold, then the $$5^{th}$$ chemical is the gold'ing chemical and so on. If none turn to gold, then it’s the $$0^{th}$$ chemical.
{"ft_lang_label":"__label__en","ft_lang_prob":0.8897552,"math_prob":0.99613804,"size":3418,"snap":"2019-35-2019-39","text_gpt3_token_len":966,"char_repetition_ratio":0.16608085,"word_repetition_ratio":0.067307696,"special_character_ratio":0.30456406,"punctuation_ratio":0.09577465,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9995946,"pos_list":[0,1,2],"im_url_duplicate_count":[null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-09-21T15:18:17Z\",\"WARC-Record-ID\":\"<urn:uuid:6f7e73c3-845c-456c-ab56-0b6ea402aa16>\",\"Content-Length\":\"14629\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:179516fd-5df0-4610-84ab-9829c2ddf368>\",\"WARC-Concurrent-To\":\"<urn:uuid:4093a301-b6e6-4884-aabd-2c956700d142>\",\"WARC-IP-Address\":\"104.31.65.59\",\"WARC-Target-URI\":\"https://csat.io/practice/p4/q19\",\"WARC-Payload-Digest\":\"sha1:KVVM4UUH555ICFLQQUYFVOOEPCMBF7SM\",\"WARC-Block-Digest\":\"sha1:M3XNSZ5NXWNOKWLGJINGCKAXGEAXUAJA\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-39/CC-MAIN-2019-39_segments_1568514574532.44_warc_CC-MAIN-20190921145904-20190921171904-00100.warc.gz\"}"}