I don't know about the OP, but Joel's posted code used the VBA Rnd()
function. Prior to 2007, there were 3 distinct random number generators, the
worksheet function RAND(), VBA Rnd(), and the ATP random number generator.
None were very good before 2003, but their problems would arise as high order
autocorrelations between "random" numbers not as the kind of problems the
Joel was testing for. It is unlikely to show up in the process that the OP
seems to describe. Therefore I would want to know how the OP generated
"integer numbers between 1 and 6" and what the OP was using as expected
values.
A decent, but not great algorithm was implemented for worksheet RAND()
(requires SP1 patch to work properly) and carried into 2007. I have seen no
evidence that VBA Rnd() has ever been upgraded. RANDBETWEEN() became a
worksheet function in 2007, and therefore probably switched from using ATP
random number generator to using the worksheet RAND() function, though I have
seen no confirmation of this.
Joel's simulation shows departures from expectation that are NOT
statistically significant. Generating 10000 sums of 2 values using worksheet
RAND() and expected values of (6-ABS(7-tot2))/36, I tried several reps in
2003 with no statistically significant departure from expectation. The
following VBA code does 10 reps of 10000 using VBA Rnd(), and only one rep
was statistically different from expectation (again in 2003). Therefore, I
am somewhat skeptical of the OP's claims until more information is provided.
Jerry
Sub tryit()
Application.ScreenUpdating = False ' to speed execution
For j = 1 To 10
For i = 1 To 10000
x = Fix(Rnd() * 6) + Fix(Rnd() * 6) + 2 ' sum of two random
integers between 1 and 6
Cells(x, j) = Cells(x, j) + 1
Next i
Next j
Application.ScreenUpdating = True
End Sub
"Mike Middleton" wrote:
> yttrias -
>
> Which "excel 07 generator" are you using?
>
> RAND() worksheet function, or
>
> RND function in VBA, or
>
> Excel 2007, Data ribbon, Data Analysis, Random Number Generation tool ?
>
> - Mike Middleton
> http://www.DecisionToolworks.com
> Decision Analysis Add-ins for Excel
>
>
>
> "yttrias" <(E-Mail Removed)> wrote in message
> news:09EA2A85-AE22-4CB1-9537-(E-Mail Removed)...
> > I'm testing random numbers for games using excel 07 generator, but there
> > is
> > too much bias away from statistical expectation. For example, when two
> > integer numbers are generated between 1 and 6, and subsequently added, the
> > results differ from the easily predictable numbers. Sevens are
> > consistently
> > in short supply by about 1.5%. That's a lot! Any suggestions for better
> > randomization in excel would be very much appreciated.
> > --
> > yttrias
>
>
>