Family Riddle

Problem Description. This problem is offered as a DMCommunity’s challenge Jan-2024.

children

Let’s assume that Rene and Leo are both heads of household, and, what a coincidence, both families include three girls and three boys. The youngest child in Leo’s family is a girl, and in Rene’s family, a little girl has just arrived. In other words, there is a girl in Rene’s family whose age is less than one year. Neither family includes any twins, nor any children closer in  age than a year. All the children are under age ten. In each family, the sum of the ages of the girls is equal to the sum of the ages of the boys; in fact, the sum of the squares of the ages of the girls is equal to the sum of the squares of the ages of the boys. The sum of the ages of all these children is 60.

Question: What are the ages of the children in these two families? How many solutions has this problem?

Implementation. We will use the following business Glossary to describe the main concepts of the problem:

And we will represent both families in this DecisionData and DecisionTest tables:

We will use the standard Rule Solver top-level decision “DefineAndSolve”:

Here are our two main sub-decisions “Define” and “Solve”:

The following table defines unknown decision variables:

The next table posts problem constraints:

When we execute this decision model, it will produce 144 solutions. Here is the first one:

Here is the second solution and the last one:

If you analyze these solutions you will see that many of them are symmetrical as the same values are being assigned to different girls and boys. To remove the symmetry we may add more precedence constraints for children in the families:

If we ran the same problem now we will receive the following (single) solution:

THE END