Discrete variable
A discrete variable is a variable whose possible values belong to a finite or countable set of distinct alternatives rather than a continuous range.
D3.js in Action, Third Edition
A discrete value belongs to a predetermined finite or otherwise distinct set of possible values.
- How it is used
- Guides data classification, visual encoding, and D3 scale selection for charts.
- How deep it goes
- Defines countable whole numbers, contrasts them with continuous measurements, and extends the idea to discrete scale inputs and outputs.
- Examples
- Uses employee counts, coffee sizes, TV genres, and gender categories as discrete values in charts and scales.
- What you can do after
- Apply it via D3 scales to choose discrete domains, categorical outputs, or continuous positions for chart variables.
Read how D3.js in Action, Third Edition explains discrete variable →
Everyday Data Visualization
A data dimension whose values are separate, distinct, and individually identifiable rather than varying continuously across a range.
- How it is used
- Guides visualization choices by distinguishing separate values from values that vary along a continuum.
- How deep it goes
- Explains definitions, scale-dependent dates, perceptual rationale, and chart choices without formal mathematical treatment.
- Examples
- Uses fruit identifiers, taste scores, seasonal dates, and a line-versus-bar chart comparison.
- What you can do after
- Apply chart-selection guidance by recognizing discrete values and choosing bar charts when separated categories need comparison.
Read how Everyday Data Visualization explains discrete variable →
Causal AI
A discrete outcome is one of a finite or countable set of distinct values that a discrete random variable can take.
- How it is used
- Frames finite-outcome uncertainty for probability models and causal reasoning without depending on discrete or continuous parameterization.
- How deep it goes
- Defines outcomes, notation, probability masses, and distribution classes, but stops short of deeper distribution theory.
- Examples
- Uses three-sided dice, coin flips, categorical food choices, and indexed categories as concrete discrete outcomes.
- What you can do after
- Apply discrete variables by specifying outcomes, assigning probability masses, and selecting categorical or Bernoulli distributions.
Data Without Labels
Discrete data consists of distinct countable values, typically represented as integers.
- How it is used
- Classifies count-based measurements before analysis and model building.
- How deep it goes
- Defines integer-valued counts and contrasts them with continuous, nominal, and ordinal data without developing modeling procedures.
- Examples
- Uses passengers, city populations, customers, demand quantity, and transaction item counts as integer-valued examples.
- What you can do after
- Evaluate whether a measured field represents an integer-valued count or a continuous quantity.
Statistics Every Programmer Needs
Discrete data are observations whose possible values are separate, countable outcomes rather than values throughout a continuous interval.
- How it is used
- Models countable uncertainty in Monte Carlo scenarios such as employee absenteeism and staffing.
- How deep it goes
- Defines countable outcomes and applies them in simulation, but stops short of formal probability derivations.
- Examples
- Uses employee absenteeism and call-center staffing as concrete examples of countable outcomes.
- What you can do after
- Apply it via Monte Carlo simulations to model absenteeism and compare staffing scenarios under uncertainty.
Read how Statistics Every Programmer Needs explains discrete variable →
Also covered in
What to know first
- integerAn integer is a whole-number mathematical value, including negative numbers, zero, and positive numbers, with no fractional part.
- 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.
- parameterA parameter is a value or named input that specifies or influences the behavior, computation, or output of a function, model, or system.
Related concepts
- categorical dataequivalent to · Categorical data consists of values representing membership in discrete categories rather than measured numerical magnitudes.
- continuous datacontrasts with · Continuous data consists of numerical values that can vary across a range with arbitrarily fine precision.
- quantitative datakind of · Quantitative data is information represented numerically as quantities, measurements, counts, or other values suitable for numerical interpretation or analysis.
- bar chartused by · A bar chart is a visualization that compares quantitative values for discrete categories using rectangular bars whose lengths or heights encode magnitude.
- integerincludes · An integer is a whole-number mathematical value, including negative numbers, zero, and positive numbers, with no fractional part.
- random variablekind of · 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 discrete variable
What is discrete variable?
A discrete variable is a variable whose possible values belong to a finite or countable set of distinct alternatives rather than a continuous range.
Which Manning books explain discrete variable?
D3.js in Action, Third Edition, Everyday Data Visualization, Causal AI, Data Without Labels and Statistics Every Programmer Needs.
What should I know before learning discrete variable?
Manning books that teach discrete variable usually introduce integer, mean and parameter first.
What is the difference between discrete variable and continuous data?
A discrete variable is a variable whose possible values belong to a finite or countable set of distinct alternatives rather than a continuous range. Continuous data consists of numerical values that can vary across a range with arbitrarily fine precision.
What kinds of discrete variable are there?
Kinds of discrete variable include integer.
What is discrete variable a kind of?
Discrete variable is a kind of quantitative data. Quantitative data is information represented numerically as quantities, measurements, counts, or other values suitable for numerical interpretation or analysis.
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.




