The theorem is a generalisation of Pythagoras’s theorem. Every schoolchild knows that, for a right-angled triangle,

where x, y and z are the lengths of the three sides of the triangle, with z the length of the longest side.

Some right-angled triangles have sides whose lengths are whole numbers. For example, a triangle whose sides have lengths 3, 4 and 5 is right-angled because

Fermat was considering the more general equation

where n is a positive whole number. He wondered whether positive whole numbers x, y and z could be found that satisfied this equation if n was larger than 2.

He claimed that no such values could be found and he noted the fact in the margin of an algebra textbook he was reading. He wrote, “I have discovered a truly marvelous demonstration of this proposition that this margin is too narrow to contain.”

Well, that was in 1637. It wasn't until 1995 that Andrew Wiles and Richard Taylor published a proof of the theorem, some 358 year later.

(Incidentally, Fermat was both a lawyer and a mathematician. As am I :P)

**Molina’s Urns**

Some time before Fermat’s last theorem was proved, E. C. Molina invented a problem whose solution relied upon upon it. The problem would only have a solution if Fermat’s last theorem was proved to be false.

There are two urns each containing the same number of balls. Each ball is either black or white.

From each urn the same number of balls is selected. Each time a ball is selected from an urn its colour is noted and it is then put back into the urn before the next ball is selected.

The problem is this. Can the distributions of black and white balls in each urn be chosen such that the following condition is satisfied: the probability that the balls drawn from the first urn are all white must equal the probability that the balls drawn from the second urn are either all white or all black.

Let’s analyse the problem.

We define the following variables:

x = the number of white balls in the second urn

y = the number of black balls in the second urn

z = the number of white balls in the first urn

n = the number of balls selected from each urn

Since the total number of balls in each urn is the same, there are x + y balls in each urn.

The probability that a white ball is selected from the first urn is

Therefore the probability that all of the balls drawn from the first urn are white is

Similarly, the probability that all of the balls drawn from the second urn are white is

and the probability that all of the balls drawn from the second urn are black is

We require the probability that all of the balls drawn from the first urn are white to be equal to the probability that the balls drawn from the second urn are either all white or all black. In other words

which reduces to

So in order to satisfy the requirement of the problem we must be able to find whole numbers which satisfy this equation.

We can certainly do this if n = 2, since the equation becomes Pythagoras’s theorem. Thus we can have 5 white balls and 2 black balls in the first urn, and three white balls and four black balls in the second urn.

If we draw two balls from each urn, the probability that both balls drawn from the first urn are white is

and the probability that the two balls drawn from the second urn are either both white or both black is

which satisfies the requirement of the problem.

If, however, we choose more than two balls from each urn, Fermat’s last theorem tells us that there are no mixtures of black and white balls in each urn that will satisfy the requirement of the problem.

(I found this interesting problem in Fifty Challenging Problems in Probability, by Frederick Mosteller.)

## Comments

## Richard

As a Phuggite (named after the famous physicist, Elmer Phugg), I experienced the same frustration at the point where "to satisfy the requirements of the problem" the exposition switches abruptly from simple statements (like, to avoid burns, do not put your hand in the toaster) to wild ones (or the toaster will examine your entrails by way of neuronal activity) that I experience when someone tries to teach me something about computers. It follows, then, that I did not become a scientist, mathematician or theologian. Be grateful for this.

reply to this comment

## osos

Yes, but if I remember right, those trivial solutions are to be excluded. In fact, if you consider the trivial solutions 0 and 1 the theorem becomes possible for n>2

reply to this comment

## kunal patil

Nice Theorem ....and it is useful for the developing some of the software...thanks a lot..

reply to this comment

## what is this non-sense???????

This is wrong. You can always solve the urn problem as stated for any number of draws n. Simply fill the first urn with white balls only, and the second urn with either all white balls, or all black balls. Then the probability that the balls drawn from the first urn are all white is 1, as is the probability that the balls drawn from the second urn are either all white or all black.

reply to this comment

## Jayant

Quote:

Enter your comment

reply to this comment

## Joseph

i honestly think that fermet could be right or wrong the probability of having either all white or black balls in the first urn is 1 which i would say is correct but saying this the probability could be greater than 1. But what should i know im still attending school and am in my last year so i will get back to that.

reply to this comment

## Deanna Long

Was looking forward to enjoying an Easter themed Google doodle.

reply to this comment

## Marcelo

Yes, but if I remember right, those trivial solutions are to be excluded. In fact, if you consider the trivial solutions 0 and 1 the theorem becomes possible for n>2.

reply to this comment

## Roger

This is wrong. You can always solve the urn problem as stated for any number of draws n. Simply fill the first urn with white balls only, and the second urn with either all white balls, or all black balls. Then the probability that the balls drawn from the first urn are all white is 1, as is the probability that the balls drawn from the second urn are either all white or all black.

reply to this comment