Skip to main content

random algorithms

random algorithms Algorithms that are fast but instead of always giving the correct answer give the correct answer with high probability. They have been devised because of the difficulty (impossibility?) of finding polynomial time algorithms for some problems (see P=NP question).

An example is that of trying to test whether or not a number is prime. Given an integer n there is a test that uses a “guess” i, chosen at random between 1 and n, that takes O(log2n) time to perform. If the test is successful n is known to have factors; on the other hand if n has factors then the test will be successful for at least half of the integers in the range 1 to n. Thus if the test fails k times it can be said that n is prime with probability 1 – 2k.

Several other examples of problems amenable to a similar approach have now been found. However, such examples are either already known to be solvable in polynomial time anyway (although the random algorithms are an order of magnitude faster) or, like prime-testing, under suspicion of so being.

Cite this article
Pick a style below, and copy the text for your bibliography.

  • MLA
  • Chicago
  • APA

"random algorithms." A Dictionary of Computing. . 19 Mar. 2019 <>.

"random algorithms." A Dictionary of Computing. . (March 19, 2019).

"random algorithms." A Dictionary of Computing. . Retrieved March 19, 2019 from

Learn more about citation styles

Citation styles gives you the ability to cite reference entries and articles according to common styles from the Modern Language Association (MLA), The Chicago Manual of Style, and the American Psychological Association (APA).

Within the “Cite this article” tool, pick a style to see how all available information looks when formatted according to that style. Then, copy and paste the text into your bibliography or works cited list.

Because each style has its own formatting nuances that evolve over time and not all information is available for every reference entry or article, cannot guarantee each citation it generates. Therefore, it’s best to use citations as a starting point before checking the style against your school or publication’s requirements and the most-recent information available at these sites:

Modern Language Association

The Chicago Manual of Style

American Psychological Association

  • Most online reference entries and articles do not have page numbers. Therefore, that information is unavailable for most content. However, the date of retrieval is often important. Refer to each style’s convention regarding the best way to format page numbers and retrieval dates.
  • In addition to the MLA, Chicago, and APA styles, your school, university, publication, or institution may have its own requirements for citations. Therefore, be sure to refer to those guidelines when editing your bibliography or works cited list.