Video failed to load

Min-Max Inclusion-Exclusion: Derive Extremum Identities by Thresholds

467 words
2 minutes
Min-Max Inclusion-Exclusion: Derive Extremum Identities by Thresholds

An extremum may be hard to handle directly even when the minimum of a selected subset has a clean formula. Min-max inclusion-exclusion is a bridge between the two. The safest derivation goes through threshold events, because the same reasoning extends to expectation and kth order statistics.

The indicator identity#

For a finite nonempty set of nonnegative values aia_i and a threshold t>0t>0, the statement max⁡iai≥t\max_i a_i\ge t is a union of events Ei=[ai≥t]E_i=[a_i\ge t]. Inclusion-exclusion gives

[max⁡iai≥t]=∑∅≠S(−1)∣S∣+1[min⁡i∈Sai≥t].[\max_i a_i\ge t]= \sum_{\varnothing\ne S}(-1)^{|S|+1} [\min_{i\in S}a_i\ge t].

For nonnegative integers, sum over positive integer thresholds. Each variable aa contributes exactly aa true thresholds. For nonnegative real values, integrate over tt. Either way,

max⁡iai=∑∅≠S(−1)∣S∣+1min⁡i∈Sai.\max_i a_i= \sum_{\varnothing\ne S}(-1)^{|S|+1}\min_{i\in S}a_i.

Negative finite values can be handled by shifting all values by a common lower bound and then shifting the result back. The threshold proof should not silently integrate an infinite negative tail.

numeric check#

Take [2,5,8][2,5,8]. Singleton minima sum to 15. Pair minima are 2, 2, and 5, totaling 9. The triple minimum is 2. Thus 15−9+2=815-9+2=8, the maximum.

This is not a faster algorithm for finding a maximum in an ordinary array. It replaces an easy linear computation with exponentially many subsets. The identity becomes useful only when the subset minimum is algebraically simpler than the original maximum and the number of underlying events is small.

The kth largest value#

Let a(k)a_{(k)} denote the kth largest, counting duplicates. Its threshold event says that at least kk of the original events occur. The corresponding sieve is

a(k)=∑∣S∣≥k(−1)∣S∣−k(∣S∣−1k−1)min⁡i∈Sai.a_{(k)}= \sum_{|S|\ge k}(-1)^{|S|-k} \binom{|S|-1}{k-1}\min_{i\in S}a_i.

Why this binomial coefficient? Fix a threshold met by exactly rr values. The total weight of surviving subsets is

∑s=kr(−1)s−k(s−1k−1)(rs)=1(r≥k).\sum_{s=k}^{r}(-1)^{s-k} \binom{s-1}{k-1}\binom{r}{s}=1\quad(r\ge k).

One way to verify it is to write (s−1k−1)=ks(sk)\binom{s-1}{k-1}=\frac{k}{s}\binom{s}{k} and use 1/s=∫01xs−1dx1/s=\int_0^1x^{s-1}dx. The binomial sum becomes

k(rk)∫01xk−1(1−x)r−kdx=1.k\binom{r}{k}\int_0^1 x^{k-1}(1-x)^{r-k}dx=1.

If r<kr<k, the empty sum is zero. Thus every threshold is counted exactly when it should be, which proves the order-statistic identity, including ties.

For the second largest of [2,5,8][2,5,8], pair minima contribute 9 and the triple contributes −2⋅2=−4-2\cdot2=-4, giving 5.

Expected maxima of waiting times#

Let TiT_i be independent nonnegative waiting times. If the minimum over a selected subset has a simple expectation, linearity gives

E[max⁡iTi]=∑∅≠S(−1)∣S∣+1E[min⁡i∈STi].\mathbb E[\max_iT_i]= \sum_{\varnothing\ne S}(-1)^{|S|+1} \mathbb E[\min_{i\in S}T_i].

For independent exponential clocks with rates λi>0\lambda_i>0, the minimum has rate ∑i∈Sλi\sum_{i\in S}\lambda_i and mean its reciprocal. Therefore the expected final finishing time is a signed subset sum of reciprocals. Independence is used to derive the minimum’s distribution, not in the algebraic extremum identity itself.

For two clocks of rates two and three, the expectation is 1/2+1/3−1/5=19/301/2+1/3-1/5=19/30. Verify this small case before trusting a larger subset implementation. In modular problems, ensure all denominators are invertible; an ordinary rational expectation does not automatically have a valid modular representative under every modulus.

Exercise. Derive the expected second-largest finishing time for three independent clocks using the order-statistic coefficients. Compare it with the identity “sum of all three times minus maximum minus minimum.” Both routes should agree.

Support & Share

If this article helped you, please share or support!

Sponsor
Min-Max Inclusion-Exclusion: Derive Extremum Identities by Thresholds
https://blog.wsh.moe/posts/min-max-inclusion-exclusion/
Author
Wsh
Published at
2026-10-24

Comments

LEAVE A NOTE

Join the conversation

Markdown supported

Be kind. Good conversations start with you.

Conversation

Loading conversation…

Comments powered by Waline

Profile Image of the Author
Wsh
Nice to meet you! Hello, I'm Wsh.
Announcement
Any news or updates will be shared here, so check back anytime! Thanks for stopping by, meow >.<
Categories
Tags
Site Statistics
Posts
27
Categories
7
Tags
69
Total Words
124,615
Running Days
0 days
Last Activity
0 days ago
Site Info
Build Platform
Vercel
Blog Version
Firefly v6.16.8
License
CC BY-NC-SA 4.0
Table of Contents