Foundations — Bias, fairness, and discrimination metrics
This page assumes you have seen none of the notation on the parent note. We build every piece from a picture of people and boxes. By the end you will be able to read every formula there without pausing.
Start with people, not symbols
Before any letter, picture a crowd of applicants. Each person is one dot. For each dot, two facts eventually become known:
- What the model said about them ("we predict you will default" / "we predict you won't").
- What actually happened later ("they did default" / "they didn't").
That is the entire universe of these metrics. Look at the board below: every fairness idea is a way of slicing this crowd.

Symbol 1 — : the truth
Picture: in the crowd, colour every dot by truth — one colour for , another for . This colouring exists whether or not any model was ever built. It is reality.
Why the topic needs it: you cannot say a prediction is "right" or "wrong" without a truth to compare against. is that truth.
Symbol 2 — : the guess
Picture: draw a box around the dots the model flagged. Inside the box: . Outside: . The box and the truth-colouring are two independent slicings of the same crowd — and that is the whole game.
Symbol 3 — : the group
Picture: split the entire crowd into two rooms — Room and Room . We will run the same counting recipe inside each room and then compare the two answers. Fairness = "do the rooms get similar numbers?"
Now every dot carries three tags: its truth , its prediction , and its room .
The four boxes: TP, FP, FN, TN
When you overlay "truth colour" with "prediction box," each dot lands in exactly one of four boxes. This 2×2 grid is called the confusion matrix, and it is the single most important picture on this page.

Reading the words: the second word (Positive/Negative) is what the model said. The first word (True/False) is whether the model was right. So "False Positive" = "the positive claim was false."
Every person lands in exactly one box, so the four counts add up to the whole group: where is the total number of people in the group. Keep in mind — it is the "everyone" that fractions will divide by.
Why the topic needs it: every rate on the parent page — TPR, FPR, precision, flag-rate — is just one count divided by a total made of two counts. Learn the four boxes and every formula becomes arithmetic.
Symbol 4 — and : "what fraction"
This is the one symbol beginners fear. It is simpler than it looks.
Example from the crowd: if of people are flagged, then
Picture: the bar is a spotlight. = walk into the room named by the condition, ignore everyone else, and count the box as a fraction of that room.
Let us now name every rate the parent uses as a -with-a-bar, mapped straight to the four counts.
The named rates — each is one count over a two-count total

Symbol 5 — the base rate
Picture: stand in one room, count only the truth-colour, ignore every prediction box. That fraction is . It is a fact about the world, not about the model.
Why the topic needs it: the parent's impossibility proof hinges on . When two groups differ in reality, the ratio-factor differs between them, and this is the wedge that forces the three fairness metrics apart. You cannot understand the Chouldechova identity without .
Symbol 6 — and how it enters Equalized Odds
Watch it actually do its job. The parent's Equalized Odds condition is written compactly as The tells you to unfold this one line into two separate equations — substitute , then : So is exactly what packs "equal TPR and equal FPR" into a single tidy formula. Without it, you would have to write both lines by hand every time.
Symbol 7 — the ratio for Disparate Impact
A tiny worked check (positive outcome = approval): approve of A and of B, with B protected:
Symbol 8 — distance , the score , and the constant
Here switches domain as promised: it is now a real-valued score in , not a flag. This is the raw confidence the model emits before thresholding.
Picture: imagine the model as a hill. is the maximum steepness allowed. If two people stand a hair apart on the input floor but the model launches one to a cliff-top score and drops the other to a valley, the hill was too steep — individual fairness is violated.
Worked check from the parent: feature gap , scores and , so output gap . With the allowance is . Since , the constraint is broken.
How it all fits together
The map below is meant to be read as a story, not memorised. Walk it with me:
- Three raw tags sit at the top — (truth), (prediction), (group).
- and collide to make the four boxes (the confusion matrix); splits everyone into group rooms.
- The conditional fraction turns box-counts into rates inside each room.
- Those rates split into two families: column-rates TPR/FPR and the row-rate PPV. Together with the base rate they feed the group-fairness metrics and the impossibility result.
- On a separate track, -as-a-score plus distance and constant feed individual fairness.
- Everything empties into the parent topic.
Where these foundations lead
- The column-vs-row tension (TPR/FPR vs PPV) is exactly the machinery behind Fairness-accuracy tradeoffs and the impossibility result.
- The group rooms and flag-rate ratio underpin Disparate impact theory.
- The "similar inputs, similar outputs" idea generalises toward Counterfactual fairness and Causal fairness.
- Auditing the boxes in the real world is the practice of Algorithmic accountability, famously on COMPAS risk assessment.
- Layering multiple attributes at once leads to Intersectionality in ML.
Equipment checklist
Test yourself — cover the right side and answer aloud.
What does the hat in mean?
When is a binary and when is it a real-valued score?
What is the difference between and ?
Are TP, FP, FN, TN fractions or counts?
What is in terms of the four boxes?
In , what does the bar do?
Every equals what generic ratio?
Which two counts go under TPR, and what is the denominator's meaning?
Which counts give FPR?
Which counts give precision (PPV) and why is its denominator a row?
What is the base rate ?
How does unfold Equalized Odds?
What does the Lipschitz constant bound?
Compute Disparate Impact if protected group is flagged 40% and privileged 60% (positive outcome).
Recall Quick self-check answer key
If you can state all fourteen aloud without peeking, you are ready for the parent note's derivations. If TPR-vs-PPV (column vs row) still feels fuzzy, re-read the confusion-matrix figure — that single distinction powers the impossibility theorem.