liveBook · Manning

Probability distribution

A probability distribution is a mathematical specification assigning probabilities to the possible values or outcomes of a random variable, with total probability one.

How 27 Manning books explain it

Math and Architectures of Deep Learning

A probability law over variable values.

How it is used
Models uncertain high-dimensional inputs, supports generative fitting, and exposes structure beyond direct classification.
How deep it goes
Defines discrete and joint distributions, then develops sampling, moments, parameter fitting, and latent-space uses.
Examples
Uses quantized adult weights, weight-height dependence, sampled point clouds, Gaussian fitting, and VAE latent-space maps.
What you can do after
Apply it via PyTorch distribution calls to evaluate probabilities, sample values, and compare theoretical and sample statistics.

Read how Math and Architectures of Deep Learning explains probability distribution →

Statistics Every Programmer Needs

A probability distribution specifies how probability is assigned across the possible values of a random variable.

How it is used
Quantifies uncertain outcomes for probability calculations, Monte Carlo simulations, risk assessment, and decisions.
How deep it goes
Develops distribution selection and parameters into CDF-based sampling and automated trials, with worked discrete probabilities and continuous-data applications.
Examples
Uses Poisson call-center absences, simulated stock prices, and uniform-versus-Benford leading-digit plots.
What you can do after
Apply it via SciPy and NumPy to calculate discrete probabilities, sample staffing scenarios, and interpret variation in simulated outcomes.

Read how Statistics Every Programmer Needs explains probability distribution →

Causal AI

A distribution specifies the probabilities or densities of the possible values of a random variable or set of variables.

How it is used
Models variation in populations and supplies probabilities for simulation, prediction, and causal decision questions.
How deep it goes
Defines outcome probabilities, works through tabular parameters and sampling, and distinguishes observed distributions from intervention effects.
Examples
Uses a three-outcome table, website engagement subpopulations, investors’ actions, and token-sequence probabilities.
What you can do after
Apply it via pgmpy DiscreteFactor to specify and sample a finite discrete distribution.

Read how Causal AI explains probability distribution →

Statistics Slam Dunk

A distribution describes how the values of a variable are allocated across their possible range or categories.

How it is used
Uses distributions to explore NBA performance data and compare how observations are spread across values or groups.
How deep it goes
Explains histograms, bins, boxplots, summary statistics, and paired displays through executable R workflows rather than formal probability theory.
Examples
Illustrates win-share distributions for NBA draft selections and overlaid distributions of franchise games played and won.
What you can do after
Apply it via ggplot2 and ggpubr to plot, compare, and interpret distributions in NBA data.

Read how Statistics Slam Dunk explains probability distribution →

Outlier Detection in Python

A distribution describes how values or observations are apportioned across possible outcomes or regions of a data space.

How it is used
Uses distributions to establish normal patterns, generate synthetic data, and compare groups for unusual behavior.
How deep it goes
Explains empirical distributions through sampling, generation, plots, and distance comparisons rather than formal probability derivations.
Examples
Contrasts real and synthetic baseball features and compares purchasers’ supplier frequencies overall and on day 28.
What you can do after
Apply it via NumPy histograms and SciPy Jensen–Shannon distance to generate values or compare aligned group distributions.

Read how Outlier Detection in Python explains probability distribution →

The Well-Grounded Data Analyst

A statistical distribution describes the pattern of frequencies or probabilities across a variable's possible values.

How it is used
Uses distributions to inspect data, compare groups, identify patterns, and guide iterative analytical decisions.
How deep it goes
Explains practical inspection through summaries and charts, but stops short of formal probability theory or distribution fitting.
Examples
Shows coding-experience histograms, grouped boxenplots, time-series counts, and property-price summaries with investigated outliers.
What you can do after
Diagnose/debug with it by inspecting spread, skewness, gaps, group differences, and plausible explanations for extreme observations.

Read how The Well-Grounded Data Analyst explains probability distribution →

Learn C++ by Example

A random number distribution is a rule or library component that produces values according to a specified probability distribution.

How it is used
Generates controlled random values for games, simulations, guessing exercises, and varied object behavior.
How deep it goes
Explains engine-distribution setup, callable use, parameter meanings, templates, and testing, but defers exhaustive distribution details.
Examples
Uses a 1–100 guessing game, 0–4 blob steps, normal values with mean 2.0, and mocked generators for tests.
What you can do after
Build it from scratch with a seed, engine, distribution, and operator() call, then substitute distributions or test doubles.

Read how Learn C++ by Example explains probability distribution →

Starting Data Analytics with Generative AI and Python

The pattern of values and their frequencies for a variable or measurement.

How it is used
Uses review-score frequencies to compare product categories and sellers and to check keyword-extracted positive reviews.
How deep it goes
Works through grouped counts, bar charts, and score aggregation without developing a theoretical probability model.
Examples
Uses product-review scores by category and seller, plus a score plot for reviews extracted using positive keywords.
What you can do after
Apply it via pandas and seaborn to count and plot review scores, then cautiously check a positive-review extraction.

Read how Starting Data Analytics with Generative AI and Python explains probability distribution →

LLMs in Production

A data distribution is the pattern of frequencies or probabilities with which data values or feature combinations occur.

How it is used
Uses distribution checks to judge whether prepared LLM data fits the intended outcome.
How deep it goes
Outlines schema, normalization, inspection, and validation options without detailing pipeline implementation.
Examples
Contrasts inspecting whether data represents a problem with validating model output through a human-in-the-loop workflow.
What you can do after
Evaluate/understand whether feature distributions suit the intended task before training an LLM.

Read how LLMs in Production explains probability distribution →

Grokking Statistics

A probability function assigns a probability to an event or possible outcome.

How it is used
Models uncertain outcomes for data science, machine learning, hypothesis testing, and real-world decisions.
How deep it goes
Defines random variables and probability functions, then develops distribution selection through named families and a Bernoulli implementation.
Examples
Uses laptop water-damage recovery, die rolls, raindrops, adult heights, controller colors, and tornado widths.
What you can do after
Apply it by pairing problem cues such as trials, time, successes, and failures with an appropriate distribution.

Read how Grokking Statistics explains probability distribution →

Server-Side WebAssembly

A probability distribution assigns nonnegative likelihood values to possible outcomes with a total probability of one.

How it is used
Turns ML inference scores into interpretable class likelihoods or weighted next-token choices.
How deep it goes
Explains softmax procedurally through exponentiation, normalization, ranking, and weighted sampling, without formal probability theory.
Examples
Uses Persian-cat classification rankings and story continuation from the prompt “Once upon a time.”
What you can do after
Apply it via softmax and WeightedIndex to rank predictions or sample generated tokens.

Read how Server-Side WebAssembly explains probability distribution →

Deep Learning with R, Third Edition

A data distribution is the probability distribution governing the inputs, examples, or outcomes in a machine-learning task.

How it is used
Uses distributions to express class and token predictions, sample latent representations, and describe which inputs a trained model has encountered.
How deep it goes
Explains class probabilities and their training loss, then sketches token and latent sampling without a formal probability derivation.
Examples
Uses a 46-class news classifier, next-token sampling, latent image reconstruction, and a leopard-print sofa misclassification.
What you can do after
Evaluate/understand it by interpreting predicted class probabilities, choosing a token-sampling strategy, and recognizing risks from unfamiliar inputs.

Read how Deep Learning with R, Third Edition explains probability distribution →

Machine Learning System Design

A statistical pattern describing the frequencies or probabilities of values in a population or dataset.

How it is used
Guides dataset validation, feature maintenance, and production monitoring by checking whether data resembles intended deployment conditions.
How deep it goes
Explains representativeness, dataset splitting, separability, feature drift, and repeated validation, but stops short of mathematical derivation.
Examples
Uses train-validation-test splits, labeled-versus-unlabeled separation, synthetic image realism, and changing feature distributions.
What you can do after
Diagnose/debug with adversarial validation and repeated distribution checks before trusting offline metrics or production inputs.

Read how Machine Learning System Design explains probability distribution →

Building Quantum Software with Python

A probability distribution is a function assigning probabilities to possible outcomes, with the probabilities summing to one.

How it is used
Uses measurement outcomes to support random sampling, search, and estimation in quantum computations.
How deep it goes
Defines normalization, connects probabilities to amplitudes, and demonstrates Python sampling with repeated-run counts.
Examples
Uses biased-coin measurement, outcome–probability tables, Python samples, and uniform, binomial, raised-cosine, and normal-approximation distributions.
What you can do after
Apply it via quantum measurement or Python sampling to generate outcomes and estimate probabilities from counts.

Read how Building Quantum Software with Python explains probability distribution →

Effective Data Analysis

A distribution describes how values of a variable are arranged across their possible range and frequencies.

How it is used
Supports exploratory data analysis, statistical-test selection, assumption checking, group comparison, and stakeholder reporting.
How deep it goes
Descends from plotting and summary measures to normality assumptions, transformations, sample-size analysis, and non-parametric alternatives.
Examples
Uses histograms, boxplots, bimodal data, synthetic assessment groups, and Boston–New York City weather comparisons.
What you can do after
Evaluate/understand data shape, summarize spread, check test assumptions, choose alternatives, and communicate inferential limits.

Read how Effective Data Analysis explains probability distribution →

Build a Reasoning Model (From Scratch)

A normalized set of values over tokens that sum to 1 and can be sampled from to choose the next token.

How it is used
Converts temperature-scaled next-token logits into sampling probabilities during generation.
How deep it goes
Defines normalization, verifies sums, visualizes scores, and demonstrates repeated sampling without deriving softmax internals.
Examples
Uses the Berlin token, probability plots, probability-sum checks, and repeated multinomial samples.
What you can do after
Apply it via PyTorch to normalize logits, inspect probabilities, and sample one or many candidate tokens.

Read how Build a Reasoning Model (From Scratch) explains probability distribution →

Delivering Machine Learning Projects: From design to deployment

A distribution is the pattern of values, frequencies, or probabilities across the possible values of a variable.

How it is used
Uses distributions to validate data during exploratory analysis and to test whether candidate models can express required outputs.
How deep it goes
Examines distributions through plausibility questions, range checks, and output-capability tests rather than mathematical derivations.
Examples
Uses customer transaction patterns, seasonal traffic, unexplained range gaps, and binary versus graduated control signals.
What you can do after
Evaluate data plausibility and reject modeling approaches unable to represent the required output distribution.

Read how Delivering Machine Learning Projects: From design to deployment explains probability distribution →

Fabulous Adventures in Data Structures and Algorithms

A probability distribution specifies the probabilities assigned to the possible values of a random quantity.

How it is used
Models random quantities in programs so games and simulations can sample outcomes with nonuniform odds.
How deep it goes
Defines support and PMFs, develops finite discrete sampling, and implements weighted Bernoulli distributions while deferring continuous distributions.
Examples
Uses dice, coins, colored marbles, card and song selection, and weighted Bernoulli coin flips.
What you can do after
Build it from scratch as a C# distribution abstraction and sample uniform or weighted discrete outcomes.

Read how Fabulous Adventures in Data Structures and Algorithms explains probability distribution →

D3.js in Action, Third Edition

A data distribution is the pattern of values and their frequencies or densities across a variable's possible range.

How it is used
Uses distributions to assess how frequently values occur within ranges and choose suitable visual comparisons.
How deep it goes
Explains binning and D3 implementation, then applies histograms, box plots, pyramid charts, and violin plots.
Examples
Uses 788 survey respondents’ salaries, salary brackets, and role-based earnings as distribution examples.
What you can do after
Build it from scratch with D3 by preprocessing values into bins and rendering distribution charts.

Read how D3.js in Action, Third Edition explains probability distribution →

Build Python Web Apps with Streamlit

A probability distribution assigns likelihoods to the possible values or events of a random variable.

How it is used
Explains how an LLM chooses the next token and how generation settings alter response variability.
How deep it goes
Defines the token-likelihood curve and works through temperature and top_p, without developing broader probability theory.
Examples
Uses five candidate tokens with explicit probabilities to demonstrate a top_p cutoff.
What you can do after
Operate/configure LLM generation by relating temperature and top_p settings to creativity and predictability.

Read how Build Python Web Apps with Streamlit explains probability distribution →

Data Without Labels

A probability distribution specifies the probabilities assigned to possible values or configurations of a random system.

How it is used
Frames generative modeling, synthetic-data creation, density estimation, and probabilistic neural-network training.
How deep it goes
Explains data, noise, model, and Boltzmann distributions, including normalization and distribution matching, but not detailed probability derivations.
Examples
Uses Gaussian or uniform noise for GAN input and Boltzmann distributions for modeling neural-network states.
What you can do after
Evaluate how generative and energy-based models use distributions to generate data or compare learned and observed behavior.

Read how Data Without Labels explains probability distribution →

Cyber Threat Hunting

A statistical distribution describes the frequencies, probabilities, or arrangement of values across possible observations.

How it is used
Uses distributions to uncover beaconing, anomalies, outliers, and possible data exfiltration during threat-hunting investigations.
How deep it goes
Explains filtering, grouping, charting, skew, concentration, and tails, but defers formal probability theory.
Examples
Demonstrates time-difference histograms and byte distributions for connections from two endpoints to 162.125 addresses.
What you can do after
Diagnose suspicious communication by plotting field values, recognizing distribution patterns, and comparing recurring values across related fields.

Read how Cyber Threat Hunting explains probability distribution →

Experimentation for Engineers

A mathematical description of the possible values of a random quantity and their probabilities.

How it is used
Frames distributions as uncertainty models for choosing between exchange execution strategies.
How deep it goes
Explains distributions through aggregate measurements, standard error, z scores, and a 5% decision rule.
Examples
Uses ASDAQ and BYSE execution costs, aggregate measurements, NumPy calculations, and z-score threshold diagrams.
What you can do after
Evaluate whether measured differences justify routing trades to one exchange while controlling an explicit error probability.

Read how Experimentation for Engineers explains probability distribution →

Hacking Cryptography

A probability distribution assigns probabilities to the possible outcomes of a random process.

How it is used
Quantifies unpredictability in random number generators by relating outcome probabilities to entropy.
How deep it goes
Calculates entropy with a binary-log equation and validated Go inputs, stopping at biased coin distributions.
Examples
Uses fair and biased coin tosses, an entropy equation, a flowchart, and a Go calculation program.
What you can do after
Apply it via a Go program to validate two-outcome probabilities and calculate their entropy.

Read how Hacking Cryptography explains probability distribution →

Build a Text-to-Image Generator (from Scratch)

A probability distribution describes the possible values of a random variable and the probabilities associated with those values.

How it is used
Represents uncertainty in latent image representations and next-token predictions rather than single deterministic outputs.
How deep it goes
Traces parameterization, sampling, reconstruction, and vocabulary prediction, but defers a formal treatment of VAEs.
Examples
Uses normal latent distributions for images and target-vocabulary distributions for German-to-English token generation.
What you can do after
Evaluate how models encode uncertainty, sample representations, reconstruct images, and select tokens sequentially.

Read how Build a Text-to-Image Generator (from Scratch) explains probability distribution →

Software Testing with Generative AI

A mathematical representation assigning probabilities to the possible values or outcomes of a variable.

How it is used
Predicts likely next words in language-model and keyboard suggestions.
How deep it goes
Defines probability-based prediction and connects it to training, but stops short of mathematical formalization.
Examples
Uses phone-keyboard suggestions, the phrase “I am,” and candidate words such as “away” and “sandalwood.”
What you can do after
Understand how trained models rank possible next words using learned probabilities.

Read how Software Testing with Generative AI explains probability distribution →

Sutskever's List

The probability distribution of examples and patterns from which a model learns during training.

How it is used
Explains why model capabilities and failures vary across tasks and may change after deployment.
How deep it goes
Traces data frequency to performance differences through examples, without formalizing the distribution mathematically.
Examples
Contrasts arithmetic limits, context-length failures, uneven reasoning, and two website-generation tasks.
What you can do after
Evaluate model behavior by considering how well relevant patterns are represented in training data.

Read how Sutskever's List explains probability distribution →

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.