Post Reply 
Shuffling arrays question
02-28-2015, 11:55 PM (This post was last modified: 03-01-2015 03:33 AM by Mark Hardman.)
Post: #2
RE: Shuffling arrays question
(02-28-2015 10:42 PM)Namir Wrote:  Does anyone know of an algorithm to shuffle an array of integers WITHOUT USING RANDOM NUMBER FUNCTIONS? I discovered a good (not the best) method for generating random numbers is that you start with an array of n elements (with values from 1 to n), shuffle the elements of that array and then divide each array element by n+1. You get a good set of random numbers. I can do the shuffling using random number functions, like randperm in Matlab. I am looking for a way to shuffle the array (initially in ascending or descending order) using clever swaps of elements. I am basically looking to transform perfect order into as perfect chaos as possible!

Namir

You might be able to get a random order using a perfect shuffle:

The Mathematics of Perfect Shuffles

Thank you for your continued efforts in pushing the limits of randomization. Fascinating stuff.

Ceci n'est pas une signature.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Shuffling arrays question - Namir - 02-28-2015, 10:42 PM
RE: Shuffling arrays question - Mark Hardman - 02-28-2015 11:55 PM
RE: Shuffling arrays question - Paul Dale - 03-01-2015, 12:42 AM
RE: Shuffling arrays question - Namir - 03-01-2015, 01:10 PM
RE: Shuffling arrays question - Namir - 03-01-2015, 06:48 PM
RE: Shuffling arrays question - BruceH - 03-07-2015, 05:56 AM



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