ADDITION
SPAM
Super Pc Algebraic Math
Today we will explore the programming of an algebra problem solver.
This will take some time, since it will be only using words, and nothing else.
So to start off, we will start with addition.
Sounds simple?
Well it’s not.
First we have to decide what numbers are, and how to use them.
Numbers here are called “counts”.
For example, 5 is five counts, and one is only one count.
So let’s say we want 5+2.
It will only give us 7 if:
[1+1=2]
[2+4=6]
[3+9=12]
And so on for all 0-9 adding combinations…
Then it will understand that 5 counts is 5 one counts, and add them to 2 counts.
And it should pop up to be 7.
For anything above nine:
[0+1=1]
[9+1=10]
But we have to make it understand if there was more than one nine, so:
[99+1=[1+9=10; 10+90=100]100]
This gets confusing, so something has to be made to simplify it so we have one rule for higher than ten numbers.
Example:
[for all [1+9] add [1] to the count to the left]
Example:
[1] 3999+1{solve}
[s1]4000
[if no count on the left, then create left count and make it [1]]
So some problems using nine would be:
[1]289+25{solve}
[2]294+45{solve}*
[3]962+58{solve}*
[s1]314
[s2]339*
[s3]1200*
*This function is [MULTI_PROB] which lets the user have more than one problem.*
So as you can see, it is pretty confusing to make an adding machine.
Part 2, Subtraction, is coming next.
SUBTRACTION
This is subtraction.
Pretty easy to explain now.
So what this is supposed to do is tell the program to subtract.
Example:
[18-9=9]
[5-2=3]
[14-8=6]
And so on with all of the 0-9 subtraction combinations.
So how to do #00000-[1-or-9]
[0-9&a count is before the zero-->change the last [0] to [1] and change the rest of the [0] to [9]; subtract one from the LC]
Example:
[1]2000-9{solve}
[s1]1991
And for [#00-1]:
[0-1&a LC is in place{and is not 0}-->change all [0] to nine and subtract [1] from the LC]
So this would be an example:
[1]450-21{solve}
[2] 2040-1{solve}
[3] 347-189{solve}
[s1]429
[s2]2039
[s3]158
Now of course more than just this can’t make a good system, so more work has to be done in order for it to understand re-grouping.
Move on to Multiplication.
MULTIPLICATION
This one is pretty easy.
Just ask it to:
[for LC*RC make LC groups of RC and add]
Example:
[1]3*5{solve}
[s1]15
Move on to Division.
DIVISION
Ok, so the main thing would be fractions, since decimals would be too hard for now.
Let’s say you want:
[1]10/4
[for LC/RC find how many groups of RC makes LC]
.....|_[if RC cannot be grouped evenly, find how many can be grouped, then leave the left over count to be the new LC; turn the LC into the LLC and create [_]]
............|__[if possible, before grouping, find a CC that fits both numbers and find how many [CC] make the LC&RC]
Example(with solution):
[s1](10/4); CC=2; (5/2); 2_1/2
This can be more complicated, but this is just the beginning.
Now move on to Powers.
POWERS
Now this is like Multiplication, but instead of adding the cloned counts, it should multiply it.
Example:
[for LC^RC make RC clones of LC and multiply]
Example:
[1]34
[s1]81
Move on to Roots.
ROOTS
OK, so say you want [[1]4^(1/2)].
[for LC^(1/RC) find what NC can be cloned (RC-1) times and multiply to see if it matches LC]
NC=New Count
So the answer would be:
[s1]2
[2 can be cloned 1 time and multiplied to get 4]
Move on to Variables.
VARIABLES
This is easy too.
[for any non_number count, undo each math step using [M] or [D] first{depending which order they appear(OF)} then undo [A] or [S](OF)]
Example:
[1](m/3*2+1)-5=2
[s1]7
Up to one variable may be processed, unless SOE(Systems Of Equations) is put in.
This so far is only the simple math, for simple problems.
The more complicated stuff will be in my next SPAM report.

