The average of X and Y is \[{\mathbf{18}}\] years. If Z is to be replaced by X, the average would be \[{\mathbf{15}}\] and if Z is to be replaced by Y, the average would be \[{\mathbf{12}}\] . What are the ages of X, Y and Z?
A. \[22,{\text{ }}21,{\text{ }}13\]
B \[20,12,19\]
C. \[30,12,13\]
D. \[15,21,9\]

91.8k+ views
Hint: The average of any given data can be calculated as the sum of the total given observation divided by the total number of observations for the given data set.
In this problem, average ages of two members at a time are given:
So, we can use the formula: sum of all the observations by no of observations.
Then, some linear equations with more than one variable will be formed.
After solving them, we will be getting the ages of all the members.

Complete step-by-step answer:
The average age of X and Y is given to be \[18\] years. Let ages of X and Y be x and respectively.
That means, we can say:
 \[\dfrac{{X + Y}}{2} = 18\]
i.e. \[X + Y{\text{ }} = {\text{ }}36\]
Step2: The average age of Z and Y is given to be \[15\] , if Z is to be replaced by X.
that means:
\[\dfrac{{Z + Y}}{2} = 15\]
 \[Z + Y = 30\]
Step3: If Z is to be replaced by y in the first place, the average age of X and Z would be \[12\] .
That means, \[\dfrac{{X + Z}}{2} = 12\]
\[X + Z = 24\]
Step4: Solving the equations from step1 and step \[2\] , we get:
from step1:
\[X + Y{\text{ }} = {\text{ }}36\]
 \[X = 36 - Y\]
and from step2:
 \[Z + Y = 30\]
 \[Z = 30 - Y\]
Step5: Substituting the value of x and z from step4 in step3 equation
 \[X + Z = 24\]
 \[(36 - Y) + (30 - Y) = 24\]
 \[Y = \dfrac{42}{2} \]
 \[Y = 21\]
putting value of \[y = 21\] in step4:
\[X = 36 - Y\]
\[X = 36 - 21\]
\[X = 15\] Years
\[Z = 30 - 21\]
\[Z = 9\] Years
Hence, ages of x, y, z are \[15,{\text{ }}21{\text{ }}and{\text{ }}9\] years respectively.
So, the correct answer is “X=15, Y=21 and Z= 9 years respectively.”.

Note: There are three different ways to solve systems of linear equations in two variables, that are:
1. Substitution method
2. Elimination method
3. Graphing
In the given problem, we used the substitution method..
Hence, we put the value of x and z from step4 in step5 in the form of y. Then, we found out the value of y by solving the linear equation so formed in single variable y.
Thus, we again put the value of y (just calculated) in x and z.
Hence, the option ‘D’ is correct i.e the ages of X, y and Z are \[15\]years, \[21\]years and \[9\]years respectively.