What is the difference between the terms formula and algorithm in mathematics? I haven't seen the definition of formula anywhere. I know that algorithm means that Turing machine halts for every input. Is for example

$$x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}$$ formula or algorithm as $\pm$ means you can choose which sign you use? Are there any formulas that are not algorithms or algorithms that are not formulas?

  • $\begingroup$ I don't remember anything called formula in formal mathematics. I think algorithm is metalanguage term. algorithm tells a computer or a person how to do something. Pure mathematics, I think, never tells how to do something! $\endgroup$ – user59671 Mar 14 '13 at 20:18
  • $\begingroup$ @CutieKrait There are plenty of algorithms and formulas in pure mathematics. $\endgroup$ – Alexander Gruber Mar 14 '13 at 20:25
  • $\begingroup$ @AlexanderGruber: yep. But probably these are better terms: formula = equality, and algorithm = proof. $\endgroup$ – user59671 Mar 14 '13 at 20:33
  • $\begingroup$ @CutieKrait No, that is not correct. $\endgroup$ – Alexander Gruber Mar 14 '13 at 20:37
  • $\begingroup$ however these are wolfram definitions: wolframalpha.com/input/?i=formula : wolframalpha.com/input/?i=algorithm $\endgroup$ – user59671 Mar 14 '13 at 20:48

An algorithm is in its most general definition: a way of achieving a desired goal. Formula are merely recipes or components.

Example: The actual method of baking bread with steps is an algorithm:

  1. get ingredients
  2. mix ingredients
  3. put in oven
  4. cook until certain time at certain temperature
  5. take out and wait till cools

in here would be formula such as the formula for the bread, what ingredients etc...

The quadratic formula is just that: a formula for solving quadratic equations

An example of an algorithm for solving quadratics would be:

  1. get quadratic: call a the coefficient in front of x^2, b the coefficient in front of x and c the constant coefficient.

  2. evaluate quadratic formula (both + and - versions) on given a, b and c

  3. simplify

This algorithm solves the actual problem... whereas the formula is a tool used in the process.

  • $\begingroup$ while this example of picking coefficients and simplifying might seem obvious... for more complicated problems the distinction between algorithm and formula gets even clearer because much more complicated steps and subtleties are formed. If you explore computer science a little you will see what I mean. $\endgroup$ – frogeyedpeas Mar 14 '13 at 20:30

An algorithm is a method for solving a problem, but a formula is a sequence of numbers and symbols corresponding to a word in a language. The quadratic formula is an algorithm, because it is a method for solving quadratic equations. Algorithms may not even involve math, but formulas almost exclusively use numbers.

  • $\begingroup$ I think I haven't met the definition of a method but your answer seems reasonable. Nice to know that the quadratic formula is an algorithm although it contains the sign $\pm$. $\endgroup$ – guest Mar 14 '13 at 20:16
  • $\begingroup$ More precisely, the quadratic formula suggests an algorithm for solving quadratic equations; specifically, evaluating the formula. $\endgroup$ – Hurkyl Mar 14 '13 at 20:30

An algorithm is a formula as well as a procedure. Therefore conceptually a formula is a subset of an algorithm. Algorithms can be defined either in a procedure or a formula. As someone mentioned above baking a bread is a procedure and its definitely an algorithm. Moreover the quadratic equation mentioned above is a formula as well as an algorithm. Therefore we can not separate as two distinct concepts rather they are related. At the end of the day the main purpose of an algorithm is to solve a problem. Two different algorithms can solve the same problem.

  • $\begingroup$ I appreciate this answer a lot more now. 3 years back what felt apparent is not so true today :) $\endgroup$ – frogeyedpeas Apr 27 '17 at 12:06

An algorithm is a systematic method to achieve a variable Goal with different Quantitative or Qualitative Components;

A Formula is a systematic method to achieve a constant or Fixed Goal With Similar Arithmetical or Algebraic components

Example: try above same examples


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.