I can show you my solution, now that the deadline has expired. Here it is.
Task: write an expression simplifier.
Deadline: the end of the afternoon lab session.
No group projects for this without my authorization.
I have written some Scheme code for symbolically computing the derivative of an expression. The code is very similar to what I have sketched last week on the blackboard, with the only significant difference of using quasiquoting instead of the list function.
You can find the code here:
The code works, but produces very redundant expressions: for example (derivative '(* x a) 'x) returns (+ (* 1 a) (* 0 x)) instead of just a.
Your task consists in writing a function taking an expression (for example the result of a derivative call) and returning another equivalent but simpler expression. For example (+ 0 (* (sin x) 1)) should be trasformed into (sin x).
Execute this at the beginning, if you are in the lab:
There are many possible solutions of varying complexity and power; I will take both point of views in consideration when assigning your bonus. Pay attention to copyright and license headers.