75 customers fall randomly into three equal-sized databases, all partitions equally likely. What is the probability that Bob and Ben end up in the same database? How does the answer change for k databases and m named customers?

The Problem: A service splits 75 customers into three databases of exactly 25, and every such partition is equally likely. Bob and Ben are two of those customers, and we need the chance they land in the same database, then its extension to databases and
named people.
Answer
The probability is , not the tempting
. Fix Bob’s database first. By symmetry Ben is then equally likely to occupy any of the 74 remaining seats, and 24 of those seats sit in Bob’s database. Because every partition is equally likely, Ben’s seat is a uniform draw without replacement, so the answer is favorable seats over open seats. For
databases of size
this becomes
, slightly below
because fixed sizes make placements negatively dependent.
(1) Fix Bob, Then Place Ben: Conditioning on Bob’s database costs nothing because the three databases play identical roles. Given Bob’s seat, every arrangement of the other 74 customers is equally likely, so Ben’s seat is uniform over 74 seats.
(2) Count Favorable Seats: Bob’s database has 25 seats and Bob holds one, leaving 24 favorable seats out of 74, which gives .
(3) Counting Cross-Check: The chance both land in database A is . Multiplying by the 3 databases recovers
, so the combinatorial count and the seat argument agree.
(4) Why Not 1/3: is correct only when each customer is hashed independently. With fixed sizes Bob uses up a seat in his own database, which lowers Ben’s chance by exactly
.
(5) General Rule: A pair shares one of equal databases with probability
. All
named customers share one with probability
, which hits zero once
.

Figure 1: Fixing Bob’s seat turns the question into a single uniform draw. Ben takes one of the 74 open seats, and the 24 green seats in database A are the favorable ones, so .
Mathematical Formulation:
Where:
is the fixed size of each database,
the total number of customers, and
the number of databases, so the interview case has
,
,
.
is the probability that two named customers share a database. The binomial form counts the ways to fill one chosen database so that it contains both, divides by all ways to fill it, and multiplies by the
interchangeable databases; whether the databases are labeled or unlabeled does not change the ratio.
is the probability that
named customers all share one database, and
indexes each additional customer placed after the first. It equals
and is 0 for
.
is the independent-hashing baseline, where every customer picks a database uniformly and independently of everyone else.
- The last line is the exact gap to the naive answer:
for the interview case, shrinking like
.
Worked Example:
Shrink the problem to customers in
databases of
. There are 15 ways to split 6 people into 3 unordered pairs, and Bob is paired with Ben in exactly 3 of them, so the probability is
, matching
. Independent hashing would claim
, a large error at this size. Back at full size, linearity of expectation gives a second check. Each of the
customer pairs shares a database with probability
, so the expected number of same-database pairs is
. That count is actually fixed at
in every partition, which is a third derivation of
.
Candidates report this as a Citadel 2024 question, and the trap is the independence assumption. Under hash sharding each customer is placed independently, database sizes fluctuate around 25 with a standard deviation near 4.1, and the pair probability is exactly . Under a uniform equal-size partition the sizes are pinned, so knowing Bob’s database slightly crowds Ben out of it. If the sizes are fixed but unequal, the big database pulls pairs together and the answer jumps well above
.
| Property | Equal sizes 25 / 25 / 25 | Independent hashing | Fixed sizes 50 / 15 / 10 |
|---|---|---|---|
| Pair formula | (s – 1) / (n – 1) | 1 / k | Sum of s_i (s_i – 1), divided by n (n – 1) |
| Pair value at n = 75 | 12/37, about 0.324 | 1/3, about 0.333 | 2,750/5,550, about 0.495 |
| Three named customers together | 552/5,402, about 0.102 | 1/9, about 0.111 | 121,050/405,150, about 0.299 |
| Database sizes | Exactly 25 each | Random, mean 25, standard deviation about 4.1 | Exactly 50, 15 and 10 |
| Dependence between customers | Negative: Bob uses one seat in his own database | None | Negative, outweighed by the pull of the big database |
Leave a Reply