The Wayback Machine - https://web.archive.org/web/20240119201800/https://www.geeksforgeeks.org/puzzle-10-identical-bottles-pills/
Open In App
Related Articles

Puzzle | 10 identical bottles of pills

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Report issue
Report

Puzzle: Given 10 identical bottles of identical pills (each bottle contains 100 pills). Out of 10 bottles 9 have 1 gram of pills but 1 bottle has pills of the weight of 1.1 gram. Given a measurement scale, how would you find the heavy bottle? You can use the scale only once. 

Solution: 

  1. Step 1: arrange the bottles on the shelf and now take, 1 pill from the first bottle, 2 pills from the second bottle, 3 pills from the third bottle, and so on.
  2. Step 2: Ideally, you would have (10)*(11)/2=55 pills weighing 55 grams. When you put the entire pile of pills on the weighing scale, the deviation from 55g would tell you which bottle contains the heavy pills.
  3. Step 3: If the deviation is .1 gram more, it is the 1st bottle which has heavy pills, if it is .2 gram more than 2nd bottle has heavy pills, if it is .3 gram more than 3rd bottle has heavy pills, if it is .4 gram more than 4th bottle has heavy pills, and so on.

References: http://www.crazyforcode.com/10-identical-bottles-pills/ 
 

Learn to code easily with our course Coding for Everyone. This course is accessible and designed for everyone, even if you're new to coding. Start today and join millions on a journey to improve your skills!

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Commit to GfG's Three-90 Challenge! Purchase a course, complete 90% in 90 days, and save 90% cost click here to explore.
Last Updated : 18 Jan, 2023
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads