ArticleslgStudy

computer science

Odds algorithm

Odds algorithm is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Odds algorithm rather than just read about it. In short: In decision theory, the odds algorithm (or Bruss algorithm) is a mathematical method for computing optimal strategies for a class of problems that belong to the domain of optimal stopping problems. Their solution follows from the odds strategy, and the importance of the odds strategy lies in its optimality, as explained below.

Odds algorithm — main illustration
Odds algorithm — illustration

Key takeaways

  • Odds algorithm belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Odds algorithm to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Odds algorithm from memory before moving on to harder problems.

Reference excerpt

In decision theory, the odds algorithm (or Bruss algorithm) is a mathematical method for computing optimal strategies for a class of problems that belong to the domain of optimal stopping problems. Their solution follows from the odds strategy, and the importance of the odds strategy lies in its optimality, as explained below. The odds algorithm applies to a class of problems called last-success problems. Formally, the objective in these problems is to maximize the probability of identifying in a sequence of sequentially observed independent events the last event satisfying a specific criterion (a "specific event"). This identification must be done at the time of observation. No revisiting of preceding observations is permitted. Usually, a specific event is defined by the decision maker as an event that is of true interest in the view of "stopping" to take a well-defined action. Such problems are encountered in several situations.

Examples Two different situations exemplify the interest in maximizing the probability to stop on a last specific event.

Suppose a car is advertised for sale to the highest bidder (best "offer"). Let n {\displaystyle n} potential buyers respond and ask to see the car. Each insists upon an immediate decision from the seller to accept the bid, or not. Define a bid as interesting, and coded 1 if it is better than all preceding bids, and coded 0 otherwise. The bids will form a random sequence of 0s and 1s. Only 1s interest the seller, who may fear that each successive 1 might be the last. It follows from the definition that the very last 1 is the highest bid. Maximizing the probability of selling on the last 1 therefore means maximizing the probability of selling best. A physician, using a special treatment, may use the code 1 for a successful treatment, 0 otherwise. The physician treats a sequence of n {\displaystyle n} patients the same way, and wants to minimize any suffering, and to treat every responsive patient in the sequence. Stopping on the last 1 in such a random sequence of 0s and 1s would achieve this objective. Since the physician is no prophet, the objective is to maximize the probability of stopping on the last 1. (See Compassionate use.)

Definitions Consider a sequence of n {\displaystyle n} independent events. Associate with this sequence another sequence of independent events I 1 , I 2 , … , I n {\displaystyle I_{1},\,I_{2},\,\dots ,\,I_{n}} with values 1 or 0. Here I k = 1 {\displaystyle \,I_{k}=1} , called a success, stands for the event that the kth observation is interesting (as defined by the decision maker), and I k = 0 {\displaystyle \,I_{k}=0} for non-interesting. These random variables I 1 , I 2 , … , I n {\displaystyle I_{1},\,I_{2},\,\dots ,\,I_{n}} are observed sequentially and the goal is to correctly select the last success when it is observed. Let p k = P ( I k = 1 ) {\displaystyle \,p_{k}=P(\,I_{k}\,=1)} be the probability that the kth event is interesting. Further let

q k = 1 − p k {\displaystyle \,q_{k}=\,1-p_{k}} and r k = p k / q k {\displaystyle \,r_{k}=p_{k}/q_{k}} . Note that r k {\displaystyle \,r_{k}} represents the odds of the kth event turning out to be interesting, explaining the name of the odds algorithm.

Algorithmic procedure The odds algorithm sums up the odds in reverse order

r n + r n − 1 + r n − 2 + ⋯ , {\displaystyle r_{n}+r_{n-1}+r_{n-2}\,+\cdots ,\,}

until this sum reaches or exceeds the value 1 for the first time. If this happens at index s, it saves s and the corresponding sum

R s = r n + r n − 1 + r n − 2 + ⋯ + r s . {\displaystyle R_{s}=\,r_{n}+r_{n-1}+r_{n-2}+\cdots +r_{s}.\,}

If the sum of the odds does not reach 1, it sets s = 1. At the same time it computes

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Odds algorithm

Start with the simplest possible case. Write down what Odds algorithm claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Odds algorithm before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Odds algorithm ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Odds algorithm

In research
Odds algorithm appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Odds algorithm in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Odds algorithm is common in secondary-school and first-year university syllabi. It links to neighbouring topics Optimal decisions, Optimization algorithms and methods, Statistical algorithms, so understanding it makes those chapters shorter.
In everyday life
Look for Odds algorithm outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Odds algorithm in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Odds algorithm means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Odds algorithm out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Odds algorithm in simple terms?

In decision theory, the odds algorithm (or Bruss algorithm) is a mathematical method for computing optimal strategies for a class of problems that belong to the domain of optimal stopping problems. Their solution follows from the odds strategy, and the importance of the odds strategy lies in its op…

Why does Odds algorithm matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Odds algorithm?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Odds algorithm.

Tags

  • Optimal decisions
  • Optimization algorithms and methods
  • Statistical algorithms

Keep exploring