Descriptive statistics: mean, median, range and mode set with repetitions kept

On this page
  1. Goal and scope
  2. Givens and symbols
  3. Rules and sources
  4. Main derivation
  5. Substeps and lemmas
  6. Reverse audits
  7. Error controls and negative controls
  8. Result and limitations
  9. Verification and source binding

← Guide index · Original MKO

derivation-mko-descriptive-statistics-01 · production-20261019-adopted-96

Goal and scope

For the observation list D=(4,10,1,3,8,1,6,3), keeping repeated values, find the number of observations n, the arithmetic mean, the median, the range and the mode set under this entry's convention; prove the general fact 'minimum ≤ mean ≤ maximum' and use it as a check; finally show that deduplicating first would give a different (wrong) mean and median.

Treats only a nonempty finite list of integer observations and the four summaries defined by the MKO; fully proves that the mean lies between the minimum and the maximum. It does not treat sample variance, other quantiles or charts, draws no population, probability or causal conclusion from the summaries, and does not reject other textbooks' phrase 'no mode'; it does not change the canonical MKO or its English edition.

Givens and symbols

  • numeric_evaluation
  • finite_sum_rules
  • frac_rules
  • order_basics
  • finite_counting_basics
  • G1 — D=(4,10,1,3,8,1,6,3) is an original synthetic list of integer observations; it is a list that keeps order and repeated values, not a deduplicated set (MKO assumptions a1, a2).
  • G2 — Mode-set convention: all values whose frequency is maximal, listed in increasing order, each once (MKO statement and assumption a3).
  • G3 — This task is a descriptive summary only; D is not assumed to be an independent sample from a population (MKO assumption a3).
  • D=(d_i)_{i=1}^{n} — the observation list, with order and repetitions
  • n — the number of observations
  • \bar d — the arithmetic mean
  • s_{(k)} — the k-th value after sorting
  • f(v) — the number of times v occurs in D
  • m,\ M — the minimum and the maximum

Rules and sources

  • numeric_evaluation · prerequisite — Exact evaluation of an explicit integer or rational expression; independently recomputable.
  • finite_sum_rules · prerequisite — Finite sums: Σ_{i=1}^{0} a_i=0 and Σ_{i=1}^{n+1} a_i=Σ_{i=1}^{n} a_i + a_{n+1}; Σ(a_i+b_i)=Σa_i+Σb_i; Σ c·a_i=c·Σa_i.
  • frac_rules · prerequisite — Fraction rules (all denominators nonzero): a/c+b/c=(a+b)/c; (a/b)(c/d)=(ac)/(bd); (a/b)/(c/d)=(ad)/(bc) (also needing c≠0); a/b=(ak)/(bk) for k≠0.
  • order_basics · prerequisite — Order of the reals: exactly one of u<v, u=v, u>v holds; u<v and v<w give u<w; u<v gives u+w<v+w; u<v and w>0 give uw<vw; u<v and w<0 give uw>vw.
  • finite_counting_basics · prerequisite — Finite counting: for disjoint finite sets A, B, |A∪B|=|A|+|B|; |A×B|=|A|·|B|; there is a bijection between finite sets ⇔ they have the same number of elements.
  • def_unfold · prerequisite — Unfolding a definition: replacing a defined term by its definition (or folding it back) does not change whether a statement is true.
  • nat_induction · prerequisite — Principle of induction: for a family P(n) starting at n₀, if P(n₀) holds and P(n)⇒P(n+1) for every n≥n₀, then P(n) holds for every n≥n₀.
  • mul_inverse_nonzero · prerequisite — Inverse of a nonzero number: in ℚ, ℝ or ℂ, if u≠0 there is 1/u with u·(1/u)=1, and v/u means v·(1/u). 0 has no inverse, so v/0 is undefined.
  • divides_def · prerequisite — Divisibility: for integers a, b, a∣b means there is an integer k with b=ak.
  • and_intro_elim · prerequisite — Conjunction: from P and Q infer P∧Q; from P∧Q infer P and infer Q.
  • mko_descstat_def · cited — For a nonempty finite real observation list D of length n, preserve repeated values. The mean is the sum divided by n. After sorting, the median is the middle value for odd n and the mean of the two middle values for even n. The range is max(D)−min(D). In this entry, the mode set contains all values with maximum frequency, listed in increasing order, including all distinct observed values when every frequency is one. · mko-descriptive-statistics
  • perm_invariance · prerequisite — Rearranging the entries of a finite list changes neither its sum nor the number of times each value occurs (generalized commutativity of finite sums, obtainable from add_assoc and add_comm by induction).
  • L_mean_bounds · lemma — For a nonempty finite real list (d_i)_{i=1}^{n}, if m≤d_i≤M for every i, then m≤(Σd_i)/n≤M.

Main derivation

S01 · definition

Before

D=(d_i)_{i=1}^{n},\ n>0

After

\bar d=\tfrac{1}{n}\sum_{i=1}^{n}d_i,\ \tilde d,\ R=\max D-\min D,\ \operatorname{Mo}(D)

Conditions: n>0

Rule: mko_descstat_def · Uses: G1, G2

Leaf basis: mko_descstat_def + def_unfold

State the MKO's four definitions: the mean is the sum divided by n; the median is taken after sorting (the middle value for odd n, the mean of the two middle values for even n); the range is the maximum minus the minimum; the mode set follows the convention of G2. Every computation is done on the list with repetitions kept.

S02 · implies

Before

D=(4,10,1,3,8,1,6,3)

After

n=8>0

Conditions: none

Rule: finite_counting_basics · Uses: G1

Leaf basis: finite_counting_basics

Counting positions, D has 8 entries; the repeated values 1 and 3 each occupy two positions, so n=8, not the number 6 of distinct values. Since n>0, the mean and the median are defined.

S03 · equivalent

Before

\sum_{i=1}^{8}d_i

After

4+10+1+3+8+1+6+3=36

Conditions: none

Rule: finite_sum_rules · Uses: G1, finite_sum_rules

Leaf basis: finite_sum_rules + numeric_evaluation

Add the terms one at a time by the recursive rule for finite sums; the partial sums are 4, 14, 15, 18, 26, 27, 33, 36. The value 1 is added twice, and so is 3; each observation is added once.

S04 · equivalent

Before

\bar d=\tfrac{36}{8}

After

\bar d=\tfrac{9}{2}

Conditions: 8\neq 0

Rule: frac_rules · Uses: S01, S02, S03

Leaf basis: frac_rules + numeric_evaluation

The mean is 36/8. Dividing numerator and denominator by gcd(36,8)=4 (frac_rules, a/b=(ak)/(bk) with k≠0) gives 9/2; gcd(9,2)=1, so it is reduced (MKO assumption a2). Check: 8·(9/2)=36, so the deviations from the mean sum to 36−8·(9/2)=0.

S05 · implies

Before

(4,10,1,3,8,1,6,3)

After

(s_{(k)})_{k=1}^{8}=(1,1,3,3,4,6,8,10)

Conditions: none

Rule: perm_invariance · Uses: G1, perm_invariance

Leaf basis: perm_invariance + finite_counting_basics

Arrange D in increasing order. Check that only the order changed: in both lists 1 and 3 occur twice each and 4, 6, 8, 10 once each, 8 entries in all, and the sum is still 36. By MKO assumption a1, sorting changes only the order and does not remove repeated values.

S06 · equivalent

Before

\tilde d,\ n=8\ \text{even}

After

\tilde d=\tfrac{s_{(4)}+s_{(5)}}{2}=\tfrac{3+4}{2}=\tfrac{7}{2}

Conditions: n\ \text{even}

Rule: mko_descstat_def · Uses: S01, S02, S05

Leaf basis: mko_descstat_def + frac_rules + numeric_evaluation

n=8 is even, so the two middle positions are n/2=4 and n/2+1=5. After sorting, s_(4)=3 and s_(5)=4, and the median is their mean (3+4)/2=7/2. It lies between 3 and 4 and is not one of the observations.

S07 · equivalent

Before

R=\max D-\min D

After

R=10-1=9

Conditions: none

Rule: mko_descstat_def · Uses: S01, S05

Leaf basis: mko_descstat_def + order_basics + numeric_evaluation

After sorting, the minimum is the first entry 1 and the maximum is the last entry 10; sorting does not change which observations are present, so these are also the minimum and maximum of D. The range is 10−1=9.

S08 · implies

Before

f(v)\ \text{for } v\in\{1,3,4,6,8,10\}

After

f(1)=2,\ f(3)=2,\ f(4)=f(6)=f(8)=f(10)=1

Conditions: none

Rule: finite_counting_basics · Uses: G1, S05, finite_counting_basics

Leaf basis: finite_counting_basics + numeric_evaluation

Count how often each value occurs. Check: 2+2+1+1+1+1=8=n, so every observation is counted exactly once. Frequencies must be counted with repetitions kept (MKO second paragraph).

S09 · implies

Before

\max_v f(v)=2

After

\operatorname{Mo}(D)=\{1,3\}

Conditions: none

Rule: mko_descstat_def · Uses: S08, G2

Leaf basis: mko_descstat_def + order_basics

The maximum frequency is 2, attained by 1 and 3. By the convention of G2 both belong to the mode set, listed in increasing order, each once: {1,3}. Omitting a tied value is a misconception the MKO lists.

S10 · theorem_application

Before

1\le d_i\le 10\ \text{for every } i

After

1\le \tfrac{9}{2}\le 10

Conditions: n=8>0

Rule: L_mean_bounds · Uses: S04, S07, L_mean_bounds

Leaf basis: L_mean_bounds + numeric_evaluation

Every observation lies between the minimum 1 and the maximum 10, so by Lemma L_mean_bounds (m=1, M=10) the mean 9/2 must lie between 1 and 10; indeed 1≤9/2≤10. This is a plausibility check of S04 and cannot replace the computation in S03 and S04. The lemma is proved in S10.1 to S10.3.

S11 · implies

Before

\bar d=\tfrac{9}{2},\ \tilde d=\tfrac{7}{2}

After

\bar d\notin D,\ \tilde d\notin D

Conditions: none

Rule: numeric_evaluation · Uses: S04, S06, G1

Leaf basis: numeric_evaluation + divides_def

9/2 is in lowest terms with denominator 2 (9 leaves remainder 1 on division by 2), so it is not an integer; every observation in D is an integer, so the mean is none of the observations. Likewise 7/2 is not an integer, so the median is none of the observations either. MKO first paragraph: the mean need not be an observation, and for even n the median may lie between the two middle values.

S12 · implies

Before

\{1,3,4,6,8,10\}\ \text{(deduplicated)}

After

\tfrac{32}{6}=\tfrac{16}{3}\neq\tfrac{9}{2},\quad \tfrac{4+6}{2}=5\neq\tfrac{7}{2}

Conditions: none

Rule: mko_descstat_def · Uses: S04, S06, G1

Leaf basis: mko_descstat_def + numeric_evaluation

If D were first deduplicated to {1,3,4,6,8,10} (6 values), the mean would be (1+3+4+6+8+10)/6=32/6=16/3 and the median (4+6)/2=5, both different from S04 and S06. So deduplication really changes the results and violates MKO assumption a1; the correct answers are those for D with repetitions kept. Deduplication preserves the minimum and maximum of any nonempty finite observation list, so it always preserves the range (10−1=9 here); this does not make it harmless for summaries such as the mean, median, or frequencies.

S13 · implies

Before

\text{tasks of the goal}

After

n=8,\ \bar d=\tfrac{9}{2},\ \tilde d=\tfrac{7}{2},\ R=9,\ \operatorname{Mo}(D)=\{1,3\}

Conditions: none

Rule: and_intro_elim · Uses: S02, S04, S06, S07, S09, S10, G3

Leaf basis: and_intro_elim

Combine: n=8, mean 9/2, median 7/2, range 9, mode set {1,3}; the mean passes the check 1≤9/2≤10. By G3 these numbers describe D itself only and imply no population mean, probability model or causal conclusion.

Substeps and lemmas

S10.1 · implies

Before

m\le d_i\ \text{for every } i

After

nm=\sum_{i=1}^{n}m\le\sum_{i=1}^{n}d_i

Conditions: none

Rule: finite_sum_rules · Uses: finite_sum_rules, order_basics

Leaf basis: finite_sum_rules + order_basics + nat_induction

Add the terms one at a time for k from 0 to n: at k=0 both sides are 0. If Σ_{i≤k} m ≤ Σ_{i≤k} d_i and m≤d_{k+1}, then by order_basics (adding a number to both sides and using transitivity: u≤v and w≤z give u+w≤v+w≤v+z) Σ_{i≤k+1} m ≤ Σ_{i≤k+1} d_i. By induction this reaches k=n. The left side, n copies of m, equals nm (finite_sum_rules, Σ c·1=c·n).

S10.2 · implies

Before

nm\le\sum_{i=1}^{n}d_i,\ n>0

After

m\le\tfrac{1}{n}\sum_{i=1}^{n}d_i=\bar d

Conditions: n>0

Rule: order_basics · Uses: S10.1, order_basics, mul_inverse_nonzero

Leaf basis: order_basics + mul_inverse_nonzero + frac_rules

Since n>0, 1/n exists and 1/n>0. By order_basics, multiplying both sides of an inequality by the positive number 1/n keeps its direction: m=(nm)/n≤(Σd_i)/n=d̄.

S10.3 · implies

Before

d_i\le M\ \text{for every } i

After

\bar d\le M

Conditions: n>0

Rule: order_basics · Uses: S10.1, S10.2

Leaf basis: order_basics + finite_sum_rules + mul_inverse_nonzero

The same argument as S10.1 and S10.2 with the inequalities d_i≤M: Σd_i≤nM, then multiply by 1/n>0 to get d̄≤M. S10.1 to S10.3 together prove Lemma L_mean_bounds.

Reverse audits

  • S13 · sufficient_goal_reduction · S02, S04, S06, S07, S09, S10, S12 — Goal G: the summaries and checks asked for. Sufficient condition H: the conclusions of S02 to S12; H⇒G uses only conjunction. H is derived forwards from G1 to G3; G is never used as a premise.
  • S12 · premise_audit · S04, S06, numeric_evaluation — A counterexample needs only one concrete instance (N12 to N14); it shows that deduplication does not in general preserve the mean and the median.
  • S11 · premise_audit · S04, S06, divides_def — It claims only that these two summaries are not in D; it does not claim that a mean or median can never be an observation.
  • S10.3 · premise_audit · S10.1, S10.2, order_basics — It likewise needs termwise upper bounds and n>0.
  • S10.2 · premise_audit · S10.1, order_basics, mul_inverse_nonzero — n>0 is essential: multiplying by a negative number would reverse the inequality, and for n=0 the mean is undefined.
  • S10.1 · premise_audit · finite_sum_rules, order_basics, nat_induction — Every term must satisfy m≤d_i; if one term were below m the conclusion could fail. No converse is claimed.
  • S10 · premise_audit · L_mean_bounds, S07 — The lemma needs n>0 and termwise bounds; no converse is claimed: a number in [1,10] need not be the mean.
  • S09 · premise_audit · S08, G2, mko_descstat_def — It needs the complete frequency table; looking only at the first value with maximum frequency would miss 3.
  • S08 · premise_audit · finite_counting_basics, S02 — The frequencies summing to n is a necessary check (N8); it is not claimed that the frequency table recovers the original order.
  • S07 · inverse_equivalence · mko_descstat_def, numeric_evaluation — An exact computation (N7), two-way.
  • S06 · inverse_equivalence · mko_descstat_def, numeric_evaluation — After unfolding the definition it is an exact computation (N6), two-way; the positions must be taken in the sorted list.
  • S05 · premise_audit · perm_invariance, finite_counting_basics — What is needed is that each value occurs equally often (N5, N8); the sorted list is in general not equal to the original list, so only 'the same observations' is claimed, not equality of the lists.
  • S04 · inverse_equivalence · frac_rules, numeric_evaluation — Backward: multiply numerator and denominator by 4 to return to 36/8; this needs 8≠0 and 4≠0.
  • S03 · inverse_equivalence · finite_sum_rules, numeric_evaluation — An exact integer computation (N1) that can be recomputed, two-way.
  • S02 · premise_audit · G1, finite_counting_basics — What is counted is list positions, not distinct values; this is exactly what MKO assumption a1 requires.
  • S01 · premise_audit · G1, G2, mko_descstat_def — This step only states the definitions and derives no new fact; n>0 is what makes the mean defined.

Error controls and negative controls

Do not deduplicate first

One misconception the MKO names is deduplicating before computing. After deduplication the mean becomes 16/3 and the median 5 (S12), neither of which summarizes D. Repeated values are part of the data: two 1s mean two observations equal to 1.

Every tied value of maximal frequency belongs to the mode set

1 and 3 both occur twice, so the mode set is {1,3}, not {1}. If every value occurred once, under this entry's convention all distinct values would be in the mode set; other textbooks may call that 'no mode', which is a different convention, not a contradiction (MKO assumption a3).

Take the median after sorting

In the unsorted D the 4th and 5th entries are 3 and 8, whose mean 11/2 is not the median. One must first sort to (1,1,3,3,4,6,8,10) and then take the 4th and 5th entries 3 and 4, giving 7/2 (S06).

  • The median is the mean of the 4th and 5th entries of D, (3+8)/2=11/2 → reject — The median is taken after sorting; the sorted 4th and 5th entries are 3 and 4, so the median is 7/2.
  • The mean is (1+3+4+6+8+10)/6=16/3 → reject — That is the mean after deduplication; with repetitions kept it is 36/8=9/2.
  • The mode set is {1} → reject — 3 also occurs twice, the maximum frequency; the mode set is {1,3}.
  • The mean of D is 9/2, so the population that produced D has mean 9/2 → reject — A descriptive summary describes D only; there is no population or sampling model here (MKO assumption a3).

Result and limitations

For D=(4,10,1,3,8,1,6,3): n=8, mean 36/8=9/2, median after sorting (3+4)/2=7/2, range 10−1=9, mode set {1,3}; and 1≤9/2≤10. Deduplicating first would wrongly give mean 16/3 and median 5. These summaries describe D only and support no population inference.

  • perm_invariance (generalized commutativity of finite sums and preservation of frequencies under sorting) is used as a prerequisite and is not proved here.
  • Sample variance, other quantiles, charts and probabilistic moments are outside this guide; the type distinction between descriptive summaries and probabilistic expectations is left to later slices.
  • The MKO's formal next step (bridging finite list sums, sorted medians and maximal-frequency sets) is not done.

Verification and source binding

17 declared checks for this guide; only the listed expressions are covered.

  • source commit: b28a5edbd46279b1db2a3f3f48bb3f447e18899f
  • adopted source SHA-256: de10c74e217f968eb9b391752651fd9f7f2626b798bfb8e87c9af6eadff7e2e3
  • original source SHA-256: de10c74e217f968eb9b391752651fd9f7f2626b798bfb8e87c9af6eadff7e2e3
  • Lean: NOT_RUN · independent AI: NOT_MEASURED

Same-source full JSON (formulas, ASTs, controls and revision log)