FA-72878 / Probabilistic sketches / Member archive
Bloom filter sizing: bit formula divides by ln 2 instead of its square · case 03
Filters are sized far smaller than required for the requested false-positive rate.
Case contract
Input {n, p}. Reject n <= 0 or p outside the open interval (0,1) with "invalid". Otherwise m = ceil(-n ln p / (ln 2)^2), k = max(1, round(m/n * ln 2)), bytes = ceil(m/8), and the predicted false-positive rate (1 - e^(-k n / m))^k rounded to 6 decimals. Return [m, k, bytes, fp].
Why this case matters
Capacity planning for a Bloom filter decides memory and probe count before any item is inserted; an undersized array silently exceeds the promised false-positive rate.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| thousand items one percent | [6784, 5, 848, 0.041354] | [9787, 7, 1224, 0.010036] | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗