Troubling Bug involving RandomReal, NestList, and Table
- To: mathgroup at smc.vnet.net
- Subject: [mg86236] Troubling Bug involving RandomReal, NestList, and Table
- From: "jwmerrill at gmail.com" <jwmerrill at gmail.com>
- Date: Thu, 6 Mar 2008 03:02:06 -0500 (EST)
When making tables of 250 or more directions, Mathematica seems to
forget how to do arithmetic. I realize these "random" directions are
not properly uniform, but that's beside the point.
$Version
> "6.0 for Mac OS X x86 (32-bit) (April 20, 2007)"
randomDirection3[] :=
NestList[Sqrt[1 - #^2] &, RandomReal[], 1]
ListPlot[Table[randomDirection3[], {249}], AspectRatio -> Automatic]
ListPlot[Table[randomDirection3[], {250}], AspectRatio -> Automatic]
> [Graphs you'll need to generate for yourself]
Variance[Table[Norm[randomDirection3[]], {249}]]
Variance[Table[Norm[randomDirection3[]], {250}]]
> 1.49104*10^-33
> 0.0513843
What!?!
Jason Merrill
- Follow-Ups:
- Re: Troubling Bug involving RandomReal, NestList, and Table
- From: Darren Glosemeyer <darreng@wolfram.com>
- Re: Troubling Bug involving RandomReal, NestList, and Table