AI Glossary / Statistics and probability / Beginner

Discrete random variable

Definition

A discrete random variable is a numerical function of a random outcome that takes values in a finite or countably infinite set. It might count failed checks, indicate whether an event occurred, or assign a numerical payoff to an outcome. The variable defines what is measured; its distribution specifies the probabilities of its possible values. Discreteness concerns the set of values, not whether the result has already been observed or whether its probabilities are equal.

What it means

A random experiment can have many underlying outcomes that produce the same numerical value. Three binary checks, for example, have several different failure patterns but only four possible failure counts. Defining the random variable groups those patterns according to the question of interest. This distinction helps analysts avoid treating a count as if it retained every detail of the original outcome. A discrete variable need not be integer-valued, and a countably infinite set of possible values is still discrete even though there is no largest value.

How it works

Start with the uncertain process and define a numerical mapping from each possible outcome to the quantity of interest. Identify its support and obtain each value's probability by adding the probabilities of all underlying outcomes mapped to that value. These probabilities form a probability mass function. Event probabilities follow by summing the appropriate masses. Expected value and variance summarize the resulting numerical distribution when they exist. A transformation of a discrete variable remains discrete, although different original values may merge. Dependencies among underlying events affect the probabilities and must not be silently replaced by independence assumptions.

Three practical examples

  • Product testing: count how many of a fixed number of inspections fail, while retaining detailed failure patterns for diagnosis.
  • Customer operations: define an indicator equal to one if a customer renews within a specified window and zero otherwise.
  • Pricing simulation: represent a fee that takes one of several permitted monetary amounts depending on a random transaction outcome.

Think of it this way

Think of a scoreboard attached to an uncertain event. Many different sequences of play can yield the same displayed score. The scoreboard's rule defines the random variable, while the chances of its different readings define its distribution. Looking only at the score cannot recover every detail of the underlying sequence.

Worked example

Suppose three hypothetical checks independently fail with probability one half. There are eight equally likely ordered pass/fail patterns. Define X as the number of failures. Exactly one pattern gives X = 0, three give X = 1, three give X = 2, and one gives X = 3. Thus the probabilities are 1/8, 3/8, 3/8 and 1/8, and E(X) = (0 + 3 + 6 + 3)/8 = 1.5 failures. Now define a hypothetical fee Y = 0.50 + 1.25X. Its possible amounts are 0.50, 1.75, 3.00 and 4.25, with the same respective probabilities. Y is discrete despite including fractional values. Its expected fee is 0.50 + 1.25 x 1.5 = 2.375, which need not be an allowed individual fee. The equal-pattern calculation relies on the stated independence and one-half failure probabilities.

Illustrative case study

Fictional case: Oak Inspection builds an AI-supported quality dashboard. The team defines one variable as the number of failed checks per product and another as whether any check failed. The second merges several different failure counts into one event, so analysts retain the original count and individual check results for investigations. They also inspect whether checks fail together before using a binomial model. This invented case illustrates variable definition and information loss under transformation; it does not demonstrate that the AI system accurately detects defects or that the checks are independent.

Common misconceptions and mistakes

Do not confuse the random variable with one observed realization: X is the rule or uncertain quantity, while x is a particular value. Not all discrete variables are counts, and not all are finite. Recording a continuous measurement to a fixed number of decimals produces discrete recorded values without proving the underlying physical quantity is discrete. Observing only finitely many values in a dataset likewise does not establish a discrete population model. A binary indicator discards distinctions among outcomes assigned the same code, and a numerical category code does not automatically justify arithmetic interpretations of category differences.

Business use

Businesses benefit from defining random variables explicitly before choosing a model. Specify the unit, time window, counting rule and handling of missing or partial observations. The choice affects which questions can be answered and what information is lost. For AI evaluations, distinguish per-item correctness indicators from total correct counts and from predicted probabilities, which may vary continuously. A well-defined variable is necessary for reliable analysis, but does not establish that the chosen data source, probability model or decision threshold is appropriate.

People also ask

Can a discrete random variable take decimal values?

Yes. A finite set such as the four fees in the example is discrete regardless of decimal notation.

Is every numeric column a random variable?

A column may contain observations modeled as realizations of a random variable, but its definition and role still need explanation.

Can its expected value be impossible as an individual outcome?

Yes. An expectation is a probability-weighted average, not necessarily a supported value.

Check your understanding

Why does X = 1 have probability 3/8 rather than 1/8 in the example?

Answer: Three distinct equally likely patterns contain exactly one failed check. The random variable maps all three patterns to the same count, so their probabilities are added. Counting supported values alone would incorrectly assume equal probabilities for counts.

Related terms

  • Random variable
  • Realization
  • Sample space
  • Probability mass function (pmf)
  • Discrete distribution
  • Expected value
  • Binomial distribution
  • support
  • probability mass function
  • indicator variable
  • count variable
  • transformation

Learn next

enumerate outcomes of a small random experiment and define two different numerical mappings on them. Derive each probability mass function and identify information lost by the mapping. Then compare discrete recorded measurements with continuous modeling assumptions and examine how dependence changes a count distribution.

  • Random experiment

More in Statistics and probability

  • Directional test - A directional test is a statistical hypothesis test whose rejection region lies in one specified direction, commonly called a one-sided or one-tailed test.
  • Discordant pairs - Discordant pairs are pairs of observations whose order is reversed on two variables: the observation with the higher value on one variable has the lower...
  • Discourse model - A discourse model is a representation of the entities and relevant relationships established during an unfolding conversation or text.
  • Discrete-time proportional hazards - Discrete-time proportional hazards models describe event occurrence when follow-up is divided into intervals and each interval's event probability is...
  • Discrete Weibull distribution - The discrete Weibull distribution is a family of distributions for nonnegative integer outcomes, often used for discrete lifetimes or count data.
  • Discriminant analysis - Discriminant analysis is a family of statistical methods for distinguishing predefined groups using measured predictors.

Sources

The Aalto Dictionary of Machine Learning, discrete random variable: https://aaltodictionaryofml.github.io/ADictML_Main.pdf KNIME, Data Science Glossary: https://www.knime.com/blog/data-science-glossary Penn State, Discrete Random Variables: https://online.stat.psu.edu/stat414/Lesson07 NIST/SEMATECH, What is a Probability Distribution?: https://www.itl.nist.gov/div898/handbook/eda/section3/eda361.htm

Previous: Discrete phase-type distribution Next: Discrete-time proportional hazards

  • Home
  • Daily AI Updates
  • Blog
  • AIFBL Academy
  • AI Glossary
  • Products and Tools
  • Store
  • Free CFO AI Prompt Pack
  • About Shihan Sheriff
  • Privacy Policy
  • Terms of Use
  • Refund Policy
  • Cookie Policy
  • Earnings Disclaimer