California problem
The California problem

David Gries

CS@UGA.EDU

In a city in California, a nonempty group of couples meet often. Each couple consists of male and a female.

It is known that (1) the oldest male and the oldest female are the same age.

Sometimes, these couples like to swap partners for a night --the male of one group going with the female of the other group. Any time this happens, (2) the younger people in the two temporary couples are the same age --isn't that remarkable?

Prove that the two people in each group are the same age.

It helps to name the known values. Let M be age of the oldest male and W be age of the oldest female.

Consider an arbitrary couple with ages (m, w). We have to prove that m = w.  In order exploit the couple-swap rule, we have to think of this couple swapping with another. Because we don't know anything about an arbitrary couple, consider a swap with the couple with, say, ages (M, Mw). We calculate:

         M min w  =  m min Mw   ---true, by (2) --exploit one fact
     =       <(1) --exploit the other fact>
         W min w  =  m min Mw
     =       <W is the maximum age of the females>
         w  =  m min Mw
     =       <property of operation min>
         w <= m

So, w <= m. In the same way --we see this by a symmetry argument-- a swap of this couple with the couple containing the
oldest female will allow us to prove m <= w.  Putting them together gives m = w.

We do have to consider the case that there is only one couple --their ages would then be (M,W), and by (1), M=W.

And we do have to consider the swap of two couples with ages (M, Mw) and (W, Wm). We leave this to you as a simple exercise.
 

P.S. This problem goes back many years, and our first solutions used quantification, giving formulas like

        (forall m| m the age of the male of a couple: m <= M)
or
        M = (min m| m the age of a male in a couple: m)

There was more calculation, and it was messier. This solution, due, we think, to Wim Feijen, is much simpler. Here, hiding the formal definition of M and relying on the property  M min m = m  makes the calculation easier. Look here
for more on calculation.