12 ball weighing problem – find the fake

Problem 85 from http://mathproblems.info/group5.html

In front of you are 12 pearls, 11 being real and one fake. The real ones all weigh the same and the fake one differs in weight from the real ones (may weigh more or less). With a balance scale and three weighings how can you weed out the fake one and determine whether it is too heavy or too light?

Twelve pearls, one fake, and a scale

Twelve pearls, one fake, and a scale

Weights of pills

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