Question 1007318
<pre>
Let the number of fives be x
Let the number of tens be y


                      Value      Value
Type       Number       of         of
 of          of        EACH       ALL
bill        bills      bill      bills
-------------------------------------------
fives         x       $5         $5x
tens          y       $10       $10y
-------------------------------------------
TOTALS       124      -----     $840

 The first equation comes from the second column.

  {{{(matrix(3,1,Number,of,fives))}}}{{{""+""}}}{{{(matrix(3,1,Number,of,tens))}}}{{{""=""}}}{{{(matrix(4,1,total,number,of,bills))}}}
                 x + y = 124

 The second equation comes from the last column.
  {{{(matrix(4,1,Value,of,ALL,fives))}}}{{{""+""}}}{{{(matrix(4,1,Value,of,ALL,tens))}}}{{{""=""}}}{{{(matrix(5,1,Total,value,of,ALL,bills))}}}

           5x + 10y = 840

 So we have the system of equations:
           {{{system(x + y = 124,5x + 10y = 840)}}}.

We solve by substitution.  Solve the first equation for y:

           x + y = 124
               y = 124 - x

Substitute (124 - x) for y in 5x + 10y = 840

5x + 10(124 - x) = 840
 5x + 1240 - 10x = 840
      -5x + 1240 = 840
             -5x = -400
               x = 80 = the number of fives.

Substitute in y = 124 - x
              y = 124 - (80)
              y = 44 tens.

Checking:  80 fives is $400 and 44 tens is $440
            That's 124 coins.
            And indeed $400 + $440 = $840

Edwin</pre>