A couple of days ago the Peanuts cartoon had an algebra problem. I initially solved it with a single line in wxMaxima but here the topic is Octave so I rewrote it. I wind up with 3 lines of code
% Peanuts Cartoon
% A man has 20 coins consisting of dimes and quarters
% If the dimes were quarters and the quarters were dimes
% he would have 90 cents more than he has now
% How many dimes and quarters does he have
%
% 1*D + 1*Q = 20
% 10*D + 25*Q + 90 = 25*D + 10*Q
% or -15*D + 15*Q = -90
% The matrices look like:
% A = [ 1, 1
% -15, 15]
% B = [ 20
% -90 ]
A=[1,1;-15,15]
B=[20;-90]
A\B
% The result is 13 dimes and 7 quarters
[/font]
I have to wonder how many über geeks spent the morning working on the problem
FWIW, the solution in wxMaxima is simply
solve([q+d=20,10*d+25*q+90=10*q+25*d],[q,d])
[/font]