skip to content

How do you describe a customer spend variable with a point mass at 0 and continuous spend above it?

level: seniorimportance: nice to knowfreq 30%

answer

  1. neither purely discrete nor purely continuous
  2. the CDF handles both parts
  3. a jump at zero, smooth above
  4. mixture of an atom and a density
  5. quantiles below the atom collapse to zero

basics

~20 s

As a mixed distribution: no single PMF or PDF describes it. Use the CDF, which jumps by the non-buyer share at 0 then rises smoothly, or a mixture of an atom and a spend distribution.

solid answer

~50 s

It is a mixed distribution — part discrete, part continuous — so neither a PMF nor a PDF covers it alone. A PMF cannot represent the smooth part, and no density can carry mass on the single point 0, since a density integrates to zero over one point. The CDF handles both: with a non-buyer share p, `F(0) = p` is a jump of height p, and above 0 the curve rises continuously. Equivalently write a mixture, `F(x) = p + (1 - p) * G(x)` for `x >= 0`, where G is the CDF of spend among buyers with `G(0) = 0`. That is also how you would model it: a purchase probability plus a conditional spend distribution. If p = 0.7, every quantile below the 70th is 0, so the median spend is 0.

go deeper

for a junior

Be ready to recognise that a variable can have a spike of probability at one exact value while varying smoothly elsewhere, and that the CDF is the description that copes with both, showing the spike as a jump.

for a middle

An interviewer expects the mechanics: why no density can hold mass on a single point, why a PMF cannot cover the continuous part, and how the mixture form F(x) = p + (1 - p) G(x) splits a buy probability from a conditional spend distribution.

for a senior

Show the reporting consequences you have actually hit: with a large zero share every low quantile is 0, high percentiles are buyer percentiles at a shifted level, and a change in the buy rate moves them even when buyer behaviour is unchanged.

for a principal

Own the metric definition. Decide whether the organisation tracks per-customer spend, buy rate and per-buyer spend separately, and make the choice explicit, because a single blended percentile lets two different mechanisms move a headline number without anyone being able to say which.

## Not every variable is discrete or continuous Introductory treatments present two kinds of random variable — discrete with a PMF, continuous with a PDF — and a lot of real business metrics are neither. Spend per customer over a window is the canonical case: most customers buy nothing, so a large chunk of probability sits exactly on the value 0, while the buyers' spend varies smoothly over positive amounts. Such a variable is called **mixed**: its distribution has a discrete atom glued to a continuous part. ## Why neither single object works - **A PMF fails.** It assigns positive mass to individual values and sums to 1. The positive-spend region cannot be described that way, since each individual spend amount carries zero probability there. - **A PDF fails.** A density's probability is area, and the area over the single point 0 is zero, no matter how the density is defined. So no density can carry the non-buyer mass p. There is no way to "put a tall spike at 0" that fixes this within ordinary densities. ## The CDF is the object that always works `F(x) = P(X <= x)` is defined for every random variable, and it represents both parts naturally. Let p be the probability of spending nothing. Then - `F(x) = 0` for `x < 0`, - `F(0) = p` — a **jump** of height p at 0, and the jump height is exactly the point mass, - `F(x)` rises continuously for `x > 0`, approaching 1. Atoms are jumps; continuous parts are smooth rises. Reading a distribution's CDF tells you immediately which regions carry mass on points and which spread it out. ## The mixture representation The most usable description is a two-part decomposition. Let B be the indicator of buying, `P(B = 0) = p`, and let G be the CDF of spend conditional on buying, with `G(0) = 0`. Then for `x >= 0` ``` F(x) = p + (1 - p) * G(x) ``` Read it as: with probability p you land on the atom at 0; otherwise you draw from the buyers' continuous distribution. This mirrors how such data is usually modelled — a purchase probability and a conditional spend distribution, estimated as two separate pieces — and it keeps the two mechanisms (whether someone buys, and how much they spend if they do) from being blurred into one shape. ## What this does to quantiles This is where the mixed structure bites in reporting. Suppose `p = 0.7`. The quantile at level q is the smallest x with `F(x) >= q`. Since `F(0) = 0.7`: - Every level `q <= 0.7` is already satisfied at `x = 0`, so **all** those quantiles equal 0. The median spend is 0. - The overall p90 solves `0.7 + 0.3 * G(x) = 0.9`, so `G(x) = 2/3`: the overall 90th percentile equals the buyers' 66.7th percentile. Two lessons follow. First, a median of 0 is not a broken metric — it is the correct answer, and it is uninformative precisely because the atom dominates. Second, overall percentiles above the atom are silently percentiles of the buyer distribution at a shifted level, so comparing overall p90 across two periods conflates a change in the buy rate with a change in the amount spent. ## How to report it The honest summary is two numbers rather than one: the share of customers with zero spend, and the distribution of spend among buyers. That separates the two mechanisms, and it makes a movement interpretable — either more people bought, or buyers spent differently, or both. Collapsing to a single overall percentile hides which one moved. What you should not do is quietly drop the zeros and report only buyers, while labelling the result as spend per customer. That is a different quantity — conditional on purchase — and it will systematically overstate the per-customer figure. ## The generalisation Any distribution decomposes into a discrete part and a continuous part, and mixed variables appear well beyond spend: any metric with a floor or a cap collects an atom there, and any quantity that is exactly zero unless an event occurs has an atom at zero. The recognition skill is the valuable one: see a spike at a boundary value, ask whether it is a genuine point mass rather than a narrow peak, and if it is, switch to the CDF or mixture description rather than forcing a density onto it. ## How to say it in an interview "It is a mixed distribution, so no single PMF or PDF describes it. I would use the CDF, which jumps by the non-buyer share at 0 and rises smoothly above, or equivalently a mixture: buy probability times a conditional spend distribution. Practically, if 70% spend nothing, the median is 0 and the overall p90 is the buyers' two-thirds quantile — so I would report the zero share and the buyer distribution separately."

  • If 70% of customers spend nothing, what is the median spend?
    Exactly 0. The median is the smallest value x with `F(x) >= 0.5`, and `F(0) = 0.7` already exceeds 0.5, so the atom at zero absorbs the median. Every quantile at a level up to 0.7 is likewise 0. That is the correct answer, not a bug — it just means the atom dominates and the metric conveys little on its own.
  • With a 70% non-buyer share, which buyer quantile does the overall p90 correspond to?
    The buyers' 2/3 quantile. The overall p90 solves `0.7 + 0.3 * G(x) = 0.9`, so `G(x) = 0.2 / 0.3 = 2/3`, where G is the CDF of spend among buyers. This is why overall high percentiles move when the buy rate changes even if buyers' behaviour is identical.
  • Why can't you write a single density for this variable?
    Because a density gives probability as area, and the area over the single point 0 is zero for any density. It therefore cannot carry the non-buyer mass p. You need an atom plus a density on the positive part, or the CDF, which represents the atom as a jump of height p and the continuous part as a smooth rise.
  • What is the risk of simply excluding the zeros before summarising?
    You switch to a different quantity — spend conditional on purchase — while still labelling it spend per customer, which systematically overstates it. The safer report is two figures: the share with zero spend and the distribution among buyers, so a movement can be attributed to the buy rate, to buyer amounts, or to both.

Think of a staircase with one tall step at the entrance followed by a smooth ramp: the step is the non-buyers, the ramp is how much buyers spend.

saying these in an interview costs you the question

  • Claims every random variable is either discrete or continuous
  • Fits a density and ignores the mass at zero
  • Asserts that a CDF must be continuous everywhere
  • Drops the zeros and still calls it spend per customer
  • Treats a median of zero as a broken calculation

context