card-games-python is an open-source data science and game theory project that demonstrates how mathematical modeling, statistical analysis, and algorithms can identify Expected Value (EV+) and minimize the house edge in classic card games: Blackjack, Poker, and Rummy.
Visual overview of the quantitative analysis generated by the system:
The project is structured under a clean modular architecture to separate quantitative logic from execution and rendering:
blackjack_ev.py(Monte Carlo Simulation)- Simulates thousands of hands using standard Basic Strategy.
- Leverages the Law of Large Numbers to track Return to Player (RTP) convergence and estimate the house edge.
poker_nash.py(Game Theory / Nash Equilibrium)- Models a zero-sum river scenario as a 2x2 matrix game.
- Uses linear algebra (
np.linalg.solve) to compute exact mixed-strategy optimal frequencies for Value Betting vs. Bluffing.
rummy_odds.py(Conditional Probability & Combinatorics)- Reduces sample space based on visible information (player's hand, table cards, known discards).
- Compares deterministic choices (taking from the visible discard pile) versus stochastic draws from the blind deck.
graficos_analisis.py(Data Visualization)- Generates a multi-panel interactive analytics dashboard utilizing Matplotlib.
- Language: Python 3.x
- Numerical Computing: NumPy
- Data Manipulation: Pandas
- Data Visualization: Matplotlib
- Mathematical Support: SciPy
- Clone the repository:
git clone [https://github.com/a921-h/card-games-python.git](https://github.com/a921-h/card-games-python.git) cd card-games-python
