1

We are trying to calculate probabilities(and odds) for "bet on poker" game on which we are working now. To calculate probabilities and odds for each hand we used https://github.com/cookpete/poker-odds library. Now, having probabilities of "Royal Flush,Straight Flush, Four of a kind, Full house, Flush, Straight, Three of kind, Two pairs, One pair, High card" for each hand we are trying to calculate the same probabilities for entire table (for example we need probability that the winning combination of the table will be Royal flush) in this image we have probabilities of each hand but not for entire table

2
  • @RoryDaulton the question is: how to calculate probabilities of winning combinations (Royal Flush, Two pairs etc...) for entire table, having those probabilities for each hand.
    – einsh10
    Apr 6, 2019 at 12:34
  • 1
    What kind of answer would you prefer? A complete program implementing it for you? One pointing out the mistake in your code? What I want to illustrate by this is that your question is either too broad in not providing enough details of what you have tried yourself and a basic foundation for answers or it is unclear what exactly you are asking, which specific problem you need help with. Keep in mind that this community is about programming problems, not about math.
    – Yunnosch
    Apr 6, 2019 at 13:17

1 Answer 1

0

We have modified https://github.com/cookpete/poker-odds lib (which we used to calculate probabilities for each hands), especially calculate.js file and added 10 variables for each combination(var flush = 0, straight = 0 etc...), and after each iteration depending on winning combination I increment corresponding variable, at the end I have for example from 1000 iterations flush won 500 times , straight won 300 times and lets say pair won 200 times, after this we assume that the probability of flush 50%, pair 20% and the straight is 30%. I know this is not very accurate and not very professional approach, but it seems working until we can find better way :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.