The solution is a bit long, but I wanted to go over every non-obvious step:
- Let x be Xavier's age as of today and y be Yasmine's age, also as of today.
- Note that since we have two variables, we'll try to come up with two equations to solve this problem.
- If Xavier were 2 years younger, he would be (x-2) today
- Five years ago, Xavier would be (x-5) years old. But we want to know how old the younger Xavier would have been 5 years ago. So we subtract 5 from (x-2) (and not from x) to get (x-2)-5 = x-7
- Five years ago, Yasmine would have been y-5 years old
- I prefer not to work with fractions as they are a bit more prone to errors. So we'll restate younger Xavier being a third of Yasmine's age as Yasmine being 3 times (the younger) Xavier's age
- So we get: 3 (x-7) = y - 5. This is one equation.
- In 3 years, Xavier would be (x+3) years old. You've have to be careful not to do (x-2)+3 as we are talking about Xavier, not his younger avatar.
- In 3 years, Yasmine would be (y+3) years old
- Twice Xavier's age is 2(x+3) so 8 more than twice Xavier's age is 2(x+3)+8
- So we get: 2(x+3)+8 = y + 3. This is the second equation.
There are a few ways to solve these 2 equations (also called simultaneous equations).
We'll use substitution:
We note from the first equation (line 7 above) that:
y - 5 = 3 (x-7)
By adding 5 to both sides we get:
y = 3x - 21 + 5 = 3x - 16
That's the first step in substitution (writing one of the variables in terms of the other)
For the second step, replace every y in equation 2 (line 11 above) with 3x - 16 to get:
2(x+3)+8 = 3x - 16 +3
Now we have an equation in a single variable! :)
2x + 14 = 3x - 13
Grouping all x terms to the right side the and numbers to the left side (if we did the opposite, we'd get a -x on the left, which I don't like as much), we get:
14 + 13 = 3x - 2x = x,
So x = 27
Then we solve for y:
Pick either equation (line 7 or line 11). For demonstration, we'll pick the one from line 7 (you should try it out with the one from line 11 to make sure that works too)
Equation: 3(x-7) = y- 5
But x = 27
So 3(27-7) = y-5
60 = y - 5
Or y = 65
Solution: Xavier is 27 years old and Yasmine is 65 years old.
To verify:
Xavier 2 years younger (25), but 5 years ago, would have been 20
Yasmine, 5 years ago, was 60
Indeed 60 = 3 * 20
In 3 years, Xavier would be 30, and Yasmine would be 68. Two times Xavier's age (60) plus 8 is indeed 68.
The takeaways:
By breaking the problem into tiny steps, we are able to solve even a problem that might have sounded confusing at first.
Even after many years at this, I still made and error (or two) when setting up the equations! Checking the answer to make sure that it works is an important step to solving a problem (correctly!) :)
With practice, you will be able to combine several of the steps leading to a quicker solution. But when in doubt, slow down, break up the problem, and proceed carefully.
You've got this!