
Measurement and Chance
As we have shown previously, the accuracy of an assessment of a phenomenon depends on both measurement and sampling errors. These two types of errors are both random in nature—that is, they are due to chance. This applies equally to user research and to digital performance measurement.
People generally have a rather mistaken idea of chance: they associate it with a form of chaos. While this may be true for small samples, chance actually becomes very “organized” as the number of observations increases.
What is chance?
Antoine Augustin Cournot offers the following definition of chance:
“Chance is not merely an expression of our ignorance of causes; it is the encounter of two independent causal series. Events themselves are entirely determined in terms of their cause and effect; it is from their unpredictable encounter—from the intrusion of a new, independent causality into the course of a process—that chance arises.”
Probability is the branch of mathematics devoted to modeling random phenomena. A basic understanding of probability is essential for the proper use of measurement tools and statistics.
In fact, when we measure a quantity that can take on different values due to chance, we say that it is random. Thus, the different values it can take are due to causes—not necessarily unknown—but whose combination will have an effect on it that cannot be predicted. We thus say that the variable is “distributed” across the different values (or modes) it can take. Understanding random variables is closely linked to understanding measurement scales.
Back to basics: heads or tails
The basis of probability is the coin toss (or a Bernoulli trial, in mathematical jargon): you flip a coin, and there’s a one-in-two chance that it will land on one side or the other (if it’s fair). This is exactly the same as randomly drawing a ball from a bag that always contains an equal number of black and white balls (this is called a draw with replacement: the previously drawn ball is returned to the bag. Thus, the next draw is not influenced by the previous one; they are said to be “independent”). This variable therefore corresponds to a nominal scale with two equally likely categories (each has an equal chance of being chosen).
It’s easy to calculate the probabilities of obtaining a certain outcome when the number of trials is small. Here, we simulate three consecutive trials that are equally likely to result in a success or a failure (or heads or tails, white or black, bouncing or not, satisfied or not, etc.):

We can see that there is only a 1 in 8 chance (12.5%) of having no successes. The same applies to a roll that yields only successes. However, there is a 3-in-8 chance (37.5%) of rolling 2 successes and 1 failure, or the reverse. Graphically, this is illustrated below. This is called a probability mass function:

Calculating the probabilities of random outcomes by hand quickly becomes tedious as the number of outcomes increases. Fortunately, the binomial distribution allows us to do this easily, and statistical software such as R makes it simple to calculate. Thus, using the binomial distribution, we can extend the exercise to 20 equally likely draws:

And even 40 prints:

We can see that the probabilities of obtaining a particular distribution of coin flips (that is, the proportion of heads and tails) tend to follow a characteristic bell-shaped curve (we’ll come back to this point).
While this result may seem counterintuitive, it can be empirically demonstrated using a “Galton board.” This mechanical device simulates the fall of a large number of marbles onto pegs that cause them to randomly go left or right (which corresponds to an equal number of heads or tails).
The experiment clearly confirms the mathematical predictions. But how can this probability distribution be useful to us in measuring user experience and digital performance?
Applying Probability to Measuring Website Traffic
Let’s return to the data we presented in the article on understanding measurement errors. In that article, we discussed the proportion of men and women who visit UXMetric. This is a random variable with two categories: we do not know the combination of factors that lead men or women to visit this site. Below, we show the respective proportions of men and women who visited our site during two consecutive periods:

We observe that, from week to week, the proportion of men and women visiting the site has ranged from approximately 25–75% to 50–50% (according to Google Analytics; we are deliberately disregarding this tool’s data collection biases). The question is: what is the probability of observing these proportions when we do not know a priori the gender distribution of our visitors? Given that there were approximately 130 weekly visitors during this period, but that Google Analytics sampled 24.42% of the sessions (i.e., 33 out of 130), we plot the following binomial distributions: one that is equiprobable (50% men or women), and the other that is biased (25% women and 75% men):

We can see that if UXMetric’s audience is indeed composed of 25% men and 75% women (green distribution), it is not impossible—though unlikely—that by randomly sampling 24.42% of the 130 sessions, we might end up with an equal split of 50% men and 50% women (green arrow). Conversely, if our audience contains an equal number of men and women (red distribution), it is not impossible that the sample would consist of only 25% men and 75% women (red arrow). It is, of course, possible that an unknown cause explains this, but until it is identified, we cannot distinguish it from chance. This may, however, alert us to a possible bias. In that case, it would be up to us to determine what the cause might be.
However, we have no reason to believe that the gender breakdown of our website’s visitors is not balanced. And this is precisely what a sample of 39.45% of the 12,000 total sessions since the site’s creation (as of February 1, 2021) shows:

As the following graph shows, the probability that the result would be different—even if we sampled 39.45% of the 12,000 sessions—is truly minuscule (though still possible):

The highest probabilities are concentrated around the target value—namely, 50% men or women. In short, the “bell curve” becomes narrower. Proportions that deviate from 50-50, while not theoretically zero, are so close to zero that they are in reality virtually impossible to obtain in a sample of this size. But not in a smaller sample of “only” 33 observations.
From coins to dice…
How does this reasoning apply when chance acts on a variable with more than two categories? Simply replace the coin with a die! The principle remains the same and thus corresponds to a nominal or ordinal random variable with N categories. Although there are all kinds of dice, let’s stick with a 6-sided die with equal probabilities (i.e., not loaded) that we’ll roll 1 to 5 times (as shown in Figure 9). In this case, the binomial distribution is replaced by the multinomial distribution. This distribution is actually quite difficult to represent graphically, which is why, for convenience, we will add up the results obtained from each roll.

When you roll the die once, there is a 1 in 6 chance of landing on any one of the faces (blue graph for N=1 roll). If you roll the die twice and add the results, you get the green graph (N=2). Out of 36 possible combinations (6×6 faces), only one combination can result in 2 (1+1) or 12 (6+6). On the other hand, 6+1, 1+6, 5+2, 2+5, 4+3, and 3+4 can all result in 7. That’s 6 out of 36 chances, or 1 in 6. If we increase the number of dice rolls, we see that the probability of obtaining a particular sum again takes the bell-shaped form we’ve already observed: this is what is known as a normal distribution.
It is called this because the central limit theorem predicts that any (or almost any) random variable converges to this distribution as the number of trials increases (and provided that the trials are independent of one another—that is, previous trials do not influence subsequent ones). This is illustrated by the last graph in the lower right corner, which compares the different distributions calculated for 2 to 5 rolls (corresponding to the colors in the graphs) with the normal distribution (in black). This convergence is clearly visible as the number of rolls increases.
This explains the importance of the normal distribution in traditional statistics.
… From dice to marbles!
However, the normal distribution applies only to continuous variables, which is not the case for coins or dice, which are discrete variables. They cannot take on an infinite number of values, unlike continuous scales. Yet the reasoning remains the same. If there are dice with 3, 4, 6, 10, 30, 50, or even 120 faces, what would a die with an infinite number of faces look like? A sphere! This is what happens when we measure a variable that can take on an infinite number of values.
This is the case, for example, with the load time of UXMetric.com, which we measured 90 times using the webpagetest.org tool.
The problem is that if the ball has an infinite number of faces, the probability of landing on any one of them is 1 in infinity! Which is equivalent to zero. It’s quite counterintuitive. Let’s look at how the 90 load time measurements we collected are distributed:

Since there are theoretically an infinite number of possible load times, each measurement is generally observed only once. However, there are a few load times that are measured twice. This is obviously due to the precision of the measurement tool, which does not go below one-thousandth of a second (whereas actual load times can be shorter). Consequently, this comb-shaped graph shows us that all possible load times have the same probability of being measured. This is a characteristic unique to continuous scales.
To overcome this problem, we no longer seek to determine the probability (or frequency) of a specific value occurring, but rather that of a set of contiguous values: this is called a “class.” This amounts to discretizing the continuous variable. The class containing the largest number of observations is then called the “modal” class. It then behaves like an ordinal variable. Graphically, it looks like this:

Unlike the previous distributions that we plotted graphically—which were theoretical—this one is empirical. That is why it represents (observed) frequencies rather than (expected) probabilities.
The question is: What would this distribution look like if it had an infinite number of classes? In short, as if it were continuous—which it is! To answer this, we need to shift from the concept of probability to that of “probability density,” represented as follows:

We can see that the observed probability density deviates significantly from the theoretical normal distribution. While this is true in terms of both shape and mean, it is not all that far off. We do indeed see this “bell-shaped” form, albeit an imperfect one. The bell-shaped curve is more pronounced on the right side of the distribution than on the left. This is entirely normal when measuring duration. The normal distribution theoretically ranges from negative infinity to positive infinity. However, in this case, the measurement scale has a left boundary. We cannot measure durations less than zero. This explains the asymmetry.
Ultimately, the value of this type of representation lies in its ability to determine how atypical a measurement is—that is, how far it deviates from the mean (which is the expected value if the measurement were repeated multiple times, known as the mathematical expectation). This is because the further a measurement deviates from the mean, the rarer it is likely to be. This allows us to assess the uncertainty associated with measurement and sampling errors.
Conclusion
The purpose of this article was to raise awareness about the importance of taking random factors into account. These factors influence the measurements we can take regarding user experience and digital performance. The idea is to take a step back from our analysis of metrics in order to improve our interpretations. With this in mind, we invite you to watch the video below by Mickaël Launay. It explains how to better understand “randomness” and how it works:
