A Python-based binomial distribution calculator that mimics the functionality of TI-84 Plus calculators. This tool provides an interactive command-line interface for calculating various binomial distribution probabilities.
This project implements binomial distribution calculations commonly found in TI-84 Plus calculators. It allows users to calculate:
- P(x > a) - Probability that x is greater than a
- P(x >= a) - Probability that x is greater than or equal to a
- P(x < a) - Probability that x is less than a
- P(x <= a) - Probability that x is less than or equal to a
- P(x = a) - Probability that x equals a
The calculator uses the binomial probability mass function (PDF) and cumulative distribution function (CDF) to compute these probabilities based on user-provided parameters (number of trials, probability of success, and value of interest).
Let's calculate P(x = 3) for a binomial distribution with n=10 trials and p=0.5 probability:
===============================
Welcome to the Bino Library
1. P(x > a)
2. P(x >= a)
3. P(x < a)
4. P(x <= a)
5. P(x = a)
===============================
Enter your choice (1-5): 5
Calculating P(x = a)...
Enter the number of trials (n >= 0): 10
Enter the probability of success in decimal (0 <= p <= 1): 0.5
Enter the value of a (a >= 0): 3
The answer is: 0.1171875
Push enter to continue.
This project is intended to run on a TI‑84 Plus CE (Python edition). To transfer a program to your calculator, use TI Connect™ CE (Windows or macOS) and follow the steps below.
Prepare the program file
- Download the release for the calculator from the project's Releases page (the release for the calculator contains only the files intended for the TI‑84 Plus CE).
- If you downloaded a release archive, extract it. If the release contains multiple files, the file you should open in the calculator is
BINODIST.py.
Transfer with TI Connect CE (Windows / macOS)
- Install TI Connect CE from Texas Instruments: https://education.ti.com/en/products/computer-software/ti-connect-ce-sw
- Connect your TI‑84 Plus CE to your computer with the USB cable.
- Open TI Connect CE and open Device Explorer.
- In Device Explorer, open the calculator's Python folder.
- Drag-and-drop your
.pyfile into the Python folder (or use "Send to Device"). - On the calculator open the Python app, find the program and run it.
Notes for Linux users
- TI Connect CE doesn't have a native Linux version. Options:
- Run TI Connect CE under WINE or in a Windows VM and use Device Explorer there.
- Transfer the file from a Windows or macOS machine that has TI Connect CE installed.
Contributions are welcome! Here's how you can help:
If you find a bug or have a suggestion:
- Check if the issue already exists in the Issues section
- If not, create a new issue with a clear description and steps to reproduce (for bugs)
- Fork the repository
- Create a new branch for your feature (
git checkout -b feature/YourFeature) - Make your changes
- Write or update tests as needed
- Ensure all tests pass (
pytest test/) - Commit your changes (
git commit -m 'Add some feature') - Push to your branch (
git push origin feature/YourFeature) - Open a Pull Request with a clear description of your changes
Binomial-Distribution-TI84Plus/
├── src/
│ ├── BINODIST.py # Main program with interactive menu
│ ├── LIB_BIN.py # User interface and probability calculation functions
│ ├── LIB_MATH.py # Core mathematical functions (nCr, binopdf, binocdf)
│ └── __init__.py # Package initialization
├── test/
│ └── test_math.py # Unit tests for mathematical functions
├── requirements.txt # Python dependencies
├── setup.py # Package setup configuration
├── dockerfile # Docker configuration
├── docker-compose.yaml # Docker Compose configuration
└── README.md # This file
- Follow PEP 8 style guidelines for Python code
- Write meaningful commit messages
- Add tests for new functionality
- Update documentation as needed