Bug introduced in 10.2.0 and fixed in 10.3.1.
RandomPoint
is new in 10.2.0.
I have defined a simple ellipsoidal parametric region:
With[{a = 10, b = 7, c = 1.5},
ℛ = ParametricRegion[{a Cos[u] Cos[v], b Cos[u] Sin[v], c Sin[u]},
{{u, -π/2, π/2}, {v, -π, π}}]
];
I would then like to generate some (thousands) of random points inside this region.
However, RandomPoint[ℛ, n]
fails if n
is 152 or larger (determined with trial & error).
pts = RandomPoint[ℛ, 152];
Function::flpar: Parameter specification {Statistics`RandomNumberGenerationDump`x$138799[1], Statistics`RandomNumberGenerationDump`x$138799[2]} in Function[{Statistics`RandomNumberGenerationDump`x$138799[1], Statistics`RandomNumberGenerationDump`x$138799[2]},2.1298 (1-<<46>>[1])^2 Statistics`RandomNumberGenerationDump`x$138799[1] (1- Statistics`RandomNumberGenerationDump`x$138799[2])^3+<<11>>+1.91753 <<1>>^3 << 1>>^3] should be a symbol or a list of symbols. >>
Is this a bug? I'm using Mathematica 10.3.0 on Xubuntu Linux 15.10.
Update:
The behavior is random seed-dependent. For example, with SeedRandom[4]
, I get no errors. With 1, 2, 3 or 5, I do.
With the code
Monitor[Do[Check[RandomPoint[ℛ, n], Print[n]], {n, 5, 200}], n]
the smallest n
which fails is so far 14.
Update 2:
After some more testing, I believe it can fail with any n
.
Monitor[ Do[Check[RandomPoint[\[ScriptCapitalR], k], Print[k]], {k, 5, 200, 3}], k ]
I think that we'll need to useSeedRandom
to get a consistently reproducible example. $\endgroup$ – Szabolcs Feb 4 '16 at 11:20