Dorian E. answered 10/14/20
Incoming PhD in Stats and All-Around Math Guy
Let x = adults, y = students, z = children. This problem has now given us three equations in three unknowns; we will see if there is a consistent solution among x,y and z.
Since 2 adults, one student and one child pay $15, we drop the "$" and write [2x + y + z = 15]
Since we are then told one pays as much for an adult ticket as they do for both a student's and child's ticket, we convey this equality by writing [x = y + z]. We will want the variables on the same side of the equation, so let's in fact write [x - y - z = 0].
And since we purchased 1x, 4y and 2z for $23, we know that we can write [x + 4y + 2z = 23].
If these three equations are true all at the same time (and we assume here they are), then we treat these equations as a system, writing them simultaneously:
[2x + y + z = 15]
[x - y - z = 0]
[x + 4y + 2z = 23]
These three equations, however, are algebraically equivalent to the matrix equation
[2 1 1] [x] [15]
[1 -1 -1] [y] = [0]
[1 4 2] [z] [23]
To solve for x,y and z, we augment our matrix, and use Gauss-Jordan elimination to find the reduced row echelon form (RREF):
[2 1 1 | 15]
[1 -1 -1 | 0]
[1 4 2 | 23]
Using an online matrix reduction calculator (I used https://www.emathhelp.net/calculators/linear-algebra/reduced-row-echelon-form-rref-caclulator/), we see that the RREF is as follows:
[1 0 0 | 5]
[0 1 0 | 4]
[0 0 1 | 1]
The above matrix reads off that x = 5, y = 4, z = 1. Just to check these answers are legit, observe that they fit exactly into our three original equations:
2(5) + 1(4) + 1(1) = 10 + 4 + 1 = 15
1(5) - 1(4) - 1(1) = 5 - 4 - 1 = 0
1(5) + 4(4) + 2(1) = 5 + 16 + 2 = 23