3

I apologize in advance for the vagueness, but I can't think of a more descriptive title. I am trying to find the average value of the square of BesselJ[0, x] evaluated over many lists. The function I am using is

f[h_, n_, m_] := Mean[BesselJ[0, h Table[Accumulate[Table[RandomChoice[{-1., 1.}], {j, n}]], {k, m}]]^2];

I am looking for ways to speed up this function for large values of n and m. Compiling doesn't help here since BesselJ is not compilable.

J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
user64620
  • 581
  • 2
  • 11

0 Answers0