# There are 5 jars of pills. Each pill weighs 10 grams, except for contaminated pills contained in one jar, where each pill weighs 9 grams. Given a scale, how could you tell which jar had the contaminated pills in just one measurement?

**Updated:**Jan. 17, 2022 —

**Training Time:**2 minutes

Overseen by: Archangel Macsika

**Topic:** Data Science.

**Difficulty:** Intermediate.

**Companies who previously asked this:** -

**Objective:** There are 5 jars of pills. Each pill weighs 10 grams, except for contaminated pills contained in one jar, where each pill weighs 9 grams. Given a scale, how could you tell which jar had the contaminated pills in just one measurement?

**Short Answer: practical answer**.

### Full Solution

Let's lay out the data we have:

5 Jars of Pills randomly labeled from Jar 1 to Jar 5.

Each good pill weighs 10 grams.

Each contaminated pill weighs 9 grams.

The solution requires a bit of arithmetic work.

First, Take out 1 pill from Jar 1, 2 pills from Jar 2, 3 pills from Jar 3, 4 pills from Jar 4, and 5 pills from Jar 5, which brings the total pills to 15 pills.

Next, place all 15 pills on the measurement scale.

If all pills are good, the total weight will be 150 grams. i.e 15 pills * 10grams = 150

However, the question dictates the presence of a contaminated pill having a weight of 9 grams, which means the total weight will ideally be less than 150.

Bear in mind that each contaminated pill has a difference of 1 gram.

If the weight is 149, then the contaminated pills is in Jar 1 since we took 1 pill weighing 9 grams each.

If the weight is 148, then the contaminated pills is in Jar 2 since we took 2 pills weighing 9 grams each.

If the weight is 147, then the contaminated pills is in Jar 3 since we took 3 pills weighing 9 grams each.

If the weight is 146, then the contaminated pills is in Jar 4 since we took 4 pills weighing 9 grams each.

If the weight is 145, then the contaminated pills is in Jar 5 since we took 5 pills weighing 9 grams each.