GithubHelp home page GithubHelp logo

pokercalc's Introduction

The high-card game

Probabilities are calculated for a simplified version of poker. Additional rules of the game will be added over time.

Current rules:

  • Players are dealt two cards each
  • Five community cards are dealt
  • A hand is the single best card, not the five best cards.
  • Community cards are not in play.
  • The player with the highest card (from their hole cards) wins.

Fun with math:

E: Known, set of cards in your hand and on the table.

D: Unknown, set of all other cards.

Rank(c): Rank of a card.

  • Rank(A) = 14, Rank(K) = 13, ... , Rank(J) = 11, Rank(10) = 10, ... , Rank(2) = 2.

Count(c): The count of a given card in E.

  • If there is a Jack in your hand and one on the table, Count(J) = 2.

Low(c): The count of cards of lower rank than a given card in E.

High(c): The count of cards of a higher rank than a given card in E.

Probability of a Draw

With the current rules, a draw is when two or more players share the high card. This formula calculates the probability that at least one other player has at least one card of the same rank (the high card).

$a$ is the count of cards dealt to other players;

$b = 3$ (the count of suits in the deck less one);

$c=a-b$;

$e = 4 - \text{Count(c)}$, the count of drawing cards in D;

$l = 4 (\text{Rank(c)} - 2) - \text{Low(c)}$, the count of lower ranked cards in D;

$L = |D| = 52 - |E|$, the cardinality of D, or the count of cards in D.

pokercalc's People

Contributors

de-manzanares avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.