Solutions to homework 7, in Haskell and Octave.