COMP90073 Trustworthy Machine Learning · Workshop 2

Count it.
Link it. Break it.

A fast memory refresh for combinatorics, sparsity and de-anonymisation.

countingprobabilitygraphsattacker thinking

S speaker notes · Esc overview · F fullscreen · ?debug outlines overfull slides · red STOP slides are student work time

00What you should be able to do by 50 minutes from now

Three things to walk out with

1 · REPRESENT
Read a problem and name the object it is really about — a set, a multiset, a sequence, a sparse vector, a graph — before reaching for a formula.
2 · ATTACK
Explain how auxiliary information turns an “anonymised” release into a re-identification, through quasi-identifiers, sparsity and record matching.
3 · BOUND IT
State what an attack does and does not establish: which probability model you assumed, and what stays ambiguous.
META-SKILLName the mathematical object before touching the numbers.
privacyOne model under every question

Every attack has the same shape

Dataset \(D\)
collected
→
Data collector
computes \(f\) on \(D\)
→
Release \(f_D\)
names removed
+
\(\Aux(r)\)
known elsewhere
→
New inference
identity or secret

Quasi-identifier

Age, location, date, ratings or graph structure that becomes identifying after linkage.

Sensitive attribute

Medical condition, preference or relationship the release was meant not to expose.

Privacy breach

Lecture 2's informal definition: a sharing mechanism \(f_D\) that lets an unauthorised party learn sensitive information about any individual, which could not have been learnt without access to \(f_D\).

ASK FIRSTWhat does the attacker know before the release—and what is genuinely new after it?
questionsTutorial sheet · Questions 1–2Q1–2 / 9 · counting

Start with the object being counted

QUESTION 1

How many subsets of size \(K\) from a set of size \(N\) can you choose?

Before solving: Does a subset remember order? Can the same element appear twice?
QUESTION 2

Consider a record that consists of three attributes:

  • age: an integer between 0 and 99;
  • state or territory: 8 possible values;
  • medical condition: Boolean—present or absent.

How many unique records can there be?

Before solving: Can every value of one attribute be paired with every value of the others?
STOP 1Questions 1–2 · name the object firstQ1–2 / 9 · counting
STOP
THINK · PAIR

What exactly are we counting?

  1. One selection of \(K\) elements from \(N\).
  2. One record made of three independent attributes.

For each: ordered or unordered? Repetition or no repetition? Name the object before you name a formula.

rapid retrieval45 s in pairsshare the object type
recapHint · the four counting cellsQ1–3 / 9 · countingon demand

Two questions choose the formula

Choosing \(K\) items from \(N\) types: does order matter, and may an item repeat?

Orderedsequence Unorderedset or multiset
No repetition \(\dfrac{N!}{(N-K)!}\) \(\dbinom{N}{K}\)Q1
Repetition allowed \(N^{K}\) \(\dbinom{N+K-1}{K}\)Q3
Different independent attributes? Multiply their numbers of choices.
\[n_1 \times n_2 \times \cdots \times n_d\]

That product rule is a separate move from the table—it builds the \(N\) that the table then draws from. Q2 builds \(N\); Q3 draws from it.

And before calling a ratio a probability: state which outcomes are equally likely.

VOCABULARYSet = no repeats, order ignored. Multiset = repeats allowed, order still ignored. Sequence = order matters.
solveQuestions 1–2Q1–2 / 9 · counting

Q1: a subset ignores order

\[\binom{N}{K}=\frac{N!}{K!\,(N-K)!}\]

“Choose Alice, Bob” and “choose Bob, Alice” are the same subset—so divide the \(N!/(N-K)!\) ordered picks by the \(K!\) orders of each subset.

Q2: a record is a product

\[100 \times 8 \times 2 = 1600\]
CHECKCombination for one unordered choice; multiplication for independent fields.
questionTutorial sheet · Question 3Q3 / 9 · counting
QUESTION 3

Let \(r\) be a record with a fixed age, location and medical condition.

How many distinct datasets of 200 records can there be where \(r\) is part of the dataset?

Hint from the tutorial: the number of ways to choose \(K\) elements from \(N\) with replacement is
\[\binom{N+K-1}{K}\]

Translate the wording

1
How many possible record types exist?
2
One occurrence of \(r\) is already guaranteed.
3
Are the remaining 199 records ordered? May types repeat?
Do not calculate yet—name the multiset.
STOP 2Question 3 · formulate before calculatingQ3 / 9 · counting
STOP
THINK · PAIR

Count 200-record datasets containing \(r\)

Write the expression only. No factorials need to be evaluated.

  • What plays the role of \(N\)? Where did it come from?
  • What plays the role of \(K\) once \(r\) is fixed?
  • Is a dataset a sequence, a set, or a multiset?
90 s alone90 s in pairsshare
solveQuestion 3 · datasets are multisetsQ3 / 9 · counting
r aab ⋯rz

One required record + 199 freely chosen records

There are 1600 record types. After removing the required copy of \(r\), choose a multiset of 199 records from those 1600 types.

\[\begin{aligned}\binom{1600+199-1}{199}&=\binom{1798}{199}\\[2pt]&\approx 1.5\times 10^{270}\end{aligned}\]

A 271-digit number. The observable universe holds roughly \(10^{80}\) atoms — so there are about \(10^{190}\) times more possible datasets than there are atoms to write them on.

Two ways to get this wrong:

✗\(1600^{199}\approx 10^{638}\) — that counts ordered sequences, so it treats a reordering of the same 200 rows as a different dataset.
✗\(\binom{1599+199-1}{199}\) — dropping \(r\) from the pool forbids a second copy of \(r\), but duplicates are allowed.
PATTERN“Dataset of records” usually means a multiset: duplicates allowed, row order irrelevant.
questionTutorial sheet · Question 4Q4 / 9 · linkage
QUESTION 4

There is a very large number of possible databases for the record types described in Questions 2–3.

Why should someone still worry about the privacy of their medical condition if a dataset of 200 records—including theirs—were released, and their age and location were known, for example from Facebook?

Everything you need

Known to attacker: age and location.

Unknown: medical condition.

Released: all three attributes, without names.

\[\text{quasi-ID} = (\text{age},\ \text{location})\]
Ask whether the quasi-ID is unique—or whether all matching rows agree.
STOP 3Question 4 · privacy despite a huge sample spaceQ4 / 9 · linkage
STOP
THREAT MODEL

Why can one person still be exposed?

The released dataset contains 200 records. An attacker already knows the person's age and location, but not their medical condition. State the attack in words before writing anything down.

  • What is the quasi-identifier?
  • When does it isolate one row?
  • Can disclosure happen even if several rows match?
60 s in pairsshare the attack in words
recapHint · how a linkage attack worksQ4 / 9 · linkageon demand

A quasi-identifier becomes a join key

RELEASED MEDICAL DATA

AgeStateCondition
25VIC0
29VIC1
42NSW0
quasi-identifier
↔
age + state

PUBLIC / SOCIAL DATA

NameAgeState
Alice25VIC
Cathy29VIC
Fred42NSW
Names were removed. The attributes the two releases share put them back.

Lecture 1's example: a Massachusetts insurance release kept visit date, diagnosis, procedure, medication — plus ZIP, birth date and sex. The public voter roll carried name and address plus the same three. The overlap is the quasi-identifier: it re-identified the state Governor, linking his name to his diagnosis, and it uniquely identifies 87% of the US population.

TWO RISKSA unique quasi-identifier reveals the row; a homogeneous group can reveal the secret without uniqueness.
solveQuestion 4 · uniqueness is not rareQ4 / 9 · linkage

Count demographic records

The condition is unknown, so marginalise it away: keep age and location only.

record types, condition dropped\[N = 100 \times 8 = 800,\qquad K = 200\]
datasets containing the target type\[\binom{N+K-2}{K-1}\]
datasets where it appears exactly once\[\binom{N+K-3}{K-1}\]

Uniqueness has probability \(\approx 0.8\)

\[\begin{aligned}\frac{\binom{N+K-3}{K-1}}{\binom{N+K-2}{K-1}}&=\frac{N-1}{N+K-2}\\[4pt]&=\frac{799}{998}\approx 0.80\end{aligned}\]

So “there are astronomically many possible datasets” does not imply that this person blends in. The global sample space is huge; the local neighbourhood is not.

PRIVACYThe size of the global sample space is irrelevant if auxiliary information narrows the target locally.
intuitionQuestion 4 · uniqueness is not the only routeQ4 / 9 · linkageon demand

What the attacker sees after the join

The attacker knows the quasi-identifier, so they can only look at the released rows that match it. Three things can be behind that door.

bucket holds one row
AgeStateCondition
29VIC1

Unique quasi-identifier.
The condition is read straight off.

bucket holds three, all alike
AgeStateCondition
29VIC1
29VIC1
29VIC1

Not unique — and it makes no difference.
Every candidate carries the same secret.

bucket holds three, mixed
AgeStateCondition
29VIC1
29VIC0
29VIC0

If the three candidates are equally likely, the posterior is \(\tfrac13\) — leakage only insofar as that differs from the attacker's prior.

SOCounting how often the bucket holds exactly one row answers one of the three cases. Uniqueness is sufficient for disclosure, not necessary for it.
lectureCase study · the Netflix Prize releaseL2 · “Problem setting”

What was actually released

Item 1Item 2Item M
User 1User 2⋮User N

\(N\) users \(\times\) \(M\) items. A filled cell is a rating the user actually gave (\(+\) liked, \(-\) disliked); a blank cell is null, not a zero opinion. Real releases have thousands to millions of columns and a handful of filled cells per row.

The lecture's question: is this matrix sparse or dense?

No explicit identifiers

Names and account IDs are stripped before release. The rows are still there, one per person.

Auxiliary information

Anything the adversary has from outside the normal release process: other public data and social media, a business's own customer database, or something personally observed—an overheard conversation, a witnessed event.

the attacker's starting hand\[\aux=\Aux(r)\]some subset of the attributes of \(r\)
SPARSEHigh dimension plus few entries per row means most rows look like nobody else—a fingerprint by accident. Hold on to \(N\) users \(\times\) \(M\) items: Question 5 asks what happens when you swap them.
recapBefore Questions 5–6L2 · “Record similarity”Q5–6 / 9 · sparsity

A sparse record remembers only what is present

\(\supp(r_1)=\{1,5\}\)

\(\supp(r_2)=\{1,2,5\}\)

A one-hot record is the extreme case: exactly one non-zero attribute, so \(|\supp(r)|=1\). Questions 5 and 6 both live here.

Similarity, as Lecture 2 defines it

\[\Sim(r_1,r_2)=\frac{\sum_i \Sim(r_{1i},r_{2i})}{\bigl|\supp(r_1)\cup\supp(r_2)\bigr|}\]

The numerator is a sum of per-attribute similarities—each in \([0,1]\), not necessarily 0 or 1. That matters in Q6.

binary records: \(\Sim(r_{1i},r_{2i})=1\) iff \(r_{1i}=r_{2i}=1\)\[\Sim(r_1,r_2)=\frac{|\supp(r_1)\cap\supp(r_2)|}{|\supp(r_1)\cup\supp(r_2)|}=\frac{2}{3}\]

Check yourself on the lecture's third record \(r_3=[0,1,1,1,1]\): \(\Sim(r_1,r_3)=\tfrac15\) and \(\Sim(r_2,r_3)=\tfrac25\).

SUPPORTRow support = attributes present in a record. Column support \(\supp(i)\) = records carrying attribute \(i\). Q6 needs the column sense.
recapSparsity, and how to read its notationL2 · “Sparsity”Q5 / 9 · sparsity
\((\epsilon,\delta)\)-sparsity\[\Pr_r\Bigl[\max_{r'\neq r}\Sim(r,r')>\epsilon\Bigr]\le\delta\]

In words: at most a fraction \(\delta\) of records have any other record more than \(\epsilon\)-similar to them.

Pick a record at random; the chance that its nearest neighbour is closer than \(\epsilon\) is at most \(\delta\).

Lecture 2 and the Netflix paper write the same event more compactly — see the speaker notes if you are comparing with your lecture slides.

SPARSITY AND THE “LONG TAIL” — REDRAWN FROM LECTURE 2

ε = 0.3δ = 0.1 0.10.40.60.8 1.00 Similarity Fraction of subscribers no ratings or dates ratings ± 0
how to read itThe height at \(x\) is \(\Pr_r[s(r)>x]\) — the curve is \(\delta\) plotted against \(\epsilon\). Netflix, film names only: for 90% of records there isn't a single other record more than 30% similar. That is the circled \((\epsilon,\delta)=(0.3,\,0.1)\).
MONOTONICITYA dataset that needs a larger \(\epsilon\) to pass the same \(\delta\) is making a weaker sparsity claim.
questionTutorial sheet · Question 5Q5 / 9 · sparsity
QUESTION 5

Consider the definition of dataset sparsity \((\epsilon,\delta)\) from Lecture 2 and two datasets, where \(N \gg M\):

  1. Dataset A has \(N\) rows/records and \(M\) columns/attributes.
  2. Dataset B has \(N\) columns and \(M\) rows.

Suppose every record has exactly one non-zero attribute, chosen uniformly. Which dataset is likely to have the higher sparsity parameter \(\epsilon\) for a fixed \(\delta\)?

What one-hot does to \(\Sim\)

\[\Sim(r,r')=\begin{cases}1 & \text{same non-zero column}\\[2pt] 0 & \text{otherwise}\end{cases}\]

So \(s(r)=\max_{r'\neq r}\Sim(r,r')\) is 1 exactly when some other row collides with \(r\), and 0 otherwise.

The operational question: which orientation produces more collisions?
STOP 4Question 5 · which orientation is sparse?Q5 / 9 · sparsity
STOP
COLLISIONS

Many rows or many dimensions?

Every row is one-hot with a uniformly chosen column. Answer in two parts.

  • A: \(N\) rows, \(M\) columns  ·  B: \(M\) rows, \(N\) columns  ·  \(N \gg M\)
  • Part 1: where are duplicate rows more likely?
  • Part 2: therefore which one needs the larger \(\epsilon\) to satisfy the same \(\delta\)?
60 s alone90 s in pairsshare
intuitionSparsity · the same definition, in picturesQ5 / 9 · sparsityon demand

Same \(\epsilon\), very different \(\delta\)

Distance here is dissimilarity: \(d=1-\Sim\). So the dashed circle has radius \(1-\epsilon\) — raise the similarity threshold \(\epsilon\) and it shrinks.

the definition\[\Pr_r\Bigl[\max_{r'\neq r}\Sim(r,r')>\epsilon\Bigr]\le\delta\]
sparse — almost everyone is alone\(\delta\approx 0.14\)
\(1-\epsilon\)

2 of 14 records have a neighbour inside the ring \(\Rightarrow\) this dataset passes at \(\delta \approx 0.14\)

dense — almost everyone has company\(\delta\approx 0.86\)
\(1-\epsilon\)

12 of 14 records have a neighbour inside the ring \(\Rightarrow\) at the same \(\epsilon\) it needs \(\delta \approx 0.86\)

Both panels use the same radius \(1-\epsilon\), so the same \(\epsilon\). Only the crowding — and therefore \(\delta\) — differs.

Q5 IN ONE PICTURETo bring the dense dataset down to the same \(\delta\) you must raise \(\epsilon\) — tightening the ring until few enough records still have company. A higher \(\epsilon\) is a weaker claim.
solveQuestion 5 · part 1 · balls into binsQ5 / 9 · sparsity

A: \(N\) rows into \(M\) columns

Many collisions: identical rows are likely.

\[1-\Bigl(1-\tfrac1M\Bigr)^{N-1}\approx 1\]

B: \(M\) rows into \(N\) columns

Few collisions: records are usually unique.

\[1-\Bigl(1-\tfrac1N\Bigr)^{M-1}\approx \frac{M-1}{N}\]
CAREFULPigeonhole gives \(N>M\) at least one collision in A; it is the uniform sampling with \(N \gg M\) that makes almost every row duplicated.
solveQuestion 5 · part 2 · from collisions to \(\epsilon\)Q5 / 9 · sparsity

Now turn the collisions into \(\epsilon\)

carried over from the definition\[s(r)=\max_{r'\neq r}\Sim(r,r'),\qquad \Pr_r\bigl[s(r)>\epsilon\bigr]\le\delta\]
step 1 · one-hot rows leave \(s(r)\) only two possible values Two one-hot rows are either identical (\(\Sim=1\)) or share nothing (\(\Sim=0\)), so a record has a twin or has nothing close. The whole probability collapses onto one number \(p\): \[\Pr_r\bigl[s(r)>\epsilon\bigr]=\begin{cases} p, & \epsilon<1\\ 0, & \epsilon\ge 1\end{cases} \qquad p=\Pr\bigl[\,r \text{ has a twin}\,\bigr]\]

step 2 · dataset A — \(N\) rows, \(M\) columns

\[p=1-\Bigl(1-\tfrac1M\Bigr)^{N-1}\approx 1\]

Almost everyone has a twin, so \(p\le\delta\) fails unless \(\delta\approx1\). Only the threshold that zeroes the probability survives. \(\Rightarrow\ \boldsymbol{\epsilon=1}\)

step 2 · dataset B — \(M\) rows, \(N\) columns

\[p=1-\Bigl(1-\tfrac1N\Bigr)^{M-1}\approx \frac{M-1}{N}\]

Hardly anyone has a twin, so \(p\le\delta\) already holds for any sensible \(\delta\) — even the strictest threshold passes. \(\Rightarrow\ \boldsymbol{\epsilon=0}\)

THE ANSWER\(\epsilon_A=1\) against \(\epsilon_B\approx 0\): A has the higher \(\epsilon\) — and since a higher \(\epsilon\) is a weaker claim, B is the sparser dataset.
intuitionQuestion 5 · the same picture, now for A and BQ5 / 9 · sparsity

The two datasets, drawn

Same convention: distance is dissimilarity \(d=1-\Sim\), so the ring has radius \(1-\epsilon\). One-hot rows leave only two distances — \(0\) (same column) or \(1\) (nothing shared).

held fixed\[\delta = 0.1\]
DENSEdataset A · \(N\) rows, \(M\) columns\(\delta\approx 1\)
column 1column 2column 3 \(1-\epsilon\)

\(N=12\) rows into \(M=3\) columns. Every row shares its column with three others: 12 of 12 records have a twin inside the ring.

SPARSEdataset B · \(M\) rows, \(N\) columns\(\delta\approx 0\)
column 4column 9column 12 \(1-\epsilon\)

\(M=3\) rows into \(N=12\) columns. Each row lands in a column of its own, nine stay empty: 0 of 3 records have anyone inside the ring.

A · the ring has to vanish

\(p=1-(1-\tfrac1M)^{N-1}\approx 1\) for every \(\epsilon<1\): twins sit at distance \(0\), so no positive radius excludes them. To reach \(\delta=0.1\) the ring must close to radius \(0\).

\[\epsilon_A = 1\]

B · the ring can stay wide open

\(p\approx\tfrac{M-1}{N}\approx 0\le\delta\) already. Even the widest ring, radius \(1-\epsilon=1\), catches nobody: every other row sits at distance exactly \(1\).

\[\epsilon_B \approx 0\]
AT \(\delta=0.1\)\(\epsilon_A=1\) against \(\epsilon_B\approx0\): A needs the higher \(\epsilon\), and a higher \(\epsilon\) is a weaker claim — so B is the sparser dataset.
lectureThe ScoreBoard algorithm, in fullL2 · “ScoreBoard Algorithm”Q6 / 9 · matching

Goal: given \(\aux=\Aux(r)\), find the other attributes of \(r\). The lecture writes \(\Score(r',\aux)\) and the tutorial writes \(\Score(\aux,r)\) — same function, arguments swapped.

1

Scoring function

For each record \(r'\) in \(D\), compute \(\Score(\aux,r')\) as the minimum similarity of an attribute in \(\aux\) to the same attribute in \(r'\).
\[\Score(\aux,r')=\min_{i\in\supp(\aux)}\Sim(\aux_i,r'_i)\]
2

Matching criterion

Keep every record whose score clears a threshold \(\alpha\).
\[D'=\bigl\{r'\in D \;:\; \Score(\aux,r')>\alpha\bigr\}\]
3

Record selection

Return the highest-scoring \(r'\) as the guess for \(r\) — or return all of \(D'\) and work with the candidate set.
\(\Aux(r)\)
known attributes
↓
score every \(r'\in D\)
weakest-link agreement
↓
threshold \(\alpha\)
candidate set \(D'\)
↓
guess \(r\)
read off the unknown attributes
One bad attribute sinks an otherwise perfect candidate. Hold on to that for Question 6.
THREATMatching the row amplifies partial background knowledge into every attribute the target never disclosed.
exampleScoreBoard · one target, five candidateson demandQ6 / 9 · matching

ScoreBoard, worked through

per-attribute similarity, for this example only\[\Sim(a,b)=1-\tfrac{|a-b|}{4}\]

THE RELEASE — FIVE RECORDS, FIVE FILMS, NO NAMES

ABCDE
\(r'_1\)34135
\(r'_2\)55221
\(r'_3\)12434
\(r'_4\)43513
\(r'_5\)21352
what the attacker already knows\[\aux=\{\,B=4,\ D=2,\ E=5\,\}\]Films A and C are the unknowns they want. \(\supp(\aux)=\{B,D,E\}\), so only those three columns are ever compared.

1 · SCORE EVERY RECORD — WORST ATTRIBUTE WINS

on Bon Don E\(\Score=\min\)
\(r'_1\)1.000.751.000.75
\(r'_2\)0.751.000.000.00
\(r'_3\)0.500.750.750.50
\(r'_4\)0.750.750.500.50
\(r'_5\)0.250.250.250.25
2 · matching criterion, with \(\alpha=0.4\)\[D'=\{r'_1,\ r'_3,\ r'_4\}\]
3 · record selection — highest score, and the payoff\[\text{guess } r=r'_1 \ \Rightarrow\ \boxed{A=3,\ C=1}\]
WEAKEST LINK\(r'_2\) agreed strongly on two of the three known films — and one \(0.00\) sank it. That is exactly the behaviour Question 6 proposes to change.
questionTutorial sheet · Question 6 · original vs amended ScoreBoardQ6 / 9 · matching
ORIGINAL SCORE

Instead of treating each attribute equally and computing

\[\Score(\aux,r')=\min_{i\in\supp(\aux)}\Sim(\aux_i,r'_i)\]
AMENDED SCORE

it computes a weight \(w(i)=1/\log|\supp(i)|\), where \(\supp(i)\) is the set of records with a non-null value for attribute \(i\), and scores

\[\Score(\aux,r')=\sum_{i\in\supp(\aux)} w(i)\,\Sim(\aux_i,r'_i)\]
QUESTION 6

What effect does this have on the outcome of the algorithm? Why—and when—would this algorithm perform better than the one that does not use \(w\)?

STOP 5Question 6 · the amendment changes two thingsQ6 / 9 · matching
STOP
COMPARE SCORES

When would the weighted score win?

\[\min_i \Sim_i \quad\longrightarrow\quad \sum_i w(i)\,\Sim_i\]
  • What happens to rare versus common attributes?
  • What changes when minimum becomes sum?
  • What if one auxiliary fact is noisy or simply wrong?

Bring back one benefit and one failure mode.

60 s alone90 s in pairsshare
recapHint · rare facts carry more identityQ6 / 9 · matchingon demand
weight \(w(i)\)

Frequency and information run opposite ways

\[w(i)=\frac{1}{\log |\supp(i)|}\]

A rare movie, purchase or diagnosis rules out far more candidate records than a common one, so it should count for more.

Same intuition as inverse document frequency in information retrieval.
DOMAIN CHECK\(|\supp(i)|=1 \Rightarrow \log 1 = 0\) and \(w\) blows up. Real code needs smoothing or clipping.
solveQuestion 6 · two changes, not oneQ6 / 9 · matching

1 · Weighting: rarity counts

\(w(i)\) is large exactly where \(|\supp(i)|\) is small, so agreement on a rare attribute moves the score far more than agreement on a common one. This is the supplied answer's point, and it is right.

\[w(\text{rare}) \gg w(\text{common})\]

2 · Aggregation: evidence accumulates

Under \(\min\), a single bad attribute caps the whole score. Under \(\sum\), strong rare matches can outweigh one weak or noisy attribute.

  • Better when: auxiliary data is noisy or incomplete, and the rare attributes it does contain are reliable.
  • Worse when: a rare attribute is itself erroneous—it now carries the most weight; or \(|\supp(i)|=1\); or \(\alpha\) is not recalibrated.
SCALE\(\sum_i w(i)\Sim_i\) is no longer in \([0,1]\), so the threshold \(\alpha\) from the original algorithm is meaningless until it is rescaled.
solveQuestion 6 · when the two rules disagreeQ6 / 9 · matchingon demand
attribute \(i\)\(|\supp(i)|\)\(w(i)\)\(\Sim(\aux_i,r'_i)\)
candidate \(r'_A\)
\(\Sim(\aux_i,r'_i)\)
candidate \(r'_B\)
common50000.121.00.6
rare 130.911.00.5
rare 2 (noisy aux)30.910.10.5
\(\min_i\)0.100.50 ←
\(\sum_i w(i)\Sim_i\)1.12 ←0.98

Same evidence, different winner

\(r'_A\) matches both rare attributes—except one auxiliary value is corrupted. \(r'_B\) is mediocre everywhere.

\(\min\) picks \(r'_B\): the single 0.1 destroys \(r'_A\).

The weighted sum picks \(r'_A\): two rare hits outweigh one bad attribute.

If \(r'_A\) is the true record, weighting plus summing de-anonymises where the original ScoreBoard fails.
FLIP ITCorrupt rare 1 instead and the sum confidently picks the wrong record. Robustness and gullibility are the same mechanism.
questionTutorial sheet · Question 7Q7 / 9 · graphs
QUESTION 7

The graph represents Alice, Bob, Cathy, Diane, Ed, Fred and Grace. A vertex is a person; an edge signifies a connection such as friendship.

The network is “anonymised”: people are associated only with vertex numbers.

Alice has three friends: Bob, Cathy and Ed. Alice knows Cathy is friends with everyone except Ed.

Can you de-anonymise the graph? What else do you learn besides a mapping from pseudo-identifiers to names?

STOP 6Question 7 · de-anonymise only what is justifiedQ7 / 9 · graphs
STOP
MAP THE GRAPH

Who is vertex 1? Who is vertex 5?

Alice has three friends: Bob, Cathy and Ed. Cathy is friends with everyone except Ed.

  • Which vertex can you name first, and what makes it unambiguous?
  • Keep going for as long as each step is forced.
  • Mark what stays ambiguous—and say what you learn anyway.
90 s in pairsshare the mapping
recapHint · the method on a smaller graphQ7 / 9 · graphson demand
adeg 1 bdeg 2 cdeg 3 ddeg 2 edeg 2

Warm-up graph. d and e can be swapped without changing a single edge.

1
Degree: how many neighbours? Unique degrees are your first anchors—here a and c.
2
Neighbourhood: which degrees surround it? b is the only degree-2 vertex adjacent to a leaf.
3
Symmetry: could two vertices be swapped without changing the graph? Then no evidence can separate them.
A vertex number hides the name, not the structure.
STOP CONDITIONWhen the remaining vertices are structurally interchangeable, the evidence does not justify a unique name.
solveQuestion 7 · propagate identitiesQ7 / 9 · graphs

Four identities follow

\(d_1=3\)\(d_2=2\)\(d_3=4\)\(d_4=2\)\(d_5=5\)\(d_6=2\)\(d_7=2\)
1
degree 3 is unique → Alice = 1
2
friends with all but one → degree 5 → Cathy = 5
3
Cathy's only non-neighbour → Ed = 2
4
Alice's remaining neighbour → Bob = 3
PARTIAL MAPVertices 4, 6 and 7 stay some permutation of Diane, Fred and Grace—no supplied fact separates them.
inferQuestion 7 · identity is not the only leakageQ7 / 9 · graphs

Subtract what Alice already knew

Prior — her auxiliary information

  • Alice–Bob, Alice–Cathy, Alice–Ed
  • Cathy–Bob
  • Cathy–vertex 4, Cathy–vertex 6, Cathy–vertex 7
  • “friends with everyone except Ed” already gave her every one of Cathy's edges

Genuinely new

  • Bob–Ed — two of her friends know each other
  • Bob–vertex 4 — a friend's tie to someone she cannot name
  • vertex 6–vertex 7 — a tie between two people she is not connected to at all
467

still unnamed — and the last edge leaks anyway

Three new positive edges — plus every non-edge she can now assert (Ed is connected to nobody but Alice and Bob) and the structure itself.

Lecture 2, the “New Information” principle\[\text{New information}=\operatorname{distance}\bigl(\text{prior belief},\ \text{posterior belief after seeing } f_D\bigr)\]…and the lecture's corollary: it cannot be 0 for every observer if the output is to be useful at all. The question is how much is new, not whether anything is.
PRIVACYA breach is prior versus posterior. Relationships leak even where names never resolve.
questionTutorial sheet · Question 8Q8 / 9 · algebra
QUESTION 8

Consider an “anonymisation” procedure for releasing ages. Instead of the true age \(x\), the release contains

\[y = \alpha x + \beta\]

where the parameters \(\alpha\) and \(\beta\) are secret and shared across the table.

Alice is 25 (ID 1) and knows her friend Cathy (ID 5), age 29, is in the table. Can Alice guess the other ages? Justify your answer.

Released table

IDAge (perturbed)
140
234
352
428
548
622
792
Known pairs: \(25 \mapsto 40\) and \(29 \mapsto 48\). Two parameters require two independent equations.
STOP 7Question 8 · recover the secret transformationQ8 / 9 · algebra
STOP
TWO EQUATIONS

Can Alice recover every age?

Alice: true 25 → released 40. Cathy: true 29 → released 48.

\[\begin{aligned}25\alpha+\beta &= 40\\ 29\alpha+\beta &= 48\end{aligned}\]

Solve for \(\alpha\) and \(\beta\), then write the inverse transformation before touching the rest of the table.

60 s in pairsshare \(\alpha\) and \(\beta\)
recapHint · two points determine a lineQ8 / 9 · algebraon demand
(x₁, y₁)(x₂, y₂) ΔxΔy slope = α true xreleased y
\[y = \alpha x + \beta\]

Two unknown parameters. Two distinct known input–output pairs give two independent equations, so \(\alpha=\Delta y/\Delta x\) and \(\beta\) follow.

\[x = \frac{y-\beta}{\alpha}\quad \text{if } \alpha \neq 0\]
Secrecy of a reversible formula is not a privacy guarantee.
KNOWN PAIRSEach known (original, released) pair is one equation in the secret parameters. \(d+1\) unknowns need \(d+1\) suitable pairs.
solveQuestion 8 · invert and decodeQ8 / 9 · algebra

Two known pairs expose the key

1
Subtract: \(4\alpha = 8 \Rightarrow \boldsymbol{\alpha = 2}\)
2
Substitute: \(50 + \beta = 40 \Rightarrow \boldsymbol{\beta = -10}\)
3
Invert: \(x = \dfrac{y+10}{2}\)
\[y = 2x - 10\]

Every age is recovered

IDreleased \(y\)true \(x\)
14025
23422
35231
42819
54829
62216
79251
LESSONA deterministic invertible transformation hides values only until its parameters can be identified.
closeThe answer-checking routine

Before you commit to an answer

1 · REPRESENT
Name the object: set, multiset, sparse vector, graph, equation system or constraint grid.
2 · MODEL
State order, replacement, the random experiment and what is assumed equally likely.
3 · ATTACK
Write the adversary's auxiliary information, then only what is new after the release.
4 · LIMIT
Say what the evidence does not determine — ambiguity is part of the result. Lecture 2's no free lunch: any release with a sliver of utility has some adversary prior it cannot protect against.
Q1–3
Counting
Q4
Linkage
Q5
Sparsity
Q6
Matching
Q7
Graphs
Q8
Linear algebra
Q9
Constraints
take-home
NEXT“The simple-minded division of information into personal and non-personal is a false dichotomy.” — Narayanan & Shmatikov. Next: formal guarantees built on calibrated randomisation.
exitOne minute, on paper

Pick one question from today

Any of the eight. Write four short lines — this is the routine you will need in the exam, and in the assignment.

1 · representation

What object was it? Set, multiset, sequence, sparse vector, graph, equations, constraints.

2 · auxiliary information

What did the adversary already know before the release?

3 · the attack

One sentence, in words, with no formula in it.

4 · what is still uncertain

Name one thing the evidence does not settle — an unresolved identity, an assumed probability model, a threshold you would have to pick.

HAND IT UPIf you can write those four lines for one question, you can write them for the other eight.
appendixBeyond the core path

Appendix

Material that did not fit a 50-minute core path. Jump here on demand, or leave it for self-study.

Q4
The probability model behind the 0.80 — what “equally likely” is doing in that ratio.
LECTURE 2
The formal adversary model \((\theta,\omega)\), the same thing in pictures, and what ScoreBoard achieved on the real Netflix data.
Q9
The constraint puzzle, in full, with the forced chain — best used as take-home.
ALL
Answers at a glance, for revision.
precisionQuestion 4 · the hidden probability modelif timeQ4 / 9 · linkage

A counting ratio needs a sample space

\[\Pr(\text{event})=\frac{\#\ \text{favourable outcomes}}{\#\ \text{equally likely outcomes}}\]

The supplied solution treats every possible dataset multiset as equally likely. Sampling 200 people independently from a population would induce a different distribution over multisets.

The privacy conclusion survives: demographic linkage can expose a condition.

But the number \(0.80\) is only meaningful once you say how the dataset was generated.

Also: non-uniqueness does not guarantee safety when every matching row carries the same sensitive value.

EXAM HABITState the random experiment before calculating a probability.
lectureThe adversary model, formallyL2 · “Adversary Model”
\((\theta,\omega)\)-de-anonymisation

A database \(D\) is \((\theta,\omega)\)-de-anonymised with respect to auxiliary information \(\Aux\) if there exists an algorithm \(A\) which, on inputs \(D\) and \(\Aux(r)\) where \(r\) is in \(D\), outputs \(r'\) such that

\[\Pr\bigl[\Sim(r,r')>\theta\bigr]\ge\omega\]

The attack does not have to return the exact row. Returning any record more than \(\theta\)-similar to the target already counts; \(\omega\) is how often it must manage that.

Two Greek pairs, two different objects.
property of the dataset\[(\epsilon,\delta)\text{-sparse}\]
property of the attack\[(\theta,\omega)\text{-de-anonymised}\]

Sparsity says records have no close neighbours. De-anonymisation says an algorithm can find the right one anyway—that is the amplification of background knowledge.

SOURCENarayanan & Shmatikov, “Robust De-anonymization of Large Sparse Datasets” — arXiv cs/0610105.
intuitionDe-anonymisation · the same definition, in pictures

When does an attack count as a success?

the definition\[\Pr\bigl[\Sim(r,r')>\theta\bigr]\ge\omega\]
sparse dataset \(D\)
\(1-\theta\) target \(r\)

radius \(1-\theta\) in dissimilarity, so the ring holds every record more than \(\theta\)-similar to \(r\) — here, nobody

→
\(\Aux(r)\)
age 42
postcode 3010
bought {book, camera}
joined 2021-05-17
↓
A
\(A\bigl(D,\ \Aux(r)\bigr)=r'\)
matching / search algorithm
→\(r'\)
match returned
NOT IDENTICAL \(r\) \(r'\)

the guess \(r'\) lands inside the ring

→
SUCCESS
\(\Sim(r,r')>\theta\)

succeeds at least \(\omega\) of the time

THE POINTThe attack need not recover the exact row. Similar enough \((\theta)\), often enough \((\omega)\), counts as de-anonymised.
lectureIt worked — on the real Netflix dataL2 · “Summary of Netflix Paper”
99%
of records uniquely identified from 8 film ratings — even with 2 ratings completely wrong and dates off by up to 14 days
68%
from just 2 ratings, with dates accurate to within 3 days
84%
of subscribers identified when the adversary knows 6 of 8 films outside the top 500

The lecture's question back to you: where could \(\Aux\) come from to de-anonymise the Netflix dataset?

Why it matters

The question is not “does the average subscriber care about their viewing history?” but “is there any subscriber whose privacy this release compromises?”

A film history can expose political or sexual preferences. And forward privacy: once a viewing history is linked to a person, a fresh identity created later can still be traced back to it.

Two properties to carry forward

Robust to noise: wrong ratings and wrong dates in the adversary's background knowledge do not break the attack.

More aux than you think: the paper also uses the approximate number of films a user rated and the date they joined Netflix.

That last statistic is Question 6 in one line: rare films identify people.
SUMMARYA simple ScoreBoard provably identifies records; a variant of it de-anonymises the Netflix Prize dataset.
recapBefore Question 9if timeQ9 / 9 · constraints

Translate prose into constraints

same(X,Y)
“The red-house owner likes avocado.”
|pos(X)−pos(Y)| = 1
“The golfer lives next to the blue house.”
pos(Y) = pos(X)+1
“Green is immediately left of yellow.”
all-different
Each colour, sport, pet and food appears exactly once.

Then propagate

1
Place the direct facts.
2
Apply adjacency and immediate-left constraints.
3
Fill whatever is now forced.
4
If two options survive, assume one and hunt for a contradiction.
GRID HABITOne column per house; one row per category; cross out impossibilities immediately.
questionTutorial sheet · Question 9optionalQ9 / 9 · constraints

Four houses, four linked categories

QUESTION 9

Four houses stand next to each other. Their colours are blue, red, yellow and green. Each resident is a golfer, skater, basketball player or tennis player; keeps a cat, parrot, dog or horse; and likes avocado, grapes, apples or oranges.

Given the auxiliary information below, who owns the cat?

  1. The golfer lives next to the blue house.
  2. The skater lives in the first house.
  3. The person who likes apples keeps birds.
  4. The green house is immediately left of the yellow one.
  5. The owner of the red house likes avocados.
  6. The owner of the green house likes apples.
  7. The person who eats grapes has a neighbour who keeps cats.
  8. The person who keeps horses lives next to the person who likes avocados.
  9. The skater lives next to the blue house.
  10. The tennis player eats oranges.

Vocabulary normalisation: “keeps birds” refers to the only bird in the pet list—the parrot.

STOP 8Question 9 · logic gridoptionalQ9 / 9 · constraints
STOP
PROPAGATE

Who owns the cat?

Start with the three high-leverage clues, then add the rest one at a time.

  • The skater is in house 1 and lives next to blue.
  • Green is immediately left of yellow.
  • The green-house owner likes apples and therefore keeps the parrot.

Which assumption creates a contradiction?

60 s alone180 s in groupsshare
solveQuestion 9 · the skater owns the catoptionalQ9 / 9 · constraints

The forced chain

\(\text{skater}_1 \to \text{blue}_2 \to \text{golfer}_3\)
\(\text{green}_3 \to \text{yellow}_4 \to \text{red}_1\)
\(\text{red}_1 \to \text{avocado}_1\)
\(\text{green}_3 \to \text{apples}_3 \to \text{parrot}_3\)
\(\text{horse adjacent to avocado}_1 \to \text{horse}_2\)
assume \(\text{tennis}_2 \Rightarrow \text{grapes}_4 \Rightarrow \text{cat}_3\), but \(\text{pet}_3=\text{parrot}\) ✗
so \(\text{tennis}_4,\ \text{grapes}_2 \to \text{cat}_1\)

The completed grid

HOUSE 1
skater
avocado
cat
HOUSE 2
basketball
grapes
horse
HOUSE 3
golfer
apples
parrot
HOUSE 4
tennis
oranges
dog
House 1 holds the skater, so the skater owns the cat.
METHODDirect facts → adjacency → all-different → one short proof by contradiction.
recapEverything on one screen

Answers at a glance

QAnswer
1\(\dbinom{N}{K}=\dfrac{N!}{K!\,(N-K)!}\)
2\(100\times 8\times 2 = 1600\) record types
3\(\dbinom{1798}{199}\) — multiset of 199 from 1600 types, with \(r\) fixed
4Quasi-ID (age, location): unique with probability \(\dfrac{799}{998}\approx 0.80\); a homogeneous group discloses even without uniqueness
5A (\(N\) rows, \(M\) columns) has the higher \(\epsilon\); B is the sparser dataset
6Rarity weighting and min → sum; better with reliable rare attributes and noisy aux, worse with erroneous rare attributes or an unrescaled \(\alpha\)
71 = Alice, 5 = Cathy, 2 = Ed, 3 = Bob; 4/6/7 stay ambiguous; new edges: Bob–Ed, Bob–4, 6–7
8\(\alpha=2,\ \beta=-10\), so \(x=\dfrac{y+10}{2}\) — every age recovered
9The skater, in house 1