Randomness
Randomness is the property of a process or outcome involving chance or probabilistic variation rather than being fully determined by available conditions.
Learn AI-Assisted Python Programming, Second Edition
Randomness is the property of an outcome or event being determined by chance rather than being fully predictable from the available information.
- How it is used
- Uses chance to add variety, surprise, risk, and uncertainty to games and to explain variable large-language-model outputs.
- How deep it goes
- Explains Python integer and floating-point generation with examples, then applies it to games without developing randomness internals.
- Examples
- Demonstrates random digits, dice rolls, floating-point values, secret codes, enemy behavior, puzzle orientation, and attack damage.
- What you can do after
- Apply it via Python's random module to generate inclusive integers and floating-point values for simple games.
Read how Learn AI-Assisted Python Programming, Second Edition explains randomness →
Agent Design Patterns
The property of involving chance or probabilistic variation rather than fully deterministic behavior.
- How it is used
- Frames model variability as both a code–AI interface risk and a resource for repeated-sampling agent patterns.
- How deep it goes
- Explains variability through probabilistic token sampling, then develops bounded retry and assessment behavior without formal probability mathematics.
- Examples
- Uses mathematics agents, repeated answers to a difficult problem, and a generic Python Resampler to make variation concrete.
- What you can do after
- Apply it via a bounded Resampler or Voter to handle variable model outputs through acceptance criteria or reconciliation.
Statistics Slam Dunk
Randomness is the absence of a deterministic pattern in the occurrence of outcomes, subject to probabilistic regularities.
- How it is used
- Frames sports analysis around distinguishing random streaks from genuine order, causality, and hot-hand claims.
- How deep it goes
- Explains simulation, independent trials, streak calculations, and player-level interpretation, but stops short of formal probability proofs.
- Examples
- Uses fair-coin simulations and 2019–20 NBA free-throw streaks from Giannis Antetokounmpo and James Harden.
- What you can do after
- Apply it via R simulations and streak analysis to evaluate whether apparent success patterns exceed random variation.
Real-World Cryptography
Randomness is the property of outcomes or data being difficult to predict and lacking a discernible deterministic pattern.
- How it is used
- Supplies unpredictable values for cryptographic keys, nonces, IVs, challenges, and prime numbers.
- How deep it goes
- Explains unpredictability, uniform distributions, physical sources, PRNG failures, and conservative sourcing, without implementation-level generation details.
- Examples
- Uses dice, lottery numbers, calculator sequences, chaotic physical phenomena, and the Debian-era OpenSSL PRNG failure.
- What you can do after
- Apply it by choosing operating-system or trusted-library randomness and avoiding predictable or noncryptographic PRNGs.
Hacking Cryptography
Randomness is the absence of a predictable pattern in an outcome or sequence according to a specified model of probability.
- How it is used
- Frames randomness as a foundational security input for cryptographic confidentiality, integrity, authenticity, and secret generation.
- How deep it goes
- Explains unpredictability, contrasts RNG types, traces entropy sourcing, and identifies weak randomness as an algorithm-breaking failure.
- Examples
- Uses calculator RAND, magician-selected numbers, cryptographic keys and salts, and predictable ECDSA nonces as concrete examples.
- What you can do after
- Evaluate cryptographic implementations for randomness dependencies and diagnose how poor-quality random input can nullify algorithmic security.
Causal AI
Randomness is the absence of a deterministic specification of an outcome, represented in a model by stochastic variation or random variables.
- How it is used
- Frames stochastic variation for probabilistic generative modeling, causal modeling, inference, and decision-making.
- How deep it goes
- Defines random variables, probability interpretations, deterministic data-generating processes, and computational sampling, but defers detailed inference algorithms.
- Examples
- Uses repeated die rolls, three-sided dice, coin flips, and Pyro random-process models.
- What you can do after
- Evaluate/understand how models represent variation through random variables, distributions, probability interpretations, and generated samples.
Also covered in
- Grokking Data Structures
- Deep Learning with JAX
- Build a Website with ChatGPT
- Fabulous Adventures in Data Structures and Algorithms
- The Complete Obsolete Guide to Generative AI
- API Design Patterns
- Build a DeepSeek Model (From Scratch)In early access (MEAP)
- Grokking AI Algorithms, Second Edition
- Math for Web Design
- Digital Twins in Action
What to know first
- language modelA language model is a computational model that represents patterns in linguistic sequences to assign probabilities, predict, generate, or evaluate language.
- probability theoryProbability theory is the mathematical framework for quantifying and reasoning about uncertainty in events, variables, and outcomes.
- digital twinA digital twin is a computational representation of a physical entity, process, or system that models relevant characteristics, state, or behavior.
- ECDSAECDSA is a public-key digital signature algorithm that uses elliptic-curve arithmetic to generate and verify signatures.
Related concepts
- crossoverused by · Crossover is an evolutionary recombination technique that combines material from parent candidate solutions to produce one or more offspring.
- entropymeasured by · Entropy is an information-theoretic measure of uncertainty in a probability distribution, defined as the expected value of the negative logarithm of outcome probability.
- data explorationproduces · Data exploration is the systematic examination and summarization of data to understand its structure, distributions, relationships, patterns, anomalies, and quality.
- probabilistic modelpart of · A probabilistic model is a mathematical representation of uncertain variables, relationships, or outcomes using probability distributions.
- random variableused by · A random variable is a function that assigns numerical values to outcomes of a random process and is characterized by a probability distribution.
Questions about randomness
What is randomness?
Randomness is the property of a process or outcome involving chance or probabilistic variation rather than being fully determined by available conditions.
Which Manning books explain randomness?
Learn AI-Assisted Python Programming, Second Edition, Agent Design Patterns, Statistics Slam Dunk, Real-World Cryptography, Hacking Cryptography and Causal AI.
What should I know before learning randomness?
Manning books that teach randomness usually introduce language model, probability theory, digital twin and ECDSA first.
What is randomness part of?
Randomness is part of probabilistic model. A probabilistic model is a mathematical representation of uncertain variables, relationships, or outcomes using probability distributions.
What is randomness also called?
Randomness is also called stochasticity.
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.





