# RandomPoint fails with a large enough number of points

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 {StatisticsRandomNumberGenerationDumpx$138799[1], StatisticsRandomNumberGenerationDumpx$138799[2]}
in Function[{StatisticsRandomNumberGenerationDumpx$138799[1], StatisticsRandomNumberGenerationDumpx$138799[2]},2.1298 (1-<<46>>[1])^2
StatisticsRandomNumberGenerationDumpx$138799[1] (1- StatisticsRandomNumberGenerationDumpx$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.

• I cannot reproduce the problem with 10.3.1 on Mac. Why don't you upgrade to 10.3.1 and see if that fixes it? I think 10.3.1 is free for people with a 10.3.0 license. It's a bugfix release, so there's no good reason not to try it. – Szabolcs Feb 4 '16 at 10:59
• Is this reproducible with the number 152? I'm using the same version, and if I try with 100 it will sometimes work, sometimes not – Jason B. Feb 4 '16 at 11:02
• @JasonB I tried this and couldn't reproduce it: Monitor[ Do[Check[RandomPoint[\[ScriptCapitalR], k], Print[k]], {k, 5, 200, 3}], k ] I think that we'll need to use SeedRandom to get a consistently reproducible example. – Szabolcs Feb 4 '16 at 11:20
• @JasonB see update, it appears it is random seed-dependent. – shrx Feb 4 '16 at 11:59
• @shrx Added. Also reproduced in 10.2 Mac. There's no RandomPoint in 10.1 so the bug can't be present there. – Szabolcs Feb 4 '16 at 13:13