CommerceLens
Random Variables & Uncertainty

Random Variables

A random variable assigns a number to the outcome of an uncertain process. X = items_purchased (per purchasing session) is discrete: it can only take a finite, countable set of values (1, 2, 3, …). Y = number of purchases generated in N sessions is also discrete, and is treated fully below (as an expected value here, and as a full probability model on the Conversion Forecast Simulator). Z = order_value is continuous: it can take any value in a range, not just whole numbers. All three are studied here directly from the observed dataset.

Probability Mass Function — Items Purchased

PMF of X = Items Purchased
P(X = k) for each observed item count k, among purchasing sessions
Expected Value E[X]
1.6
items
Variance
0.89
Std. Deviation
0.94
items

Cumulative Distribution Function

CDF of X = Items Purchased
F(k) = P(X ≤ k)

The PMF answers “what is the probability X is exactly k?” The CDF answers “what is the probability X is at most k?” A CDF is always monotonically non-decreasing and climbs to 1 as k reaches the largest possible value — here F(9) = 100.0%, since almost every purchasing session buys 9 items or fewer.

The PMF is a lookup table of exact probabilities for each possible outcome. The CDF is a running total of those probabilities, so it tells you the chance of landing at or below a given value — useful for questions like 'what share of purchases involve 3 items or fewer?'

Expected Business Value

Expected value is a probability-weighted average of all possible outcomes — the long-run average you would see if the same random process repeated many, many times. It is not a prediction or guarantee for any single session or customer; an individual purchase could easily land above or below it.

Expected Items / Purchase
1.6
Expected Order Value
₹4,685
Expected Conversions / 1,000 Sessions — E[Y]
275.4
Business Question
If we ran 1,000 fresh sessions through today's funnel, how many would we expect to convert?
Metric
E[conversions per 1,000 sessions] = 1,000 × P(purchase)
Observation
About 275 conversions per 1,000 sessions, on average.
Interpretation
This is a planning figure for capacity and revenue forecasting, not a promise about any specific batch of 1,000 sessions — actual outcomes will vary around this average, sometimes considerably (see the Binomial simulator for how much).
Caveat
Assumes future sessions behave like the historical sample; changes in traffic mix, pricing, or seasonality would shift the true probability.

Variance & Standard Deviation by Segment

Two segments can have a very similar average order value while behaving completely differently in practice, if one is far more variable than the other. The table below compares mean, variance, standard deviation, and sample size for every customer segment.

SegmentMean Order ValueVarianceStd. Deviationn
Loyal₹3,9444,97,70,557₹7,055409
New₹4,5239,90,28,811₹9,9511,356
Occasional₹4,71012,15,50,463₹11,0257,116
Regular₹4,73011,94,18,299₹10,9287,641
Business Question
Where does 'similar average value, very different variability' actually show up in this dataset?
Metric
Segment pair minimizing mean gap while maximizing std. deviation gap
Observation
New and Occasional have mean order values within 4.0% of each other (₹4,523 vs ₹4,710), yet their standard deviations differ by roughly 1.11× (₹9,951 vs ₹11,025).
Interpretation
Two segments can look identical on a single 'average order value' KPI and still carry very different risk/predictability profiles. The higher-variance segment's order values are spread much more widely around the same center, so forecasting revenue or planning inventory for it is inherently less certain, even though the expected value looks the same.
Caveat
Highlighted pair is selected automatically each time this page loads, by maximizing the ratio of std-deviation gap to mean gap across all segment pairs — it is not a hand-picked example.

Bernoulli Random Variable — Did This Session Convert?

Zoom into a single session and ask one yes/no question: did it end in a purchase? That outcome is a Bernoulli trial — a random variable that takes value 1 (“success”, a purchase) with probability p, or 0 (“failure”) with probability 1−p. Here p is simply the dataset’s observed overall conversion rate.

p (P success)
27.5%
1 − p (P failure)
72.5%
Mean = p
0.2754
Variance = p(1−p)
0.1995
Bernoulli Random Variable
A Bernoulli random variable is the simplest possible random variable: a single coin flip with a possibly unfair coin. Here, 'heads' means the session converted, and the coin's bias is set to match how often that actually happens in the data.
Every figure on this page is computed directly from the observed 60,000-row synthetic session dataset — the PMF, CDF, expected values, and Bernoulli parameter are empirical summaries, not assumed or fitted distributions. Forward-looking, assumption-driven models (Binomial, Hypergeometric, and continuous distributions) live on the following pages and are labeled as model simulations.