All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 Four balloons (Posted on 2016-01-12)
You are given four balloons: red, blue, green and yellow. Some (or all) of the balloons might be counterfeit.
A detector box can display the quantity of counterfeit balloons inside the box.
Your task is to detect all the genuine balloons using the detector box not over three times.

How would you do it?

Source: Russian Kvantik.

 No Solution Yet Submitted by Ady TZIDON No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
 re: Solution / efficiency challenge Comment 4 of 4 |
(In reply to Solution by Jer)

I investigated further.  In the worst case you do need to use the detector 3 times and put 3 in each time. (9 detections total.)  But in some of the cases after the first use or two you can use the machine fewer times or with fewer balloons.

`none 0,0,0 *A    1,1,1B    1,1,0C    1,0,1 *UD    0,1,1 *AB   2,2,1AC   2,1,2 **AD   1,2,2 **BC   2,1,1 **BD   1,2,1 **CD   1,1,2ABC  3,2,2 *ABD  2,3,2 *UACD  2,2,3BCD  2,2,2ABCD 3,3,3 *`
* The first detection is a 0 means only D is unknown, so use the machine a second time with just D.  4 detections.
* The first detection is a 3 means only D is unknown, so use the machine a second time with just D.  4 detections.

*U If the first two are 1,0 we are done.  C is the only fake.  6 detections.
*U If the first two are 2,3 we are done.  A,B,D are all fake.  6 detections.

** If the first two are 1,2 we know D is fake as is either A or B.  Just test A for the last use.  7 detections.
** If the first two are 2,1 we know C is fake as is either A or B.  Just test A for the last use.  7 detections.

The remaining six cases each begin with 1,1 or 2,2 but it will require testing ACD as my earlier post indicated.  9 detections.

This refinement reduces the expected number of uses from 3 down to 42/16=2.625 and the expected number of ballons in the machine from 9 down to 110/16=6.875

 Posted by Jer on 2016-01-14 10:40:32

 Search: Search body:
Forums (0)