PDA

View Full Version : Shuffling



htesrepus
06-05-2014, 12:29 PM
So I've posted on this before. I've read all the information out there on how its very difficult to achieve true randomness in shuffling. Ok, I get that and I agree. When I get a response from the mods, the word sufficient is used to describe the shuffling system. Define sufficient and by what parameters did you determine the shuffling is indeed sufficient? I've put a probably a good hundred or so games under my belt (I'm not some guy thats played 4 games and am trying to flame everyone) and I see a pattern in each game. The cards will come out in clusters, meaning you see spurts of the same card quite frequently during games. I understand its hard to create randomness, but I find it far from sufficient. So here are my questions about the randomizer you use.

1. When shuffling the deck, how many times does the randomizer "shuffle" the deck?

2. Prior to the randomizer "shuffling" the deck are the cards stacked together with each like card?

Yoss
06-05-2014, 12:39 PM
1. once
2. doesn't matter

Look up Fisher-Yates shuffler. The only thing that matters is having a good pRNG, which we have an article about over in the Articles forum.

Fisher-Yates Shuffle (link) (http://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle)
Ranomization Article (link)

htesrepus
06-05-2014, 12:54 PM
I'm assuming they use a Fisher-Yates Shuffler. Do they assign a random number to each element of the set to be shuffled and then sort the set according to the assigned numbers?

Yoss
06-05-2014, 01:02 PM
Do they assign a random number to each element of the set to be shuffled and then sort the set according to the assigned numbers?

Not exactly, no. Sorting is computationally expensive, and unecessary for shuffling. Did you read the article?

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

Showsni
06-05-2014, 01:07 PM
A sufficient shuffler is one where after shuffling, each card has an equal chance of being in any position in the deck. (For example, if it's more likely the top card ends up in the top half of the deck then the shuffle wasn't sufficient).

Yoss
06-05-2014, 01:08 PM
A sufficient shuffler is one where after shuffling, each card has an equal chance of being in any position in the deck. (For example, if it's more likely the top card ends up in the top half of the deck then the shuffle wasn't sufficient).

Yes. (Not sure your point though.)


The Fisher–Yates shuffle is unbiased, so that every permutation is equally likely.

Werlix
06-05-2014, 01:24 PM
So I've posted on this before. I've read all the information out there on how its very difficult to achieve true randomness in shuffling. Ok, I get that and I agree. When I get a response from the mods, the word sufficient is used to describe the shuffling system. Define sufficient and by what parameters did you determine the shuffling is indeed sufficient? I've put a probably a good hundred or so games under my belt (I'm not some guy thats played 4 games and am trying to flame everyone) and I see a pattern in each game. The cards will come out in clusters, meaning you see spurts of the same card quite frequently during games. I understand its hard to create randomness, but I find it far from sufficient. So here are my questions about the randomizer you use.

Sufficient = more than 100 games. Have you read https://hextcg.com/randomization/ ?

They've tested millions of events to make sure it is "sufficiently" random. Remember they're using "sufficient" in its scientific meaning... meaning that it's random enough that you will never, ever have a perceptible problem randomising a 60-card deck.


1. When shuffling the deck, how many times does the randomizer "shuffle" the deck?

:facepalm:


2. Prior to the randomizer "shuffling" the deck are the cards stacked together with each like card?

:facepalm:

NemesiN
06-05-2014, 04:29 PM
My main question about the shuffler is does it riffle shuffle or pile shuffle? I don't want it damaging my cards. I especially hope it doesn't bend my cards too much when it bridges them back together...

The shuffler doesn't "shuffle" the cards, it just randomizes them people. Get the physical idea of shuffling out of your head.

Yoss
06-05-2014, 04:30 PM
Seems we have a troll in our midst.

mach
06-05-2014, 04:33 PM
Sorting is computationally expensive

Sorting is not computationally expensive, especially when we're dealing with numbers like 40 or 60 objects.

Yoss
06-05-2014, 05:40 PM
Sorting is not computationally expensive, especially when we're dealing with numbers like 40 or 60 objects.

You're right, for 60 objects it's not a big deal. Still, it's significantly moreso than FY shuffle. O(n) vs O(n log n) And why do needless ops?