ordering and comparison

every time you make a to-do list and decide what to do first, you're performing a mathematical operation. every leaderboard, every ranking, every "which restaurant should we go to?" — that's math. specifically, it's the math of orders.

total orders and partial orders

when you sort a list of numbers from smallest to largest, that's a total order: every pair of elements can be compared. 3 < 7, always, no ambiguity. numbers are easy.

but most real-world ordering isn't total. it's partial. consider prioritizing tasks:

  • "study for exam" is more important than "do laundry"
  • "finish essay" is more important than "do laundry"
  • but is "study for exam" more important than "finish essay"? depends on deadlines, weight, your energy level

you can't always compare. some things are just... incomparable. and that's fine — partial orders are a legitimate mathematical structure, not a failure of decision-making. partial orders are sets with a specific relation — which makes them a set theory concept at heart.

the hidden math in sorting

sorting algorithms are one of the most studied topics in computer science (see computer science). but the key mathematical insight is about comparisons: to sort n items, you need at least n log(n) comparisons. this is a proven lower bound — no cleverness can beat it.

this has a practical consequence: if you're trying to rank 100 job applicants by doing pairwise comparisons, you need at minimum about 665 comparisons. ranking is inherently expensive. that's why we use heuristics, filters, and thresholds instead of trying to create a perfect total ordering of everything.

comparison and transitivity

the most important property of a "well-behaved" ordering is transitivity: if A > B and B > C, then A > C.

numbers obey this. but human preferences often don't. you might prefer pizza to sushi, sushi to burgers, and burgers to pizza. that's a cycle — a violation of transitivity. it means your preferences can't be represented as a simple ranking, and someone who knows your preferences can manipulate you by controlling the order of choices presented.

arrow's impossibility theorem proves that no voting system can always convert a group's preferences into a transitive ranking while satisfying a few basic fairness criteria. democracy is mathematically hard because ordering is mathematically subtle.

metrics and distances

comparison requires a notion of "how much better." this leads to metrics — mathematical distance functions. a metric needs to satisfy:

  1. d(x, y) ≥ 0 (distances are non-negative)
  2. d(x, y) = 0 iff x = y (only identical things have zero distance)
  3. d(x, y) = d(y, x) (symmetry)
  4. d(x, z) ≤ d(x, y) + d(y, z) (triangle inequality)

these seem obvious, but many real-world "distances" violate them. travel time isn't symmetric (one-way streets). perceived similarity isn't symmetric (people say "north korea is like china" more than "china is like north korea"). whenever you're comparing things, it's worth asking: does my comparison method actually behave like a real metric?

metrics are deeply connected to topology — every metric defines a topology, and the topological properties (connectedness, compactness) determine what kinds of ordering and comparison are possible in a space.

this connects to linear algebra as thinking — when you embed things as vectors, the distance between them (cosine similarity, euclidean distance) gives you a metric that enables meaningful comparison in high-dimensional spaces.

ordering in practice

elo ratings

chess ratings, competitive gaming, and matchmaking systems all use elo or elo-like systems. the core idea: after each match, update both players' ratings based on the expected vs actual outcome. if a 2000-rated player beats a 1500-rated player, not much changes. if the 1500 beats the 2000, big update.

elo is mathematically elegant because it converts a partial order (we only observe some matchups) into a total order (a single number per player). it's also a beautiful example of bayesian updating — each game is new evidence that shifts our estimate.

pareto optimality

when comparing on multiple dimensions, a solution is pareto optimal if you can't improve one dimension without worsening another. a car that's faster AND cheaper AND safer than another car dominates it. but usually there are trade-offs, and you end up with a set of pareto-optimal choices — the pareto frontier.

this is the mathematical way of saying "it depends on what you value." ordering breaks down when there's no single axis of comparison, which is most of the time.

the deep point

ordering feels like common sense, not math. but the math of orders reveals why ranking is so hard: transitivity failures, incomparable options, multiple dimensions, and the fundamental impossibility results of social choice theory. understanding this doesn't make decisions easier, but it does make you stop expecting a "correct" ranking where none exists. and comparison always rests on measurement — what you can order depends on what you can measure.

[[curator]]
I'm the Curator. I can help you navigate, organize, and curate this wiki. What would you like to do?