I am making a script that's solving algebra. I am 16 years old so my script should be able to solve all middle school equations. (Because this is the level I have when it comes to maths. Got the grade: A)

Do anyone have a complete recipe that would apply to all equations?

I've come up with: (I'm from Norway, so the definitions may be a bit odd...)

  1. Multiply in powers outside of brackets.
  2. Try to sum the terms inside the brackets.
  3. Multiply variables, brackets or numbers into a bracket. ($5x(3x+5) = 15x^2+25x$)
  4. Remove unnecessary brackets. (Brackets with + or - in front.)
  5. Sum all the terms.
  6. Sort the terms with $x$s on the left side of the equation sign. The rest on the other side. (Remember to switch negative terms to positive terms and positive terms to negative terms).
  7. Sum all the terms again.
  8. Divide by eventually numbers multiplied with $x$. ($5x = 25$, divide all the terms with $5$ to get $x=5$).

Do you have a recipe that works for every equation you get in middle school, so that I can interpret that into my script?

Thanks! :D

  • 1
    $\begingroup$ will your method work for quadratics? $\endgroup$ – tom Nov 20 '11 at 13:31
  • $\begingroup$ #4 requires dynamic programming; $\endgroup$ – Quixotic Nov 20 '11 at 13:39
  • $\begingroup$ Symbolic computation can solve most of the equations given in middle school. However, some things cannot be computed, such as the probability that a random Turing machine will stop. en.wikipedia.org/wiki/Algebraic_algorithms computeralgebra.nl/systemsoverview/special/systems.html $\endgroup$ – Angela Richardson Nov 20 '11 at 14:09
  • $\begingroup$ It should work for all equations you can find in a middle school math book. I can do the programming here, the question is the mathematics. I want to make a script that do everything like a human would have done it. This is because I want it to show the steps for solving the equation. $\endgroup$ – Friend of Kim Nov 20 '11 at 14:43
  • 3
    $\begingroup$ I have no idea what "middle school equations" are, can you write a formal grammar that covers the problems you want to solve? $\endgroup$ – user16697 Nov 20 '11 at 16:46

This is somewhat asinine because you often can solve "middle school level" equations more easily by ignoring some of your steps. For instance, it is sometimes more proactive and intelligent to keep parantheses in equations than to completely simplify everything, especially if you are dealing with factors that can be reduced.

  • $\begingroup$ Yes, you are correct. Thank you! So simplify the parentheses if they cannot be reduced. $\endgroup$ – Friend of Kim May 30 '12 at 17:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.