Project 2: Is This Game Rigged? A Loot Box Simulator
Build a simulator that estimates rare drop probabilities.
Project Overview
| Attribute | Value |
|---|---|
| Difficulty | Level 1: Beginner |
| Time Estimate | Weekend |
| Main Language | Python |
| Alternative Languages | R, JavaScript |
| Knowledge Area | Probability |
| Tools | Random generator |
| Main Book | “Introduction to Probability” by Blitzstein & Hwang |
What you’ll build: A simulator that opens loot boxes thousands of times and estimates drop rates.
Why it teaches stats: Monte Carlo shows how probabilities emerge from repeated trials.
Core challenges you’ll face:
- Modeling random outcomes
- Running large trials efficiently
- Interpreting convergence
Real World Outcome
You will estimate drop rates and show confidence intervals.
Example Output:
$ python lootbox.py --trials 100000
Estimated legendary drop: 0.98%
95% CI: [0.92%, 1.04%]
Verification steps:
- Compare estimates at different trial counts
- Check convergence behavior
The Core Question You’re Answering
“How many trials do I need to trust a probability estimate?”
This is applied probability in action.
Concepts You Must Understand First
Stop and research these before coding:
- Law of large numbers
- Why do estimates stabilize with more trials?
- Book Reference: “Introduction to Probability” Ch. 5
- Confidence intervals
- How do you compute uncertainty around an estimate?
- Book Reference: “OpenIntro Statistics” Ch. 4
- Random variables
- How does a Bernoulli trial model a drop?
- Book Reference: “Introduction to Probability” Ch. 2
Questions to Guide Your Design
- Drop model
- Will you use a single probability or multiple tiers?
- How will you store outcomes?
- Visualization
- Will you plot convergence over trials?
- How will you show distribution of outcomes?
Thinking Exercise
Rare Drops
If the true drop rate is 1%, how many trials would you need to expect about 100 drops?
Questions while working:
- Why are rare events noisy?
- How does variance scale with trials?
The Interview Questions They’ll Ask
Prepare to answer these:
- “What is the law of large numbers?”
- “Why do rare events require many trials?”
- “What is a confidence interval?”
- “How do you simulate Bernoulli trials?”
- “Why might early estimates be misleading?”
Hints in Layers
Hint 1: Starting Point Start with a simple Bernoulli model.
Hint 2: Next Level Track running estimates over time.
Hint 3: Technical Details Compute confidence intervals using normal approximation.
Hint 4: Tools/Debugging Plot estimate vs trial count to see convergence.
Books That Will Help
| Topic | Book | Chapter |
|---|---|---|
| LLN | “Introduction to Probability” | Ch. 5 |
| Confidence intervals | “OpenIntro Statistics” | Ch. 4 |
| Bernoulli trials | “Introduction to Probability” | Ch. 2 |
Implementation Hints
- Use vectorized random generation for speed.
- Keep results reproducible with a seed.
- Report both estimate and uncertainty.
Learning Milestones
- First milestone: You can simulate random drops.
- Second milestone: You can estimate probabilities reliably.
- Final milestone: You can explain confidence in estimates.