Las Vegas algorithm

Las Vegas algorithm

In computing, a Las Vegas algorithm is a randomized algorithm that never gives incorrect results; that is, it always produces the correct result or it informs about the failure. In other words, a Las Vegas algorithm does not gamble with the verity of the result --- it only gambles with the resources used for the computation. A simple example is randomized quicksort, where the pivot is chosen randomly, but the result is always sorted. The usual definition of a Las Vegas algorithm includes the restriction that the "expected" run time always be finite, when the expectation is carried out over the space of random information, or entropy, used in the algorithm.

The complexity class of decision problems that have Las Vegas algorithms with expected polynomial runtime is ZPP.

It turns out that

: extrm{ZPP} = extrm{RP} cap ,co, extrm{-RP}, ,!

which is intimately connected with the way Las Vegas algorithms are sometimes constructed. Namely the class RP consists of all decision problems for which a randomized polynomial-time algorithm exists that always answers correctly when the correct answer is "no", but is allowed to be wrong with a certain probability bounded away from one when the answer is "yes". When such an algorithm exists for both a problem and its complement (with the answers "yes" and "no" swapped), the two algorithms can be run simultaneously and repeatedly: a few steps of each, taking turns, until one of them returns a definitive answer. This is the standard way to construct a Las Vegas algorithm that runs in expected polynomial time. Note that in general there is no worst case upper bound on the run time of a Las Vegas algorithm.

Las Vegas algorithms can be contrasted with Monte Carlo algorithms, in which the resources used are bounded but the answer is not guaranteed to be correct 100% of the time.

See also

* Randomness
* Monte Carlo method

External links

* [http://www.datastructures.info/the-las-vegas-algorithmmethod/ Example code of Miller-Rabin primality test using the Las Vegas method, C++]

References

*Algorithms and Theory of Computation Handbook, CRC Press LLC, 1999, "Las Vegas algorithm", in Dictionary of Algorithms and Data Structures [online] , Paul E. Black, ed., U.S. National Institute of Standards and Technology. 17 July 2006. (accessed TODAY) Available from: [http://www.nist.gov/dads/HTML/lasVegas.html]


Wikimedia Foundation. 2010.

Игры ⚽ Поможем решить контрольную работу

Look at other dictionaries:

  • Las Vegas — most commonly refers to: * Las Vegas, Nevada, a major resort city in the United States * Las Vegas metropolitan area, the cities of Las Vegas, Henderson, North Las Vegas, Boulder City, and other unincorporated locales surrounding these cities *… …   Wikipedia

  • VEGAS algorithm — The VEGAS algorithm, due to G. P. Lepage, is a method for reducing error in the Monte Carlo simulation by using a known or approximate probability distribution function to concentrate the search in those areas of the graph that make the greatest… …   Wikipedia

  • Algoritmo de Las Vegas — Un algoritmo tipo Las Vegas es un algoritmo de computación de carácter aleatorio (random) que no es aproximado: es decir, da el resultado correcto o informa de que ha fallado. Características Un algoritmo de este tipo no especula con el resultado …   Wikipedia Español

  • Vegas — (Spanish for fertile valleys ) may refer to:Places* Las Vegas, Nevada, a city in the United States ** The Las Vegas metropolitan area*Las Vegas, New Mexico, a town in the United StatesPeople* Johnny Vegas British Actor/comedian.Entertainment*… …   Wikipedia

  • Algorithm — Flow chart of an algorithm (Euclid s algorithm) for calculating the greatest common divisor (g.c.d.) of two numbers a and b in locations named A and B. The algorithm proceeds by successive subtractions in two loops: IF the test B ≤ A yields yes… …   Wikipedia

  • Randomized algorithm — Part of a series on Probabilistic data structures Bloom filter · Skip list …   Wikipedia

  • Monte Carlo algorithm — In computing, a Monte Carlo algorithm is a randomized algorithm whose running time is deterministic, but whose output may be incorrect with a certain (typically small) probability. The related class of Las Vegas algorithms is also randomized, but …   Wikipedia

  • List of algorithm general topics — This is a list of algorithm general topics, by Wikipedia page. * Analysis of algorithms * Ant colony algorithm * Approximation algorithm * Best and worst cases * Big O notation * Combinatorial search * Competitive analysis * Computability theory… …   Wikipedia

  • ZPP — This is an article about a computational complexity class. For Polish communist political organisation, see Związek Patriotów Polskich . For the pyrotechnic composition, see zirconium potassium perchlorate.In complexity theory, ZPP (Zero error… …   Wikipedia

  • Monte Carlo method — Not to be confused with Monte Carlo algorithm. Computational physics …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”