[Math] Difference between formula and algorithm

algorithmsnotationterminology

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?

Best Answer

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.