Open Side Menu Go to the Top
Register
Excel Question Excel Question

08-03-2010 , 09:21 PM
So I'm trying to do random seeding for a tournament and want to place the numbers 1-32 randomly(or randomly sort the 32 entries). I tried using the data analysis pack rannum generator but don't know how to get it to not produce duplicates, is there anyway to do this? Thanks.
Excel Question Quote
08-03-2010 , 09:35 PM
I don't know if there's a built-in command but it's really easy to program this.

1.) create a vector of N pseudorandom numbers drawn from the uniform distribution on the interval (0,1). N = 32 in your case.

2.) sort the vector, computing only the index vector.

For example, let N = 4, and suppose our pseudorandom number generator throws out

0.6324 0.0975 0.2785 0.5469 (obv, this format is just for illustration, you'd really have 4 doubles).

Your index vector in this case is

2 3 4 1

and that's your seed.
Excel Question Quote
08-03-2010 , 09:36 PM
If it's sufficient when every outcome can only happen once every 1 million times (which isn't very random imo) use RAND.

The RAND function returns numbers from the interval [0,1), and if you need to generate numbers from another interval, you should use the following formula:

Code:
=RAND() * (b−a) + a
This will return random numbers from the interval [a,b) - greater than or equal to a, and less than b.

Otherwise, as it's only 32 numbers, you can use www.random.org for the ease of it.

Make sure your MSoffice has all updates, there were numerous bugs with RAND, like returning negative numbers (wtf?).

Last edited by wellju; 08-03-2010 at 09:37 PM. Reason: slow pony I is
Excel Question Quote
08-04-2010 , 12:07 AM
In laymans:

1) Enter all the numbers in column A (type '1' in A1, '2' in A2, then you can drag down with the mouse without having to enter any more data, and fill the remaining cells).
2) Enter a random number in B1 ("=RAND()"), copy and paste for all entries.
3) From Data tab, Sort columns A and B by column B.

You can do all these steps in a matter of seconds and minimal data entry - also, hit Recalculate (or just go into formula edit mode in one of the =RAND() cells and hit Return), and re-sort and you get a brand new order.
Excel Question Quote

      
m