Skip to content

Repository files navigation

🃏 Python Game Theory & Card Games EV Analyzer

Python Version License: MIT Data Science

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.


📊 Analytics Dashboard Preview

Visual overview of the quantitative analysis generated by the system:

Analytics Dashboard Preview


🧠 Core Mathematical Modules & Algorithms

The project is structured under a clean modular architecture to separate quantitative logic from execution and rendering:

  1. 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.
  2. 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.
  3. 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.
  4. graficos_analisis.py (Data Visualization)
    • Generates a multi-panel interactive analytics dashboard utilizing Matplotlib.

🛠️ Tech Stack

  • Language: Python 3.x
  • Numerical Computing: NumPy
  • Data Manipulation: Pandas
  • Data Visualization: Matplotlib
  • Mathematical Support: SciPy

⚙️ Installation & Setup

  1. 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

About

Simulador en Python que aplica Teoría de Juegos y Análisis de Datos (Monte Carlo, Equilibrio de Nash y Probabilidad Condicionada) para calcular ventajas matemáticas (EV) en Blackjack, Póker y Rummy.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages