Task: Solving the math word problem with linear algebra equations.
input: Jenna is training hard to qualify for the National Games. She has a regular weekly routine, training for five hours a day on some days and 3 hours a day on the other days. She trains altogether 27 hours in a seven day week. On how many days does she train for five hours?
output: Sol: Let x = the number of "5 hour" days, y = the number of "3 hour" days.
We know there are seven days in the week, so: x + y = 7.
And she trains 27 hours in a week, with x 5-hour days and y 3-hour days, so: 5x + 3y = 27.
Solve:
x + y = 7
So: y = 7 − x
Put that in 5x + 3y = 27
5x + 3(7−x) = 27
Simplify: 5x + 21 − 3x = 27
Subtract 21 from both sides: 5x − 3x = 6
Simplify: 2x = 6
Divide both sides by 2: x = 3
The number of "5 hour" days is 3.