How the cards are dealt on Whisthub

I regularly get emails - or complaints actually - from players telling me that they have been receiving bad cards for days, weeks or even months. Sometimes they even accuse me of intentionally giving them bad cards, which of course makes no sense. Once and for all: there is no system whatsoever that would favor certain players, and disadvantage other players. It doesn't matter if you're a new player or long-time user, a premium user or someone that has never paid for Whisthub, or anything else that you can come up with.

That being said, I do understand however why players get suspicious sometimes. After all, unlike in reality, you don't actually see the cards being dealt because this job is done for you by the computer. This means you have no control over the dealing process, and then if you keep on getting bad cards, it might feel like something is wrong.

To counter this, I've decided to write this blog post to explain how the computer deals the cards. Contrary to what you might think, the computer does not deal the cards at random. For every game that can be played on Whisthub, we always simulate what is normally done in real life, at least as far as we are aware. This makes sense if you think of it: in many card games it is often a part of the rules that you are not allowed to completely shuffle the cards between the deals!

Take Colour Whist for example. In this game, the cards are never shuffled between the deals, which leads to more extreme hands than if the cards were dealt at random. At the end of a deal, the tricks are simply collected per team, subsequently the player right from the dealer cuts the pack, and then the dealer hands out the cards in the pattern 4-4-5. In Manille for example, this pattern is 3-2-3.

Note that a team in Colour Whist can be a single player as well: when someone is playing a solo contract against the other 3 opponents, the solo player is considered to be a team, as are the 3 other opponents. In Kingen or Hearts there are obviously no teams, so the tricks are simply collected per player.

The way of collecting the tricks per team, shuffling the cards if the rules allow it, cutting the deck and then dealing the cards according to a pattern is exactly what happens on Whisthub too. The only difference is that in Whisthub's case, it's the computer that carries out the actions that a human would normally do. You just don't see them happening in front of your eyes.

Cutting the deck

But how does the computer exactly cut the deck? In real life, the player right from the dealer gets to decide where to cut the deck, but on Whisthub this is done by the computer too. How does this work? Well, the deck is cut randomly, but we do this according to a normal distribution instead of a uniform distribution. This means that the probability that the deck is cut somewhere in the middle is higher than that it is cut at the ends, with a minimum that at least 3 cards need to be cut.

The picture below visualizes how the deck gets cut by the computer. It shows at what position the computer would cut the deck in 1,000 simulations and uses the exact same code that is used when dealing the cards. The picture is dynamic, so you can regenerate it as much as you like!

You could argue that it would have been possible to allow the deck to be cut by the actual players on Whisthub, and you're right. Technically this is perfectly possible to do, but we've chosen to not allow this because it just complicates the entire flow of each game. You came to Whisthub to play cards, and not to do the work a computer can do for you, right? Allowing the players to cut the deck themselves adds very little value, so we've decided to not implement it.

Shuffling the cards

Not all card games require that cards are never shuffled though. For example, in Manille it is custom that the cards are shuffled after the tricks have been collected from the former game, but before the deck is cut.

However, there are various ways a deck can be shuffled. We could just randomly reorder the cards, but that's not what happens on Whisthub: we use an algorithm that actually simulates how humans shuffle a deck. This means that a random amount of cards is taken from the middle of the pack, and then these cards are placed at the back of the pack. This procedure is illustrated in the picture below and uses the actual code that we use when shuffling.

This procedure is then repeated 3 times, after which the deck is considered to be shuffled. Note that shuffling a deck this way is actually very different than if it were reordered completely at random. Cards still stay "closer" to eachother, but not as extreme as when the deck would not be shuffled.

If you want to see the difference between shuffling at random, or shuffling like a human would, then you can play with the interactive example below. The top image represents a randomly shuffled deck, and the bottom one represents a deck shuffled with the shuffling algorithm as used on Whisthub.

You can also play with the amount of times the shuffling procedure is repeated. The procedure is repeated 3 times by default - which is what is used when shuffling cards on Whisthub. You can see that the more you repeat the shuffling procedure, the closer the deck gets to being "randomly" shuffled!

The first deal

If you've paid good attention, you should realize that there is one aspect that we haven't covered yet: what happens on the first deal? After all, before we start playing, there are no tricks to be collected from the former game, as there is no former game. So what happens in that case?

Again, we always simulate what is custom in reality. In Colour Whist and Wiezen, it is custom that if you play with a new deck of cards, it is first fully shuffled, and then the cards are dealt. All players sort their cards as they normally would, but then give back their cards, the deck is cut and the cards are dealt according to the pattern 4-4-5. This is again exactly what happens on Whisthub too.

In games where shuffling is custom - such as Manille - we also predeal the cards, but before actually dealing them, the deck is still shuffled following the algorithm above. As you can imagine, predealing the cards instead of starting with a completely random deck of cards leads to more extreme hands with longer suits, typically meaning that a hand is considered to be "better".

To illustrate the difference between a random hand, and a hand from a predealt deck, we've added another interactive example below. It's difficult to visualize the differences in a single image, but if you hit the refresh button enough, you should start to notice that the predealt hand is on average "better" than the random hand because the suits are often longer, although the difference is subtle.

Random

Predealt

Here's the catch though: predealt hands might be "better" on average than random hands, remember that this is valid for all players around the table! You don't gain any advantage over the other players, because everyone has a better hand on average and hence has the ability to bid higher!

You can look at it this way. If all players have €100, then you are all equally rich. If you suddenly have €200, then you might think you're richer, but if everyone else suddenly has €200 too, nothing has fundamentally changed! You're all equally rich - or equally poor for that matter! Or to stay within a cards analogy, if you get dealt an Abondance, the chances are actually higher that the other players have good cards too, and it's more likely that your Abondance might be overbid by someone else having a higher Abondance!

Conclusion

I hope that this post makes it clear how the cards are actually dealt by the computer. I enjoyed writing it, especially because of the interactive examples that are really fun to play with!

Again, as you should be able to derive from the explanation above, there is no mechanism that would give someone intentionally bad cards. I have absolutely nothing to win with giving certain players intentionally bad cards, it would honestly be just a lot of work. I'm not some kind of evil mastermind that tries to sabotage players I don't like, and thinking I would do so is honestly just offensive. Actually, the more players there are on Whisthub, the better it is for me and the expansion of the website, so there's no point in chasing players away by cheating.

I fully understand that getting bad cards for long periods is frustrating, but it is what it is. The only thing you can do is keep on playing. If there's one thing statistics tells us, it's that in the very end, we will all have received equally good - or equally bad - cards!