Re: Random array (fwd)
Forwarded message:
Date: Thu, 29 Oct 1998 20:04:57 -0800 From: Jim Gillogly <jim@acm.org> Subject: Re: Random array
One could modify Greg's suggestion slightly by attaching an auxiliary array of 256 random numbers to each of the members of the original array and then using the most efficient handy sort algorithm to sort those random numbers, dragging along their associated original array elements. This way it doesn't have a chance to interfere with the operation of the sorting algorithm, at the cost of an extra array.
So you've got a set of arrays that have 256 numbers in them, whether they are random or not is irrelevant since we're going to sort them and break their randomness. It is merely sufficient that they all be reasonably (what the hell ever that's going to mean) different, if they're all 6's for example it isn't going to be very interesting. If I understand the process. Each array would cycle through in parallel sorting 2 elements of each array. Once that was finished we'd then sort the arrays themselves according to some process. From your description it seems to imply that you're going to sort the 1st element descending at that point. This in effect mis-orders each array after every sort. This sort of system is an IFS and could lead to determinism (ie a cycle of sort patterns that repeat endlessly) or chaos (ie a pattern that doesn't repeat). It in and of itself doesn't guarantee any randomness merely a continously munged sort. ____________________________________________________________________ To know what is right and not to do it is the worst cowardice. Confucius The Armadillo Group ,::////;::-. James Choate Austin, Tx /:'///// ``::>/|/ ravage@ssz.com www.ssz.com .', |||| `/( e\ 512-451-7087 -====~~mm-'`-```-mm --'- --------------------------------------------------------------------
participants (1)
-
Jim Choate