One approach of using random number generation inside a function without affecting outer state of random generator. Prologue Let’s say we have a deterministic (non-random) problem for which one of the solutions involves randomness. One very common example of such problem is a function minimization on certain interval: it can be...