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],
  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.

  • $\begingroup$ 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. $\endgroup$ – Szabolcs Feb 4 '16 at 10:59
  • $\begingroup$ 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 $\endgroup$ – Jason B. Feb 4 '16 at 11:02
  • $\begingroup$ @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. $\endgroup$ – Szabolcs Feb 4 '16 at 11:20
  • $\begingroup$ @JasonB see update, it appears it is random seed-dependent. $\endgroup$ – shrx Feb 4 '16 at 11:59
  • 1
    $\begingroup$ @shrx Added. Also reproduced in 10.2 Mac. There's no RandomPoint in 10.1 so the bug can't be present there. $\endgroup$ – Szabolcs Feb 4 '16 at 13:13

The bug appears to be fixed in the latest version of Mathematica (10.3.1), as confirmed by @JasonB and @Szabolcs.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.