๐ฅ๏ธ Command Line Interface (CLI)¶
The Probability Calculator provides a convenient command-line interface that allows you to run MonteโCarlo probability simulations without writing Python code.
โถ๏ธ Running the CLI¶
Once installed (pip install .), run:
probability-calculator --help
This displays available commands and options.
๐ฉ Creating a Hat via CLI¶
You specify balls using color=count pairs:
probability-calculator --hat red=3 blue=2 green=6
This defines a hat with:
- 3 red balls
- 2 blue balls
- 6 green balls
๐ข Setting Expected Outcome¶
Specify the expected minimum number of balls of each color:
--expect red=2 green=1
๐ฒ Running a Full Simulation¶
Example:
probability-calculator \
--hat red=3 blue=2 green=6 \
--expect red=2 green=1 \
--draw 5 \
--experiments 2000
Output:
Estimated Probability: 0.2385
๐ CLI Arguments¶
| Argument | Description |
|---|---|
--hat |
Define hat contents as color=count pairs |
--expect |
Required ball counts for success |
--draw |
Number of balls drawn per experiment |
--experiments |
Number of MonteโCarlo repetitions |
๐ง How It Works¶
- Parse colors and counts from CLI
- Construct a
Hatobject - Perform repeated draws
- Calculate how many experiments meet expectations
- Print probability estimate
๐ Related Documentation¶
Run your first simulation now! ๐ฒ