Designing a program to deal out seven card stud poker hands

This is a discussion on Designing a program to deal out seven card stud poker hands within the C++ Programming forums, part of the General Programming Boards category; Here's a good example of what I'm talking about that you need to get a grasp of in order to ...

  1. #16
    Use this: dudeomanodude's Avatar
    Join Date
    Jan 2008
    Location
    Hampton, VA
    Posts
    391
    Here's a good example of what I'm talking about that you need to get a grasp of in order to build your calculator:

    http://www.absolutepoker.com/poker-a...te-poker-odds/
    Ubuntu Desktop
    GCC/G++
    Geany (for quick projects)
    Anjuta (for larger things)

  2. #17
    Registered User
    Join Date
    Dec 2008
    Posts
    9
    Quote Originally Posted by dudeomanodude View Post
    I suppose you never read any of doyle brunson's books huh? (Neither have I), but I've skimmed through them and he teaches you exactly what I'm suggesting, how to know the odds. Yes, good poker players (like the ones you see on tv) know the odds. Obviously, they don't know what the other player's odds are, but you bet they know their own (they know it exactly, the same as they show next to their cards on the tv). Yes, they know it that well. So what difference does it make for your purposes? Once you knwo how to calculate the odds for one player (or hand), you know how to do it for 7 players, a million players, a million hands.
    Doyle doesn't teach you how to know the odds. Him and the other writers in that book give you rules based on their experience and doing computer simulations to find the probability of something occurring. Sure there are ways to know the odds of getting a pair of aces in holdem without dealing millions of hands. But how about working out why do a pair of aces play better against a small number of hands as suggested in this book. That is something poker authors don't explain. I want to find out how they work that out mathematically.
    Last edited by killsthehorse; 12-07-2008 at 10:45 PM.

  3. #18
    Registered User
    Join Date
    Dec 2008
    Posts
    9
    Quote Originally Posted by dudeomanodude View Post
    Here's a good example of what I'm talking about that you need to get a grasp of in order to build your calculator:

    http://www.absolutepoker.com/poker-a...te-poker-odds/
    I know how to work out all those odds manually. I don't want to build my calculator on texas holdem anyways.

  4. #19
    Use this: dudeomanodude's Avatar
    Join Date
    Jan 2008
    Location
    Hampton, VA
    Posts
    391
    Quote Originally Posted by killsthehorse View Post
    But how about working out why do a pair of aces play better against a small number of hands as suggested in this book.
    And I'm suggesting that a computer simulation doesn't give you that answer either.

    If a particular odd depends on how many hands are involved, there's still some mathematical reason behind it, not a some strange statistical distribution with some great deal of uncertainty as you're suggesting.
    Ubuntu Desktop
    GCC/G++
    Geany (for quick projects)
    Anjuta (for larger things)

  5. #20
    Registered User
    Join Date
    Dec 2008
    Posts
    9
    Quote Originally Posted by dudeomanodude View Post
    And I'm suggesting that a computer simulation doesn't give you that answer either.

    If a particular odd depends on how many hands are involved, there's still some mathematical reason behind it, not a some strange statistical distribution with some great deal of uncertainty as you're suggesting.
    Poker is a uncertain game. I know the intuitive reasoning behind that theory I posted above. But I do not know how to work it out mathematically and I thought maybe designing a program to deal out tons of hands in different situations could tell me that this theory (large pairs play better against a small number of opponents is correct)

  6. #21
    Use this: dudeomanodude's Avatar
    Join Date
    Jan 2008
    Location
    Hampton, VA
    Posts
    391
    Poker is not so uncertain to a computer however. Our only uncertainty lies within the cards that we don't know their value. In the case of 7card-stud, we don't know the value of the cards in the deck, burnt cards, or the face-down cards.

    So, let's say we have four players, each at the point where they have two down and one up. What do we know about the "uncertain" cards? If there are 52 cards in the deck, and we know for sure what 4 of them are, then all the "uncertain" cards share a 1/48 chance of being any card other then the face up cards, right?

    After the next face-up cards are dealt, the uncertain cards are 1/44 likely not to have the value of the face-up cards.

    Next round, 1/40.

    Next, 1/36.

    So what if we had 6 players? Let's do another go round...
    1st round: 1/46
    2nd round: 1/40
    3rd round: 1/34
    4th round: 1/28

    How about 8 players?
    1st round: 1/44
    2nd round: 1/36
    3rd round: 1/28
    4th round: 1/20

    So the uncertainty is definately chipped away as we add players to the table. This is pretty obvious. What's not obvious is the link between why a pair of aces is stand up better with fewer players....

    Well, as far as poker hands go, you have the best odds up front of getting a pair of anything as opposed to a straight or flush, right?

    When you have fewer players, and subsequently more cards left in the deck, it's more unlikely someone will get a hand like a straight or a flush, simply because less combinations of cards are occurring, make sense?

    Think about it, if one hand is dealt, what are the odds that hand contains a pair (regardless of what type of poker we're talking about)? But if 7 hands are dealt, what are the odds that at least one of those hands have a pair (the chances are better now).

    So I would say, that holding a pair of aces is good no matter how many people are playing, but are even better when fewer people are playing because statistically speaking, it's less likely a hand exists that can beat them.
    Ubuntu Desktop
    GCC/G++
    Geany (for quick projects)
    Anjuta (for larger things)

  7. #22
    Use this: dudeomanodude's Avatar
    Join Date
    Jan 2008
    Location
    Hampton, VA
    Posts
    391
    Think of it this way:

    Chances I'm dealt a pair: 1/220 (0.45&#37

    Chances 1 player is dealt a pair among 7 players: 7/220 (3.2%)

    100 players: 5/11 (45%)

    So the more players there are at a table, the more likely better poker hands exist then my pair of Aces.

    NOTE: The above odds are for getting a pocket pair in texas hold 'em. If you're considering a pker hand of 5 or 7 cards, a pair is much more likely, though this idea holds true for any type of poker hand.
    Last edited by dudeomanodude; 12-07-2008 at 11:47 PM.
    Ubuntu Desktop
    GCC/G++
    Geany (for quick projects)
    Anjuta (for larger things)

  8. #23
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    Quote Originally Posted by killsthehorse View Post
    Doyle doesn't teach you how to know the odds. Him and the other writers in that book give you rules based on their experience and doing computer simulations to find the probability of something occurring. Sure there are ways to know the odds of getting a pair of aces in holdem without dealing millions of hands. But how about working out why do a pair of aces play better against a small number of hands as suggested in this book. That is something poker authors don't explain. I want to find out how they work that out mathematically.
    Then take a course in probability; there's nothing that you can get out of a simulation.

  9. #24
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,434
    > 100 players: 5/11 (45&#37
    How do 100 players get dealt 2 cards each from a pack of 52 cards?


    > Then take a course in probability; there's nothing that you can get out of a simulation.
    Agreed.
    The odds of these games were worked out long before there were computers, nevermind before now where it might be reasonable to produce a meaningful sample size within a reasonable time-frame.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  10. #25
    The larch
    Join Date
    May 2006
    Posts
    3,573
    What's with all this elitism Why can't someone set up a Monte Carlo simulation if they so want?
    I might be wrong.

    Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.
    Quoted more than 1000 times (I hope).

  11. #26
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    Quote Originally Posted by anon View Post
    What's with all this elitism Why can't someone set up a Monte Carlo simulation if they so want?
    Maybe it's just me, but usually I can do the math correctly and the Monte Carlo not. (At least not the first time anyway.)

  12. #27
    The larch
    Join Date
    May 2006
    Posts
    3,573
    And with me it would be the other way round...
    I might be wrong.

    Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.
    Quoted more than 1000 times (I hope).

  13. #28
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,434
    Running a simulation would be fine, just don't use the standard library rand() to do it.
    http://www.eternallyconfuzzled.com/a..._art_rand.aspx
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  14. #29
    Use this: dudeomanodude's Avatar
    Join Date
    Jan 2008
    Location
    Hampton, VA
    Posts
    391
    No elitism concerning Monte Carlo. Personally, I think for calculating poker odds, it's more difficult to set up a simulation and extract meaningful data from it as opposed to figuring out the odds of whatever situation you're trying to get a handle on.

    The OP stated he wanted to figure out why certain cards play better against fewer opponents. I would rather go about it setting up a small iterative calculation that would produce the odds based on "i" number of players. Setting up a simulation involves: designing a deck of cards, creating the situation (involves partially designing the poker game itself), storing the output of the data, extracting meaning from the data... it gets complicated quickly.

    So seriously, no snobbery or elitism on my part, I just thought the better advice was to offer a simpler solution.
    Ubuntu Desktop
    GCC/G++
    Geany (for quick projects)
    Anjuta (for larger things)

  15. #30
    Registered User
    Join Date
    Jan 2005
    Posts
    7,317
    For some of the most complicated situations, the math can be difficult and easy to get wrong. (I have two kids and one is a girl, what are the odds the other is a girl?)

    Once you have the simulation working accurately then you can be reasonably confident in the numbers you receive, whereas doing it through math means that you must make an accurate calculation every time.

    Chances are somebody has already done the math for seven card stud, but it might be fun and good learning to try to create the simulation.

    >> How would I go about doing this? I know nothing about programming at all.
    Here's the sticky part, though. Without any programming knowledge, it will be very difficult to get this right. You have to start by learning a programming language. If C++ is your choice, spend a few months with Accelerated C++ and then you might be ready to start towards the simulation.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Card shuffle and deal want to put on Stack
    By sugie in forum C++ Programming
    Replies: 4
    Last Post: 12-12-2005, 07:40 PM
  2. Replies: 11
    Last Post: 10-24-2004, 10:28 AM
  3. Cribbage Game
    By PJYelton in forum Game Programming
    Replies: 14
    Last Post: 04-07-2003, 10:00 AM
  4. Need help with program for class
    By zakelua in forum C++ Programming
    Replies: 2
    Last Post: 01-02-2003, 02:39 PM
  5. Please Help w/ Messy Poker Program
    By ray in forum C++ Programming
    Replies: 1
    Last Post: 12-16-2002, 07:59 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21