Feel like there's something seriously wrong with the randomization

I’ve been playing for some months on this simulator and yet I still feel like there’s something wrong in the randomization of cards, I’ll post these pics so you get what I mean

These were taken during several matches/test hands in the span of 3/4 months, I know hands like these can happen, but I don’t even play that much so it’s not like it’s one in a thousand chance to get a hand like this, it’s more like one in eight matches I get a hand like this, 3x of the same card
Hope I’m the only one getting this problem, or maybe I just don’t get what True Randomization is supposed to look like

The most common misconception is thinking that randomization means “fair”. The same thing happens when people go to a casino and play the slot machine. They think after several “unlucky” tries they are eventually “owed” a lucky result. This type of thinking is when we think sampling from a population is without replacement.

The same thing happens whenever people try any of the auto sims. They “expect” the sim to give a good hand after many bad hands. I can assure you that automatic simulators of all card games including Poker are using the same randomization method for shuffling and it hasn’t changed in the last 20 years - it’s called Mersenne Twister. The code is even open sourced and used by every ygopro sim. You can find the code here: ygopro-core/mtrandom.h at master · Fluorohydride/ygopro-core · GitHub

No matter how bad your hands are, simulators are more randomized than real life.I know it sucks to brick and even if you draw all 3 copies of a card, that is still a chance. Even when the chance of an event is low, it does not mean that it won’t happen. People believe that only events that have a high probability of happening will always happen. Probability just doesn’t work that way. In fact, we can build programs that test hands after 100,000 iterations and then count the number of times you draw 3 copies of a card. We’ve done this.

I created a faq entry for this both on the site and on discord, Q12 in the #faq_omega channel. I’ll copy paste it here:

The shuffling algorithm used by all simulators, both Dueling Book/Dueling Network and all ygopro-based simulators, as well as simulators like MTG Arena, Hearthstone, Runeterra, etc. and every other digital card game is called Fisher-Yates. This is the best shuffling algorithm used in Computer Science.

The way it works is that each card in the deck from top to bottom is placed randomly in a position in the deck. In real life, shuffling techniques like riffle, pile, and hindu are not randomizing every card in your deck. These are imperfect algorithms. In the casino, you do have shuffling machines to help with this but even that is not as good as Fisher yates.

So let’s say you have a 40-card deck. Each card in the deck has a position from 1-40, 1 being the top card. Imagine now that each of those cards gets a random number picked between 1-40. That random number now is its new position. This works sequentially from top to bottom so there isn’t any conflict with 2 cards having the same position.

You can read about it here:

Now, the next question should be what algorithm determines the random number generation (RNG) of the position? That is Mersenne-Twister, one of the best algorithms as well.

We even have the open source code here for review: ygopro-core/mtrandom.h at master · Fluorohydride/ygopro-core · GitHub

MTG Arena: The MTG Arena Shuffler: Just Chill Out - Draftsim https://www.reddit.com/r/MagicArena/comments/b21u3n/i_analyzed_shuffling_in_a_million_games/

1 Like

Somehow seeing this whole randomization rant never gets old to me XD

Yea, the only thing that I see that could cause problem with this code is in the seed that is chosen (a bad seed can ruin the best rand code). Also, how it is chosen(for example, if the rand-seed is reset at each start of the game and is chosen in a selection you could have the same pattern of shuffle repeated over and over again).

(I don’t say it’s the case, and I am sure it’s, like AMM said, only a psychological/luck thing)