Post Reply 
Randomize a List problem
10-14-2020, 04:12 AM
Post: #29
RE: Randomize a List problem
(10-13-2020 07:13 PM)pier4r Wrote:  ...This because I was making a solver of a little game, where numbers and operators needed to be combined to get a certain number. The search was random and sometimes it took extremely long. Checking the frequencies, there were some permutations that were very rare or some elements weren't shuffled at all. At the moment I do not remember exactly were the discussion was.

I recall that you discovered a problem in an earlier version of the LSHUF command that resulted from its use of the SplitMix64 algorithm for shuffling. I'm pretty sure the issue resulted from the trailing low-order bits of the SplitMix64 result having a cycle of some sort. Since most implementations convert the result into a real number by dividing it by 2^64, the influence of those bits is very low in common use. In the case of LSHUF, the SplitMix64 result is instead treated as an integer for a MOD operation. Those last bits were creating a very noticeable bias and the fix was simply to discard the last 4 bits by shifting the 60 high-order bits to the right.

There's probably something in that very long thread about it. Or perhaps in an email discussion? I no longer remember where the discussion took place. Nor did a quick search find any mention of SplitMix64 having this issue, so my memory could be totally wrong. Smile But I did make a specific change to the LSHUF code to shift out the last 4 bits of the SplitMix64 output, and I wouldn't have done that arbitrarily. Wish I had put the specific reason in the comments.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Randomize a List problem - Hlib - 09-14-2020, 04:38 PM
RE: Randomize a List problem - John Keith - 09-14-2020, 06:08 PM
RE: Randomize a List problem - Albert Chan - 09-14-2020, 07:32 PM
RE: Randomize a List problem - Hlib - 09-14-2020, 08:51 PM
RE: Randomize a List problem - Albert Chan - 09-14-2020, 11:41 PM
RE: Randomize a List problem - Werner - 09-15-2020, 06:41 AM
RE: Randomize a List problem - Werner - 09-15-2020, 09:47 AM
RE: Randomize a List problem - Albert Chan - 09-15-2020, 04:36 PM
RE: Randomize a List problem - ijabbott - 09-15-2020, 06:39 PM
RE: Randomize a List problem - John Keith - 09-15-2020, 08:56 PM
RE: Randomize a List problem - Albert Chan - 09-15-2020, 09:34 PM
RE: Randomize a List problem - Werner - 09-16-2020, 06:43 AM
RE: Randomize a List problem - John Keith - 09-16-2020, 11:51 AM
RE: Randomize a List problem - Albert Chan - 09-15-2020, 01:00 AM
RE: Randomize a List problem - Wes Loewer - 09-15-2020, 04:10 AM
RE: Randomize a List problem - John Keith - 09-15-2020, 01:42 PM
RE: Randomize a List problem - Hlib - 09-15-2020, 03:57 PM
RE: Randomize a List problem - Albert Chan - 09-15-2020, 07:53 PM
RE: Randomize a List problem - Albert Chan - 09-17-2020, 12:11 PM
RE: Randomize a List problem - Hlib - 09-17-2020, 09:36 AM
RE: Randomize a List problem - John Keith - 09-17-2020, 12:20 PM
RE: Randomize a List problem - Albert Chan - 09-17-2020, 01:42 PM
RE: Randomize a List problem - John Keith - 09-17-2020, 08:21 PM
RE: Randomize a List problem - John Keith - 09-18-2020, 03:31 PM
RE: Randomize a List problem - Albert Chan - 09-18-2020, 10:19 PM
RE: Randomize a List problem - Albert Chan - 09-19-2020, 12:29 AM
RE: Randomize a List problem - pier4r - 10-13-2020, 07:13 PM
RE: Randomize a List problem - DavidM - 10-14-2020 04:12 AM
RE: Randomize a List problem - Albert Chan - 10-15-2020, 04:43 PM
RE: Randomize a List problem - DavidM - 10-15-2020, 06:24 PM
RE: Randomize a List problem - pier4r - 10-14-2020, 06:55 PM
RE: Randomize a List problem - DavidM - 04-26-2024, 03:17 PM



User(s) browsing this thread: 1 Guest(s)