How to use monte carlos method without using rand()
3 views (last 30 days)
I am trying to find a mass between 2 surfaces using monte carlos. Is there any way to use monte carlos without using the rand() function?
N=50; % points to draw
x=-2+3*rand(); % random number will be generated from -2 to 1 instead of 0 to 1
y=-4+5*rand(); % random number will be generated from -4 to 1
z=-6+7*rand(); % random number will be generated from -6 to 1
Walter Roberson on 11 May 2022
You need some source of randomness. It does not have to be truly random.
There are websites that you can connect to in order to draw random numbers.
There are hardware random number generators you can get. Famously, Silicon Graphics created a random number generator by monitoring a lava lamp.
You can do things like ask for the CPU cycle counter and put the value through a Hash function.
You can monitor keypress or mouse movement timings.