examples: add luck vs skill gambling model#322
Open
riddhi2106 wants to merge 7 commits intomesa:mainfrom
Open
Conversation
EwoutH
reviewed
Feb 12, 2026
EwoutH
reviewed
Feb 12, 2026
Member
EwoutH
left a comment
There was a problem hiding this comment.
Thanks for your PR.
You placed all your files in the root of the repo, could you move it to it's own folder, like examples/gambling/ ?
| @@ -1,4 +1,5 @@ | |||
| from mesa_replay import CacheableModel, CacheState | |||
|
|
|||
Member
There was a problem hiding this comment.
Why did you change all these files?
README.md
Outdated
| # Mesa Examples | ||
| ## Core Mesa examples | ||
| The core Mesa examples are available at the main Mesa repository: https://github.com/mesa/mesa/tree/main/mesa/examples | ||
| # Luck vs Skill in Short-Term Gambling |
Member
There was a problem hiding this comment.
It seems you edited the wrong Readme. This is the general readme for all example models. You probably want to add your own readme in a seperate folder
Member
There was a problem hiding this comment.
move to a subfolder, examples/gambling/ for example
Author
There was a problem hiding this comment.
Thank you for taking the time to review my PR. I’ve moved the example into examples/gambling, restored the main README, and added a dedicated README for the example.
for more information, see https://pre-commit.ci
Updated my example's readme from github directly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a new example demonstrating how short-term gambling outcomes are dominated by luck, even when agents differ in skill. The example also shows that early winners are not reliably more skilled than early losers, illustrating why short-term success is often misattributed to ability.
Motive
In stochastic environments, observed performance is often mistaken for underlying ability. This is especially common in gambling and similar settings, where short-term outcomes are highly noisy but are still used to infer skill.
This example is motivated by the need to clearly demonstrate why early success is an unreliable indicator of ability. By providing a minimal and transparent model, the example helps users understand how randomness and ranking alone can produce apparent performance differences, even when true skill differences are small.
The goal is to offer a simple, intuitive illustration of the distinction between luck and skill.
Implementation
The example implements a minimal gambling model with the following structure:
The visualization shows how, over short horizons, the average skill of winners and losers remains similar despite clear differences in outcomes.
Usage Examples
This is a screenshot of one of the possible outputs.
