Tag: random
4 posts
-
C++ random | Engines, distributions, and replacing rand()
C++11 random: random_device seeding, mt19937, uniform and normal distributions, shuffle, weighted picks, threading, and when to use a cryptographic RNG.
-
C++ std::random_device | Hardware entropy for seeding
How random_device maps to OS entropy, using entropy(), seed_seq for mt19937, UUID and token examples, performance vs mt19937.
-
C++ Random Numbers in Practice: Seeding, Reproducibility, and Common Pitfalls
Practical C++ <random> pitfalls: why rand() % n is biased, why one 32-bit seed is not enough for mt19937, why the same seed gives different numbers on different compilers, and when you need a CSPRNG instead.
-
C++ Random Distributions: Choosing and Using uniform, normal, Poisson, and discrete
C++11 random distributions explained by what they model: uniform, normal, Bernoulli, binomial, Poisson, exponential, and discrete, plus range rules, reset(), per-call parameters, and the modeling mistakes that skew simulations.