Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Seed numbers for random number generation, uniform distribution | Excel Discussion (Misc queries) | |||
random numbers, how can you utilize it without repeating them | Excel Discussion (Misc queries) | |||
How to alter data on HTML webpage into Excell cells as numbers? | New Users to Excel | |||
Printing data validation scenarios | Excel Worksheet Functions | |||
Sort pages? | Excel Discussion (Misc queries) |