FA-73069 / Probabilistic sketches / Member archive
Count sketch frequency estimation: query ignores the row sign · case 04
Rows where the key was stored with a negative sign vote with the wrong polarity.
Case contract
Input {w, d, stream, queries}; stream entries are [key, signed count]. Row r uses bucket ((A_r key + B_r) mod 2^31-1) mod w and sign +1 when ((C_r key + D_r) mod 2^31-1) is odd, else -1, from an independent hash. Updates add sign*count. A query returns the median over rows of sign*cell; for even d the median is the mean of the two middle values. Negative estimates are returned unchanged (turnstile streams).
Why this case matters
Count sketches estimate signed frequencies in turnstile streams (inserts and deletes); their unbiasedness depends on independent signs and a median across rows.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| stream 0 w=4 d=3 | [-4, -2, -2, -3, -4, 3] | [4, 0, -2, 3, -4, 3] | 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 ↗