Function andys_morning_stroll::multithreaded
source · pub fn multithreaded()Expand description
Multithreaded version of prob_of_longer_walk_in_the_kitchen.
I’ve got a computer with lots of cpus, and running a monte carlo with indpendent trials is silly to do single-threaded. So we can split this across a bunch of threads to do more trials.
Running this with about 1 billion iterations per threads over 8 threads, we get to about an estimate of our probability that the random walk is longer than 20 steps of: ~0.448