Three groups of people $X, Y, Z$ have no common members between any two of them. The table below contains the average age of the members of groups $X, Y, Z, X \cup Y$, $X \cup Z$, and $Y \cup Z$ in years:

| Group | $X$ | $Y$ | $Z$ | $X \cup Y$ | $X \cup Z$ | $Y \cup Z$ |
| :--- | :---: | :---: | :---: | :---: | :---: | :---: |
| Average Age | 37 | 23 | 41 | 29 | 39.5 | 33 |

What is the average age of the members of the $X \cup Y \cup Z$ group?
If we denote the number of elements in a finite set $M$ by $|M|$, then the sought average age $a$ is:

$$
a=\frac{37|X|+23|Y|+41|Z|}{|X|+|Y|+|Z|}
$$

We know about the groups $X \cup Y$ and $X \cup Z$ that

$$
29=\frac{37|X|+23|Y|}{|X|+|Y|}
$$

and

$$
39.5=\frac{37|X|+41|Z|}{|X|+|Z|}
$$

From (2) and (3), after rearrangement,

$$
|Y|=4 / 3|X| \quad \text { and } \quad|Y|=5 / 3|X|
$$

Substituting this into (1), we get

$$
a=\frac{|X|(37+23 \cdot 4 / 3+41 \cdot 5 / 3)}{|X|(1+4 / 3+5 / 3)}=34
$$

Thus, the average age of people in the $X \cup Y \cup Z$ group is 34 years.

Remark. In the solution, we did not use the information about the average age of the members of the $Y \cup Z$ group. This, however, is not too surprising, as the data provided in the problem are not independent of each other.

It can be easily shown that if the average ages of the groups $X, Y, Z, X \cup Y, Y \cup Z, Z \cup X$ are denoted by $a_{x}$, $a_{y}$, $a_{z}$, $a_{x y}$, $a_{y z}$, $a_{z x}$, respectively, then the following equality must hold:

$$
\left(a_{x}-a_{x y}\right)\left(a_{y}-a_{y z}\right)+\left(a_{z}-a_{z x}\right)\left(a_{y}-a_{x y}\right)+\left(a_{z}-a_{y z}\right)\left(a_{x}-a_{z x}\right)=0
$$