Computer algebra system

At some point in the future I'd like to write a computer algebra system, like Maple or Mathematica, just because I think it would be really fun piece of software to write. The basic idea is that you can tell the computer things you know (e.g. "x+2=3") and ask it questions (like "x?") and the computer would attempt to give the simplest possible answer by searching its database of facts. When printing formulae on the screen it would use algorithms from TeX to give attractive output.

Another nice feature would be the ability to directly manipulate formulae, for example rearranging terms of an equation by dragging them with the mouse or expanding multiplications by clicking on them (the program, of course, would prevent manipulations that aren't mathematically correct). These kinds of manipulations can be very tedious to do by hand.

Yet another feature that I want is the ability to create animated, interactive proofs. Rather than just presenting a static sequence of "X implies Y implies Z" on a page, the program could actually create an animation of X turning into Y. And if, at some stage, a derivation is unclear, the user could right-click on it, select "Why?" and the program would attempt to explain. That sounds difficult to do but I think much of this is really quite mechanical. When studying mathematics at university, I often wished that the proofs were presented like this - it would have made things much easier.

As well as an interactive algebra and mathematical presentation system, this program would also contain a big database of mathematical facts, both to aid in the program's own proofs and as an (interactive) mathematics textbook in its own right. Mathematicians using the software could contribute their discoveries to this database/textbook in addition to (or even instead of) the traditional distribution method of writing papers.

4 Responses to “Computer algebra system”

  1. andreas s. says:

    you can do algebraic expressions with basic using a string variable, i mean if you calculate (a+b+c+d)`2 it will result in a`2+b`2+2*(a*b+a*c+a*d+b*c+b*d+c*d) this means you have two for next loops:
    for a is 1 to n
    for b is a+1 to n-1
    ...
    next b
    next a
    i have this on my homepage but i must not tell

    • Andrew says:

      It can be done that way, but it's very complicated and error-prone! Whatever manipulation you need to do you need to program in explicitly, and the computer has no way to check if your manipulation is correct, or if you forgot to add c`2+d`2. There are much better ways.

      I have actually seen a primitive computer algebra system written in BASIC, that really did store and manipulate expressions as strings. Amazingly it actually did seem to work most of the time, though the code was quite incomprehensible and all my attempts at fixing bugs or adding features were futile.

  2. andreas s. says:

    thanks for your attention. i forgot what you said. furthermore, amstrad basic offers the possibility to print results in a txt file so you can copy and paste them into a source code
    with the following commands
    clear reset:rem this avoids an error message after the program was
    rem interrupted with ctrl c
    rem error reads stream already open
    dnr= 5
    open #dnr output "results.txt"
    this is important if you calculate intersections of cones or hyperbola
    because x^2+y^2=r^2*(1+z/hk)^2+vr^2
    this will lead to long equations if you have a complicity like
    nx*x+ny*y+nz*z=de
    by the way, the idea to do so was the built in software of a ti92 plus ca

    • Andrew says:

      Best of luck with that! Btw, printing results to a text file is not something unique to Amstrad BASIC - almost every programming language ever has that facility!

Leave a Reply