how are Poker hands decided?

Or perhaps you believe in true chaos like these people:


2 Answers 2


The accepted algorithm is Fisher–Yates shuffle. It was developed in 1938 and still sites have used bad algorithms.

-- To shuffle an array a of n elements (indices 0..n-1):
for i from n−1 downto 1 do
     j ← random integer such that 0 ≤ j ≤ i
     exchange a[j] and a[i]

A shuffle is uniform if all shuffles are equally likely.

Some shuffles have a problem of producing too many shuffles and some double up. The are 52! (factorial) shuffles and Fisher–Yates produces exactly 52! shuffles.

Fisher-Yates only uses random 2-52 (52 times) so there is not a problem with random producing 52! values. Getting a valid random is not that hard. There are not 52! seeds but still all hands are produced and uniform. You cannot look at your cards, flop, and turn and know a certain river card cannot happen or some will happen more than others.

You only see a subset of the cards so you cannot deduce the key from the cards you see. They don't shuffle a clean deck. They re-shuffle the last shuffle. And they still start with a new key every few hands.

Generate a sufficiently random key is not rocket science. They use time, atmospheric noise, mouse movement, and other random input to generate a key.

A site had a bug where the last card was never swapped and it was not readily discovered as the last card is never dealt.

Bad shuffles is back when things were just sloppy.


Nothing is random. Shuffles are not random especially on a computer, when it really comes down to it is all just cause and effect.

However things are random in the sense that they are statistically random, and in theory random in a practical sense for the game of poker (or any other card game).

Now there are holes in randomness with poker. In describing the random numbers used to determine a shuffle the terms entropy and causality are used.

With a computer shuffle the entropy is fine, large enough keys can be made to insure every possible hand, is possible with the RNG. However the causality is subject to failure because a key is used and the key if discovered can be used to reproduce the result. And also they result can be reversed engineered to give one a key. It has happened.

A hand shuffle on the other hand has generally the opposite problem in that there is not enough entropy in the typical shuffle to insure a random result. It is simply not possible with a typical house shuffle, starting at the same disposition of the deck that you have a shot at every possible result. So this presents a different set of problems that have been exploited.

With random numbers, nothing is perfect, not even the perfect stranger.

  • Do you think it was 'random' that you just scratched your nose? You just gave away via a 'tell' a pair of Aces. And who picks the 'key' anyway. Something must know the answer to these questions.
    – JMP
    Jan 26, 2015 at 13:30
  • @JonMarkPerry Key generation based on modern random number generation is better than it was in the Planet Poker days. There are lots of articles on random number generation that you can read on this topic. It's possible to generate a sufficiently unpredictable random number to make a good shuffle. Whether modern online poker sites actually do that is another question, I guess. Jan 26, 2015 at 13:47
  • @JonMarkPerry These days the keys are generally created by using background radiation noise. Look online for more, it is a very complicated subject.
    – Jon
    Jan 26, 2015 at 19:58
  • @ChrisFarmer Secure keys are easy, keeping them secure seems to be the failure point.
    – Jon
    Jan 27, 2015 at 20:42
  • Quantum effects are truly random. It is impossible, even in principle, to predict things like beta decay. Many microprocessors these days come with hardware the produces true random values from something like a quantum tunneling reverse-biased doide. Sep 18, 2017 at 19:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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