Las Vegas Algorithm
Version 1.0.0 · Updated 2026-07-28
CORE DEFINITION
In computing, a Las Vegas algorithm is a randomized algorithm that always gives the correct solution; that is, it always returns the correct result, or returns failure. In other words, a Las Vegas algorithm does not gamble with the correctness of the result, but rather with the resources used for computation. A simple example is randomized quicksort, where the pivot is chosen randomly, but the sorting result is always consistent. The counterpart to the Las Vegas algorithm is the Monte Carlo algorithm, which may return an incorrect result with a certain probability, but its running time is deterministic or has an upper bound.
SCAFFOLDING EFFECT
Reduce cognitive load
In computing, a Las Vegas algorithm is a randomized algorithm that always gives the correct solution; that is, it always returns the correct result, or returns failure. In other words, a Las Vegas algorithm does not gamble with the correctness of the result, but rather with the resources used for computation. A simple example is randomized quicksort, where the pivot is chosen randomly, but the sorting result is always consistent. The counterpart to the Las Vegas algorithm is the Monte Carlo algorithm.
Anchor fast decisions
A Las Vegas algorithm is a randomized algorithm whose running time is random but whose result is always correct, and if necessary, it relies on random retries to ensure correctness. It is contrasted with the Monte Carlo algorithm (which may produce incorrect results but has fixed time).
MINIMUM ACTION
In progress 0/1Practice this model in one real situation:
account_treeGenealogyexpand_more
menu_bookReferencesexpand_more
Source support: Explicit
- zh.wikipedia.orghttps://zh.wikipedia.org/wiki/%E6%8B%89%E6%96%AF%E7%BB%B4%E5%8A%A0%E6%96%AF%E7%AE%97%E6%B3%95verified
PRIVATE NOTES · Only visible to you
SAVED Q&A
ENTRY Q&A · Private saving available
Ask with a clear boundary
thinkingmodels answers from published entry context only.
Your question is sent to thinkingmodels. The answer uses public entry context only.
RELATED MODELS