15
$\begingroup$

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?

$\endgroup$
6
  • $\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, 2013 at 20:18
  • $\begingroup$ @CutieKrait There are plenty of algorithms and formulas in pure mathematics. $\endgroup$
    – Alexander Gruber
    Mar 14, 2013 at 20:25
  • $\begingroup$ @AlexanderGruber: yep. But probably these are better terms: formula = equality, and algorithm = proof. $\endgroup$
    – user59671
    Mar 14, 2013 at 20:33
  • $\begingroup$ @CutieKrait No, that is not correct. $\endgroup$
    – Alexander Gruber
    Mar 14, 2013 at 20:37
  • $\begingroup$ however these are wolfram definitions: wolframalpha.com/input/?i=formula : wolframalpha.com/input/?i=algorithm $\endgroup$
    – user59671
    Mar 14, 2013 at 20:48

5 Answers 5

12
$\begingroup$

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.

$\endgroup$
1
  • $\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$ Mar 14, 2013 at 20:30
2
$\begingroup$

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.

$\endgroup$
2
  • $\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, 2013 at 20:16
  • $\begingroup$ More precisely, the quadratic formula suggests an algorithm for solving quadratic equations; specifically, evaluating the formula. $\endgroup$
    – user14972
    Mar 14, 2013 at 20:30
1
$\begingroup$

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.

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

I believe one of the best answers is given by MIT textbook for the introductory course to CS, the author argued that all knowledge can be thought as Imperative or Declarative, with the latter being a way of declaring some sort of information like "the square of four is two" and the former being the "how to" type of knowledge like a recipe describing how cook a lasagna, regarding your question, i believe that most mathematics is declarative knowledge, statements that's strictly represent some computational nature or behavior in mathematical notations. while algorithms is obviously the imperative type, adding to that just taking a look at the formal definition of an algorithm, that is "a finite list of instructions which describes a set of computations that have a well-defined stats" , formulas is definitely not a list of instructions in my opinion.

$\endgroup$
0
$\begingroup$

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

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .