# Greedy Choice

> Source: https://modeladay.com/models/greedy-choice/
> Category: principle | Topics: decision, systems, cognition | Difficulty: 3/5

## Definition

A greedy choice takes the currently preferred feasible option according to a local rule, then handles what remains. A global guarantee requires showing that the local choice can always be included in an optimal solution.

## Core Rule

A greedy choice takes the currently preferred feasible option according to a local rule, then handles what remains. A global guarantee requires showing that the local choice can always be included in an optimal solution.

## Opening Context

In 1952, David Huffman published a paper about sending messages. Some messages come up again and again, while others barely show up. He wanted to send them using fewer digits on average, and he began with the two rarest.

The common messages are taking up most of the line. Why would you start by doing something about the two that hardly ever come through?

Huffman made a Greedy Choice, using a local rule to pick one feasible option and then dealing with what remained. Let's follow him through that choice and see when you can commit to a step like that.

## How It Works (Preview)

Start with what Huffman needs to deliver. Every kind of message gets a string of digits. A string for a common message gets sent more often, so its length counts more. The aim is to make the average as short as possible.

The receiver also needs to know where one message stops. A complete code can't be the beginning of another code. Otherwise, when a few digits arrive, the receiver has to wait to learn whether the message is over.

## When It Fails (Preview)

Huffman could commit at each step because the pieces of his problem could be swapped that way. Change the goal or have two choices compete for the same resource, and you have to look farther ahead.

## Full Lesson, Audio & Practice

Get the full Greedy Choice breakdown, 5-minute audio lesson, interactive mechanism animation, and decision checklist in the ConceptFlow app:
- iOS App Store: https://apps.apple.com/app/conceptflow-mental-models/id6756862333
- Google Play: https://play.google.com/store/apps/details?id=com.juxianyp.conceptflow
- Web page: https://modeladay.com/models/greedy-choice/

## Related Mental Models

- [Backtracking Search](https://modeladay.com/models/backtracking-search/)
- [Dynamic Programming](https://modeladay.com/models/dynamic-programming/)
- [Opportunity Cost](https://modeladay.com/models/opportunity-cost/)
