Skip to main content

New answers tagged

4 votes

How can I generate a random number within a function and use the result repeatedly in the same function?

You have to generate your random index only once, for example using With (or Module): ...
Domen's user avatar
  • 26.5k
7 votes

How to use Mathematica to find the maximum expected value of multiple normal distributions?

This is only a partial answer in that it only provides the means for $n=2$ through $n=5$. With $n>6$ Mathematica only returns the input. ...
JimB's user avatar
  • 41.9k
6 votes

Why is random sampling with ordinary and compiled code so different?

Your hackery way of injection function definitions into Compile is the root of your troubles. Observe the output of the following code: ...
Domen's user avatar
  • 26.5k

Top 50 recent answers are included