Random variable
A random variable is a function that assigns numerical values to outcomes of a random process and is characterized by a probability distribution.
Math and Architectures of Deep Learning
A quantity whose possible values are associated with probabilities, used to model uncertain measurable attributes or event outcomes.
- How it is used
- Models uncertain quantities and event outcomes as inputs to probability distributions and machine-learning probability calculations.
- How deep it goes
- Develops discrete and continuous definitions, densities, sampling, expectations, joint variables, and distribution examples with formulas and PyTorch code.
- Examples
- Uses quantized adult weights and heights, uniform intervals, Bernoulli trials, binomial success counts, and four-class image predictions.
- What you can do after
- Apply it via PyTorch distributions to evaluate probabilities, draw samples, and compare empirical moments with distribution properties.
Read how Math and Architectures of Deep Learning explains random variable →
Statistics Every Programmer Needs
A random variable is a function that assigns numerical values to outcomes of a random experiment.
- How it is used
- Uses numerical outcomes to model uncertainty for probability calculations and staffing simulations.
- How deep it goes
- Defines discrete and continuous values, explains their probability functions, and works through dice-sum PMF and CDF calculations.
- Examples
- Works through two-dice sums and uses call-center absentee counts to motivate simulation.
- What you can do after
- Practice/perform discrete probability calculations and evaluate/understand simulated outcomes for decisions under uncertainty.
Read how Statistics Every Programmer Needs explains random variable →
Grokking Bayes
A random variable is a variable whose value depends on the outcome of a probabilistic experiment.
- How it is used
- Models uncertain outcomes and unknown quantities so their possible values can be described with probabilities.
- How deep it goes
- Defines random variables, works through binary probabilities and granularity, and applies them to unknown model parameters.
- Examples
- Illustrates rain forecasts and a shared coaching effect across eight schools.
- What you can do after
- Apply it via PyMC to represent a shared coaching effect and sample its posterior distribution.
Causal AI
A random variable is a variable whose possible values and uncertainty are described by a probability distribution.
- How it is used
- Represents uncertain outcomes so probability distributions, recorded data, and causal interventions can be expressed in a common notation.
- How deep it goes
- Defines discrete outcomes and probability values, then extends to expectations and dependence; mentions continuous densities without working through integration.
- Examples
- Uses die rolls and coin flips for outcomes, plus a three-state probability table implemented with pgmpy.
- What you can do after
- Apply it via pgmpy DiscreteFactor to represent a finite-outcome distribution and calculate a probability-weighted expectation.
Causal Inference for Data Science
A random variable is a variable whose value is determined by the outcome of a random experiment.
- How it is used
- Distinguishes fixed individual outcomes, sampled population variables, and conditional uncertainty when defining causal quantities.
- How deep it goes
- Defines expectations, variance, empirical distributions, and conditional randomness, but defers deeper statistical inference and confidence-interval methods.
- Examples
- Uses coin tosses, treatment and recovery indicators, potential outcomes, and functional causal-graph relationships.
- What you can do after
- Evaluate/understand probabilities, expectations, and conditional uncertainty without confusing samples, populations, or fixed potential outcomes.
Read how Causal Inference for Data Science explains random variable →
Bayesian Optimization in Action
A random variable is a variable whose value is determined by an uncertain outcome or probabilistic process.
- How it is used
- Uses random variables to represent multiple uncertain quantities jointly in multivariate Gaussian models.
- How deep it goes
- Defines variables within a Gaussian vector and traces their means, variances, and covariances through matrix entries.
- Examples
- Illustrates random variables with height, IQ, income, birth weight, and a housing-price multivariate example.
- What you can do after
- Evaluate how Gaussian models assign expected values, variances, and covariances to individual uncertain quantities.
Read how Bayesian Optimization in Action explains random variable →
Also covered in
What to know first
- integralAn integral is a mathematical operation that accumulates a function’s values over an interval or domain, representing quantities such as signed area or an antiderivative.
- meanThe mean is a measure of central location equal to the arithmetic average of numerical observations, or the probability-weighted average of a random variable’s possible values.
- probability theoryProbability theory is the mathematical framework for quantifying and reasoning about uncertainty in events, variables, and outcomes.
- binomial distributionA binomial distribution is the probability distribution of the number of successes in a fixed number of independent trials, each with the same probability of success.
Related concepts
- continuous random variableincludes · A continuous random variable is a random variable whose possible values range over a continuum rather than a discrete set.
- binary random variableincludes · A binary random variable is a random variable that can take exactly two possible values, often represented as 0 and 1.
- probability distributionused by · A probability distribution is a mathematical specification assigning probabilities or probability densities to the possible values or outcomes of a random variable.
- discrete variableincludes · A discrete variable is a variable whose possible values belong to a finite or countable set of distinct alternatives rather than a continuous range.
- distanceincludes · A distance function assigns a numerical measure of separation or dissimilarity to pairs of points or objects in a defined space.
- interventionconfigured by · An intervention is a deliberate, externally imposed change or control applied to a variable or system to alter or assess its behavior or outcomes.
Questions about random variable
What is random variable?
A random variable is a function that assigns numerical values to outcomes of a random process and is characterized by a probability distribution.
Which Manning books explain random variable?
Math and Architectures of Deep Learning, Statistics Every Programmer Needs, Grokking Bayes, Causal AI, Causal Inference for Data Science and Bayesian Optimization in Action.
What should I know before learning random variable?
Manning books that teach random variable usually introduce integral, mean, probability theory and binomial distribution first.
What kinds of random variable are there?
Kinds of random variable include continuous random variable, binary random variable, discrete variable and distance.
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.





