liveBook · Manning

Random number

A random number is a numerical value generated by a random or pseudorandom process according to a specified range or probability distribution.

How 4 Manning books explain it

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.

Read how Hacking Cryptography explains random number →

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.

Read how Learn C++ by Example explains random number →

Related concepts

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.