Skip to content
Roberto Mladina
Local time in Ingolstadt:
DE – Deutsch EN – English

Logbook · Event 30 November 2026 · Fundamentals

Mean or median: what an average hides

9 min read

  1. 01Term

    The mean divides the sum of all values by how many there are, the median is the value in the middle of the ordered series.

  2. 02Meaning

    A single number for many values always leaves something out, and what it leaves out only shows in the distribution of the values.

  3. 03In my work

    In one night my home page usually arrived in 0.29 seconds, but almost every fifth load hung, and the mean of 3.63 seconds fitted none of them.

  4. 04What stays

    If an AI agent reports a number for many measurements, I ask whether it is the mean or the median and how the values are distributed.

Evidence

# Home page of mladina.de, 29 Nov 2026 23:02 to 30 Nov 2026 09:02
# one load per minute with a new connection
Loads                                 600
Median                             0.29 s
Mean                               3.63 s
Loads between 3.3 and 3.9 s             0
faster than the mean                  494
longer than 1 s                       115
aborted after 30 s                     27

This is the fourth post from my university certificate “KI-Kompetenzen für die Praxis” (AI skills for practice) at Hochschule München (Munich University of Applied Sciences). It is about the mean and the median. Both boil many measurements down to a single number. Using a measurement of my own site, I show what can get lost in the process.

On 29 November 2026 I wrote to my AI agents: “The site is slow to respond.” Their first measurement found that moving to another page on mladina.de usually takes just under 0.3 seconds until the content appears. But some connections hung for almost 20 seconds. Both were true. The night after, I had a program load the home page 600 times, once a minute. The median of these 600 loads is 0.29 seconds, the mean is 3.63 seconds. Not a single load took anything close to 3.63 seconds.

Terms on this page
Mean
The sum of all values divided by how many there are. In everyday speech it is called the average. Experts also say arithmetic mean.
Median
The value in the middle when you put all values in order of size. Half of the values lie below it, the other half above.
Outlier
A value that lies far from most of the others. Here it is a load that hangs for 20 seconds while the others take 0.3 seconds.
Distribution
How many values lie where. It shows, for example, whether the values lie close together or split into two groups.
Histogram
A picture of the distribution made of bars. Each bar shows how many values fall into one range.
Fund
A pot of many securities from which you can buy shares.
Percentage point
The gap between two percentages. From 10 to 12 per cent is 2 percentage points.
Server
A computer that holds a website ready and sends it to every visitor.
TLS
Once the server has answered, it and the browser agree on encryption. Only then does the server send the page. The method for this is called TLS.
AI agent
A program that uses an AI to carry out tasks on its own.

The mean uses every value, the median only looks at the middle

For the mean, you add up all values and divide the sum by how many there are. In everyday speech it is called the average. For the median, you put all values in order of size and take the value in the middle. Half lie below it, the other half above. With an even number of values, two values stand in the middle. Then you take the value exactly between the two.

Five loads in a row from the night, starting at 02:18, show how differently the two work. Four were fast: 0.25, 0.28, 0.32 and 0.26 seconds. The fifth hung for 20.06 seconds. Together that is 21.17 seconds. Divided by five, this gives a mean of 4.23 seconds. In order of size the series reads 0.25, 0.26, 0.28, 0.32 and 20.06. The median is the value in the middle, so 0.28 seconds.

20.06 sØ 4.23 smedian 0.28 s20 s
Five loads from 02:18 on a line from 0 to 20 seconds. Four lie close together on the far left, and the median is with them. The mean (Ø) lies on the empty stretch in between.

Without the slow load, the mean of the other four would be 0.28 seconds. With it, the mean is 15 times as high. The median, by contrast, hardly moved because of that one value. For the median, all that counts is which value stands in the middle of the ordered series. Whether the largest value is 1 second or 20 seconds changes nothing about that. A value that lies this far from the others is called an outlier.

In one night, almost every fifth load hung

For the measurement, a small program on one of my computers loaded the home page of mladina.de every minute from 23:02 to 09:02. Each load opened a new connection, like someone opening the site for the first time. What was measured was the time until the server had sent the whole page, without images. After 30 seconds the program gave up. These loads count as 30 seconds, because a visitor would have waited at least that long. One load failed with an error after only 2.5 seconds and counts with that time. With every load, the program introduced itself with a name by which a program can be recognised. That way my visitor counter does not count it.

485 of the 600 loads arrived in less than a second, almost all of them in 0.2 to 0.4 seconds. The other 115 took longer than a second. I call these loads hangs here. Of them, 53 took longer than 20 seconds, and of these 53 the program aborted 27 after 30 seconds. From 4 in the morning it got worse. Between 4:00 and 9:00, almost every third load was a hang, before that about every twelfth.

30 s0 s23:004:009:00
Each dot is one load of the home page, from 23:00 to 9:00. Most lie at the bottom on the line at 0.3 seconds. From 4:00, many more dots reach upwards. A cross (✕) marks a load that was aborted after 30 seconds.

The median of this night is 0.29 seconds. It says the site is fast. That is true for most loads. The mean is 3.63 seconds. It says a load takes a good three and a half seconds. That is true for none. Not a single value of the measurement lies between 3.3 and 3.9 seconds. 494 loads were faster than the mean, only 106 slower.

I do not yet know what causes the hangs. Usually the server answered at once. But then it took a long time until the encryption (TLS) was agreed and the page arrived. In 23 of the 27 aborted loads, the server did not answer at all. The measurement now shows me when it stalls, though, and that helps in the search for the cause.

Only the distribution shows both groups

The measurement contains two groups: many fast loads and a smaller group of hangs. The median describes only the large group. The hangs vanish in it completely. The mean mixes both groups and describes neither of them. Both become visible only in the distribution. For that, you divide the values into ranges and count how many fall into each range. If you draw this as bars, the picture is called a histogram.

4787161630262700.515102030Ø 3.63 smedian 0.29 s
The same 600 loads, counted by range in seconds. 478 lie under half a second, and the median is with them. After that comes a long, flat remainder up to the abort after 30 seconds (✕). The mean (Ø) lies in this remainder.

The median can mislead too. Suppose half of the loads took 0.3 seconds and the other half 20 seconds. Then one fast and one slow load would stand in the middle of the ordered series. The median would lie exactly between the two, at a little over 10 seconds, and the mean at the same spot. Not a single load would have taken that long. Only the distribution would then show the two equally large groups.

My checks overlook single outliers on purpose

My websites are monitored by programs that my AI agents built. Two of them measure whether a site is fast and reachable. Neither is supposed to raise the alarm at every single outlier. The load-time check loads each page three times and takes the median. A single slow load therefore does not change its result. The availability check loads the page every five minutes. It only sends me a message when the page fails to answer twice in a row.

In the night of the measurement, the availability check ran 121 times. 13 times it got no answer, four of those twice in a row. So it sent me a message four times. How often the site was merely slow was shown by neither check. Since the evening of 30 November 2026, the availability check has therefore also counted the share of loads that take longer than a second.

A test in the best of 184 periods

I have seen the same with investments: a single number deceives when you do not know the distribution. That was in my first attempt to let AI agents run a securities account, the Portfolio Manager. It was about a rule that switches between several funds depending on how prices develop. The Portfolio Manager works without real money. On 25 September 2026, an agent used the real prices of the last two years to calculate what the rule would have earned. Its result: it met all four conditions that had been set beforehand for putting it into practice.

After that, the same rule was recalculated over 17 years. These 17 years can be divided into periods of two years each: one starts in January, the next in February, and so on. That produced 184 periods. The period from the first test was the best of all 184. A second model, with a slightly different calculation, put it in second place. The comparison was with simply holding one broad fund. In the period of the first test, the rule was about 50 percentage points ahead, in the median of all 184 periods a little over 2. If you took a single fund out of the rule, the lead was gone entirely. The agent therefore advised against putting the rule into practice. The number from the first test was an outlier, and only the distribution over all periods showed that.

What I take from this

A mean fits well when the values lie close together. If they form groups or there are outliers, it may describe not a single case. The median then often describes the largest group and says nothing about the others. With two equally large groups, it too describes no case. Before I trust a single number, I look at how the values are distributed. If an AI agent reports a number for many measurements, I ask whether it is the mean or the median and what the distribution looks like.

In the post on data literacy, I put three questions to every number: What does it count? What does it leave out? How old is it? The median of this night is formed from all 600 loads. Even so, its value of 0.29 seconds does not let you see the 115 hangs.