Random number
A random number is a numerical value produced or sampled according to a random or pseudorandom process, often within a specified range or distribution.
Statistics Every Programmer Needs
A random number is a generated numerical value treated as a sample from a specified probability distribution or numerical interval.
- How it is used
- Supports Monte Carlo simulations by converting probability distributions into sampled scenarios for operational decisions.
- How deep it goes
- Traces interval construction, seeded generation, replacement choices, and repeated-trial interpretation, but does not develop generator internals.
- Examples
- Uses 00–99 digit ranges, seeded NumPy samples, and call-center absenteeism trials producing a mean staffing requirement of 2.4.
- What you can do after
- Apply it via Python and NumPy to generate reproducible samples, map them to outcomes, and estimate variability across trials.
Read how Statistics Every Programmer Needs explains random number →
Get Programming: Learn to code with Python
A random number is a number generated by a random-generation process so that its specific value cannot be predicted deterministically in advance.
- How it is used
- Adds unpredictability to selections, games of chance, simulations, and graphical object placement.
- How deep it goes
- Explains common random-library operations, probability intervals, list selection, and seeded testing, but does not detail generator internals.
- Examples
- Uses random list selection, rock-paper-scissors, seeded integer generation, and randomly positioned rectangles in a tag game.
- What you can do after
- Build it from scratch using Python’s random library to select values, simulate chance, vary graphical objects, and reproduce test results.
Read how Get Programming: Learn to code with Python explains random number →
Hacking Cryptography
A random number is a value selected according to a stochastic process intended to prevent predictable patterns or preferences.
- How it is used
- Supports cryptographic confidentiality, integrity, and authenticity by supplying unpredictable choices for secrets and randomized operations.
- How deep it goes
- Explains unpredictability and uniformity through examples and generator exercises, but defers cryptographically secure generator implementation.
- Examples
- Uses calculator randomness, magician guessing, date-based passwords, cryptographic keys, password mixing, and encrypted election ballots.
- What you can do after
- Evaluate whether biased outputs weaken cryptographic choices and recognize why uniform, hard-to-predict generation is required.
Learn C++ by Example
A random number is a value generated by a process intended to provide unpredictable or pseudorandom outcomes according to a specified domain.
- How it is used
- Uses random numbers to supply secret targets for a number-guessing game.
- How deep it goes
- Explains seed, engine, distribution, repeated draws, and rejection sampling, but stops short of advanced distribution design.
- Examples
- Demonstrates uniform integers from 1 to 100 and prime numbers from 1 to 99,999.
- What you can do after
- Build it from scratch with C++ engines and distributions, then apply rejection sampling to generate values with a required property.
Also covered in
- Deep Learning with JAX
- Learn Haskell by Example
- Math for Web Design
- Functional Programming in Scala, Second Edition
- Learn Rust in a Month of Lunches
- Classic Game Programming on the NES: Make your own retro video game
What to know first
- integerAn integer is a whole-number mathematical value, including negative numbers, zero, and positive numbers, with no fractional part.
- language modelA language model is a computational model that represents patterns in linguistic sequences to assign probabilities, predict, generate, or evaluate language.
- Monte Carlo simulationMonte Carlo simulation is a computational technique that uses repeated random sampling to estimate quantities or characterize possible outcomes.
- normal distributionA normal distribution is a continuous probability distribution with a symmetric, bell-shaped density determined by its mean and variance.
Related concepts
- ECDSAused by · ECDSA is a public-key digital signature algorithm that uses elliptic-curve arithmetic to generate and verify signatures.
- normal distributionuses · A normal distribution is a continuous probability distribution with a symmetric, bell-shaped density determined by its mean and variance.
- pseudo-random number generatorproduced by · A pseudorandom number generator is a deterministic algorithm that uses an initial seed or internal state to produce a sequence of values with random-like properties.
- probability distributionproduced by · A probability distribution is a mathematical specification assigning probabilities or probability densities to the possible values or outcomes of a random variable.
Questions about random number
What is random number?
A random number is a numerical value produced or sampled according to a random or pseudorandom process, often within a specified range or distribution.
Which Manning books explain random number?
Statistics Every Programmer Needs, Get Programming: Learn to code with Python, Hacking Cryptography and Learn C++ by Example.
What should I know before learning random number?
Manning books that teach random number usually introduce integer, language model, Monte Carlo simulation and normal distribution first.
What is random number a kind of?
Random number is a kind of number. A number is a mathematical value representing quantity or position in a numerical system.
What is random number also called?
Random number is also called random values.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.



