Cognitive Scaffold

Preparing your thinking workspace

arrow_back_ios_new
MENTAL MODEL · M4306

Las Vegas Algorithm

Las Vegas Algorithm
DecideHigh supportDecision Science
Included
account_tree

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

psychology

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

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/1

Practice this model in one real situation:

Check to track your progress (stored locally)
Learning progress0%
account_treeGenealogyexpand_more
menu_bookReferencesexpand_more

Source support: Explicit

  • link
    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%95ZH · Explicit
    verified

RELATED MODELS