Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Dana DeLouis
 
Posts: n/a
Default

Hi Alice. I believe this is a known problem. The first number in the list
follows a linear relationship with the seed.
With a 16 number output, the first number output runs from about 0 to 1 with
seeds 1 to about 10022. (It's a near perfect correlation. R^2 =
1.000000)With a seed of 10023, the first number drops back to near zero and
repeats the cycle.
So, when you seed with low numbers, there is little chance that another
number will be lower than the first one. As the seeds get larger, the first
number gets larger, and there are more chances that other numbers will be
lower than the first.

I was just curious, so I plotted the percentages that the first number was
the lowest out of 16. The plot starts out near 95% - 100% for a few hundred
numbers, and then exponentially decays to about 8% when reaching the largest
seed of 32767. Because of the "Bug", (err...I mean feature) it will never
get to the expected 6.25% (1/16).

If you would like to see a listing of the first number in the output, here
is a macro. There is no need to see all 32767, as the first few hundred
will show you the relationship.
Set a vba library reference to "atpvbaen.xls"
This takes a few minutes to run.

Here, the "C" is used as a seed number, and as a column pointer to store the
first output cell.

Sub Curious()
Dim C As Long
Const Random As String = "ATPVBAEN.XLA!Random"

[A:C].Clear

For C = 1 To 11000 '32767
[A1:A16].Clear
Run Random, Cells(1, 1), 1, 16, 1, C, 0, 1
Cells(C, 3) = Cells(1, 1)
Application.StatusBar = C
Next C
End Sub

HTH :)
--
Dana DeLouis
Win XP & Office 2003


"Allie" wrote in message
...
Hi,

I've been trying to generate random numbers using excel's random number
generator in the analysis toolpak. I'm using Uniform number generation
between 0 and 1, and I am using a random seed, as I would like to be able
to
re-generate the same numbers in the future.

Using seeds from 1 to 10, when i fill a range of 16 cells with random
numbers, the first cell filled is always the lowest. This is an extremely
unlikely circumstance with a true RN generator. I just wanted to raise
this
flag, as it could be affecting others without their knowledge.

Thanks,
Allie



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Seed numbers for random number generation, uniform distribution darebo Excel Discussion (Misc queries) 3 April 21st 23 09:02 PM
random numbers, how can you utilize it without repeating them RS Excel Discussion (Misc queries) 1 September 9th 05 05:01 AM
How to alter data on HTML webpage into Excell cells as numbers? roameri New Users to Excel 6 July 31st 05 11:42 PM
Printing data validation scenarios SJC Excel Worksheet Functions 14 July 24th 05 12:43 AM
Sort pages? David Excel Discussion (Misc queries) 15 May 13th 05 11:33 PM


All times are GMT +1. The time now is 04:28 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"