
Augustine S. answered 11/29/23
PhD Candidate at Georgia Tech. Expertise in Optimization.
The first key step is to write down the equations properly. If we define the following variables:
- c: children attended
- s: students attended
- a: adults attended
then, we can write the system of equations as
c + s + a = 285
5c + 7s + 12a = 2076
a = 0.5c
or in a matrix form as follows
(1 1 1) (c) (285)
(5 7 12) (s) = (2076)
(-0.5 0 1) (a) (0)
For Gaussian elimination especially, you might find the following (augmented matrix) notation though a bit more convenient:
(1 1 1 | 285)
(5 7 12 | 2076)
(-0.5 0 1 | 0)
Next, it is key to understand the key goal of Guassian elimination. We wish to make:
- all entries of the first column below the first entry to be 0
- all entries of the second column below the second entry to be 0
- etc.
The reason for all this trouble will be appreciated in the end.
For now, to achieve this we are only allowed to add/subtract rows from other rows.
So what would be the way to make the second entry of the first column to be 0? We can subtract 5 times the first row and get the following:
(1 1 1 | 285)
(0 2 7 | 651)
(-0.5 0 1 | 0)
Great! Next step is to make the third entry of the first column to be 0. We can achieve this by adding 0.5 * the first row to the third row. By doing so, we get:
(1 1 1 | 285)
(0 2 7 | 651)
(0 0.5 1.5 | 142.5)
We are done with the first row! Now the only thing that remains is to make all the entries of the second column that are below the second entry to be equal to 0. So just make the third entry of the second column to be 0. To do so, we can just subtract 0.25 * second row (Note that we should use the second row here so that we don't mess up the nice zeros we have already gotten in the first column). As a result, we get:
(1 1 1 | 285)
(0 2 7 | 651)
(0 0 -0.25 | -20.25)
and we have arrived to the form we were aiming for! Now let us rewrite with the original notation:
c + s + a = 285
2s + 7a = 651
-0.25a = -20.25
Can you now appreciate why Gaussian elimination is so useful? :) We can just solve the last equation for a, then the second one for s, and then the first one for c. In other words, we got a nice systematic way to solve this problem trivially.
Indeed, by solving the third equation we get:
a = 81
Then the second one gives
2s + 567 = 651 => s = 42
and the last one gives
c + 42 + 81 = 285 => c = 162
You can even plug in the results to the original equations, to see that they are satisfied.
I hope this was helpful. If you have any additional questions, please feel free to reach out.
PS. I apologize in advance for the way I had to type the matrices, since images can't be uploaded here.

Roger R.
11/30/23