How to programming of calculating probability of 7 poker's...?

7 poker.

As you may well know,

there are 4~5 players.

and when game start, each player get 5 cards, and open 3 cards among them, and keep 2 cards as secret to others.

At this point,

how programming calculating the probability of make a poker score(one pair, two pair, 4 cards, straight, ,) when he receives next 6th card. And then after get 6th card, before get 7th card’s probability of himself and other’s probability about each poker score tree.

Any directional tip or reference site for right way will be appreciated.

I would start by learning how to calculate probabilities:

then apply what you learnt on poker:

It’s pure math after just script the equations

EDIT: In your calculation, do you know what the others have ? (like the stats when you watch poker on tv) Or just the probability for you only, without knowing what the others have. That makes a big difference.

Each player can see other player’s opened 3 cards, but can’t see other 2 cards. (When they all received first 5 cards)

I’m sorry I never played the 7 card poker, but can you see your two cards down ? if you do, for the probabilities do you want them like for the stats showed on tv or stats for your point of view ?

If at the start each player receive 1 card up and 2 down:(in the case when you can see your 2 cards down)

On your point of view:

you know: numbersOfPlayers*1 + your two hidden cards.
you don’t know: (numbersOfPlayers-1)*2 cards
and there are 52 - (numbersOfPlayers)*3 cards left in the deck

On the point of view of a spectator (tv stats):

we know (numbersOfPlayers)3 cards
we know that there are 52 - numbersOfPlayers
3 cards left in the deck

example: you want to go for 4 of a kind Ace. You’ve got 2 aces.
for your point of view in the deck it should be probably remain 2 aces… but maybe two others players have 1 ace each, in that case, it’s impossible for you to get the 4 of a kind. In a spectator point of view, we know that you’ve got 0% chances to get the 4 of a kind, but in your point of view, it is still doable.

You really need to know what probabilities you want to know because in the math it makes a big difference.
I hope i’m clear in my explanations :smile:

yes I know that, and sorry for not said enough.

And yes player can know own all 5 cards.

At start of game, each player receive 5 cards, and open 3 cards and keep secret 2 cards, then receive 1 card and it opened, and then receive 1 more card. And when he get 7 cards, he now have 4 opened cards and 3 secret cards, he choose last 1 card to open from his hand’s 3 cards, and that opened 5 cards make poker score if it can.

And I want probability of [player point of view] , not point of spectator.

And probability of himself’s each poker score’s probability, and other player’s probability based on thier’s opened 3 or 4 cards.

And here I have one question,

What must denominator value to calculate himself’s probability of poker score when he will receive 6th card?

35 (52-5(himself’s card) -12(3 opened cards * 4 player)) ?

or

27 (above 35 - hidden 8 (2 cards * 4 player) cards) ?

So that his one pair probability when he receive 6th card is,
eventually he already received 5 cards, so all possibility remaining is, 35 cases when he received 6th card. Then, that probability is,

(cases making one pair between 35 cases) / 35 ?
or
(cases making one pair between 35 cases) / 27?

Check the “Derivation of frequencies of 7-card poker hands”

I haven’t done probabilities in years I go for lunch now, I’ll take a look after or tonight :wink: