Fortran program to calculate texas hold em odds

  • Context: Comp Sci 
  • Thread starter Thread starter mike81
  • Start date Start date
  • Tags Tags
    Em Fortran Program
Click For Summary

Discussion Overview

The discussion revolves around calculating the odds of winning in Texas Hold'em poker when dealt specific cards, specifically King and 9 of clubs. Participants explore the complexities of the game, including the rules, hand rankings, and the impact of player behavior on outcomes. The conversation includes programming aspects related to implementing these calculations in Fortran.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant suggests storing winning hands in tiers and counting the number of hands below to calculate odds, questioning if this is a solid start.
  • Another participant raises concerns about the variability in Texas Hold'em rules and how they affect winning chances, including the impact of player psychology and folding.
  • A later reply formalizes the problem by outlining the card distribution and suggests a probability theory approach to construct a function that calculates winning odds based on the number of players.
  • One participant provides a breakdown of hand types and their probabilities before the flop, emphasizing the need to estimate outcomes against a fixed opponent's hands.
  • Another participant argues that if the scenario involves only one opponent, the winning chance becomes a constant, suggesting that the problem is more about probability theory than programming.

Areas of Agreement / Disagreement

Participants express differing views on whether the problem is primarily a programming question or a probability theory question. There is no consensus on how to approach the calculation or the assumptions involved in the scenario.

Contextual Notes

Participants note the ambiguity in the original question and the need for clear definitions of terms and conditions, such as the number of players and the rules of play, which remain unresolved.

Who May Find This Useful

This discussion may be useful for individuals interested in poker probability calculations, programming in Fortran, or the strategic elements of Texas Hold'em.

mike81
Messages
6
Reaction score
0
The instructions are to calculate the odds of winning if you are dealt King and 9 of clubs, what are the odds of winning? I am finding myself spending more time trying to figure out texas hold em (never played before) than writing the program. So far I found a list on wiki that breaks down the winning hands by tiers. I am thinking to store the winning hands into the 8 tiers and based upon where it falls the program will count the number of hands below and divide to give the odds. I am thinking to set up the tiers into arrays? Does this sound like a solid start? I have spent too much time on the game and not enough on the program and am running out of time.
 
Physics news on Phys.org
There are many different Texas hold 'ems, different rules for what beats what, split pot or do you judge on colour? Can you form a straight ace high with A+2+3+4+5, does this win or lose from the top straight? Is there a small straight? All these things naturally affect the chance.

Also, what is the dependent value? I mean, I take this is at least the number of players playing, if this is also fixed, then you don't really have a program, you have a constant number that doesn't change. For it to be a program the idea is that it depends on some input.

Another thing that doesn't make sense to me about this question is the fact that people can fault, it's perfectly possible that some one who had a hand that beats yours faults, so you need some chance of people randomly folding, to which psychology comes into play?

So I take it you're supposed to assume that all players play until the end for this experiment and there is no human intervention basically.

So more formally your problem can be expressed (probably) as:

- There are 52 cards
- each player receives 2 of those at random | you get king and 9 of clubs
- of the remaining cards, 5 of those end up randomly in the river so that each player has 7 cards, of which it shares those five with other players
- on those combinations is a total order

finally:

- what is the chance that the combination starting with 9 and king of clubs is the largest element of the set of all the combination the players make under that order.

If you look at it this way, there is with some probability theory an ability to just construct a function which takes the numbers of players as input, and the chance as a rational number as output. All you need to do is formulate that formula into an expression and you're done. This is hardly a problem of programming, rather it is of probability theory.

But, the question you pose here is vague, I had to do a lot of interpretation as I noted, so I'm not sure my formalism of the problem is the problem you intuitively described.

Edit: For strategy, I would start with the total order and define it, an orderning function that takes in two sets of seven cards and determines which is higher.
 
Sorry I probably should have just posted the question. Here it is,
(3) Time to win at Texas Hold-em. You are getting two cards. It could be a pair (5.9% chance), it could be suited (23.5%, good for flush prospects), it could be unsuited and unpaired (70.6%). At this stage, before ‘the flop’:
• Pair beats other cards unless both cards better (overcards) to the pair.
• Suited beats non-pair unless one of the other cards is an overcard
• Unpaired & unsuited beats same if it has the overcard, otherwise tie.
You’re dealt {K,9} of clubs “the black dog”. The opponent has one of 50x49=1,225 hands. Use a program with the rules above to estimate outcomes for each hand. Divide winning situations by losing situations (ignore ties). What are the ‘odds’ of you winning?
 
Well, from that story, it can be implied that you have only one opponent and this is fixed.

Therefore, the chance of you winning in that story has no dependent variable any more, it's a constant.

Your program will look similar to

print(that_constant);

(as you can see I don't know Fortran)

This isn't really a programming question as I said, this is probability theory.
 

Similar threads

  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 2 ·
Replies
2
Views
4K