Skip to content
Tagged articles

random number generation

8 articles · Page 1 of 1
Laravel Tech Community
Laravel Tech Community
Nov 23, 2022 · Backend Development

Understanding PHP mt_rand and Five Ways to Generate Random Numbers

This article explains how PHP's mt_rand function works, its deterministic nature when the seed and PHP version are identical, and demonstrates five distinct code techniques—including range‑shuffle, unique random loops, mt_rand with array filtering, array slicing, and microtime‑seeded shuffling—to produce pseudo‑random sequences.

mt_randprogrammingrandom number generation
0 likes · 4 min read
Understanding PHP mt_rand and Five Ways to Generate Random Numbers
FunTester
FunTester
Jul 12, 2022 · Backend Development

Why AtomicInteger Outperforms Random() in High‑Concurrency Random Number Generation

The article analyzes two common random‑number scenarios in software testing, identifies a CPU‑heavy custom random method, benchmarks ThreadLocalRandom, AtomicInteger, and plain int implementations under multi‑ and single‑thread loads, and proposes a lightweight AtomicInteger‑based selector that consistently delivers the best performance.

ConcurrencyJavaThreadLocalRandom
0 likes · 7 min read
Why AtomicInteger Outperforms Random() in High‑Concurrency Random Number Generation
NetEase LeiHuo UX Big Data Technology
NetEase LeiHuo UX Big Data Technology
Feb 14, 2022 · Fundamentals

Understanding Random Number Generation and the Linear Congruential Method for Game Gacha Systems

This article explains how linear congruential generators produce pseudo‑random numbers, demonstrates their use with step‑by‑step examples, visualizes the distribution of generated values, and applies the method to design a simple gacha system while discussing its statistical properties and practical limitations.

Simulationalgorithm fundamentalsgacha system
0 likes · 6 min read
Understanding Random Number Generation and the Linear Congruential Method for Game Gacha Systems
Hulu Beijing
Hulu Beijing
Dec 26, 2017 · Fundamentals

How to Sample a Gaussian Distribution: Methods, Algorithms, and Performance

This article explains why Gaussian (normal) distribution sampling is essential, describes the mathematical transformation from a standard normal, and compares several practical algorithms—including inverse transform, Box‑Muller, Marsaglia polar, rejection sampling, and Ziggurat—highlighting their implementation steps and efficiency considerations.

Box-MullerGaussianMarsaglia
0 likes · 8 min read
How to Sample a Gaussian Distribution: Methods, Algorithms, and Performance