<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Probability on CS Theorems</title><link>https://cs.lozic.me/areas/probability/</link><description>Recent content in Probability on CS Theorems</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Fri, 12 Nov 2027 12:00:00 +0100</lastBuildDate><atom:link href="https://cs.lozic.me/areas/probability/index.xml" rel="self" type="application/rss+xml"/><item><title>Bloom Filters</title><link>https://cs.lozic.me/posts/t073-bloom-filters/</link><pubDate>Fri, 12 Nov 2027 12:00:00 +0100</pubDate><guid>https://cs.lozic.me/posts/t073-bloom-filters/</guid><description>&lt;h2 id="symptom"&gt;Symptom&lt;/h2&gt;
&lt;p&gt;Every request to your service checks whether a user ID exists before doing
anything else. The check hits the database. Ninety-eight percent of the time the
answer is no, because most of the traffic is bots probing for accounts that were
never created.&lt;/p&gt;</description></item><item><title>BPP, Pseudorandomness, and Derandomization</title><link>https://cs.lozic.me/posts/t035-bpp-pseudorandomness-and-derandomization/</link><pubDate>Fri, 23 Jul 2027 12:00:00 +0100</pubDate><guid>https://cs.lozic.me/posts/t035-bpp-pseudorandomness-and-derandomization/</guid><description>&lt;h2 id="symptom"&gt;Symptom&lt;/h2&gt;
&lt;p&gt;You need to test whether two arithmetic circuits compute the same polynomial.
The deterministic approach is to expand both into normal form, and the expansion
is exponentially large.&lt;/p&gt;
&lt;p&gt;The randomized approach takes four lines. Pick a random point, evaluate both
circuits there, compare. If they differ as polynomials, the
Schwartz-Zippel lemma says a random point catches it with probability at least
$1 - d/|S|$. Repeat a few times and the error is negligible.&lt;/p&gt;</description></item><item><title>Universal Hashing</title><link>https://cs.lozic.me/posts/t104-universal-hashing/</link><pubDate>Fri, 23 Apr 2027 12:00:00 +0100</pubDate><guid>https://cs.lozic.me/posts/t104-universal-hashing/</guid><description>&lt;h2 id="symptom"&gt;Symptom&lt;/h2&gt;
&lt;p&gt;Your service went down under a hash collision attack.&lt;/p&gt;
&lt;p&gt;Somebody noticed your web framework put POST parameters into a hash table, found
thousands of distinct keys colliding under its hash function, and posted a form
with 20,000 of them. Every insert walked a chain. Quadratic behaviour, one CPU
pinned per request, service dead. This actually happened, across PHP, Python,
Ruby, Java and .NET in 2011, and again against Rust&amp;rsquo;s default &lt;code&gt;HashMap&lt;/code&gt; before
it switched to SipHash.&lt;/p&gt;</description></item><item><title>Kolmogorov Complexity</title><link>https://cs.lozic.me/posts/t023-kolmogorov-complexity/</link><pubDate>Fri, 09 Apr 2027 12:00:00 +0100</pubDate><guid>https://cs.lozic.me/posts/t023-kolmogorov-complexity/</guid><description>&lt;h2 id="symptom"&gt;Symptom&lt;/h2&gt;
&lt;p&gt;You have two files, each exactly one megabyte.&lt;/p&gt;
&lt;p&gt;The first is a megabyte of the byte &lt;code&gt;0x00&lt;/code&gt;. The second is a megabyte from
&lt;code&gt;/dev/urandom&lt;/code&gt;. Gzip the first and you get a few hundred bytes. Gzip the second
and you get slightly more than a megabyte, because the header costs something and
there is nothing to exploit.&lt;/p&gt;</description></item><item><title>Balls Into Bins and the Power of Two Choices</title><link>https://cs.lozic.me/posts/t009-balls-into-bins/</link><pubDate>Fri, 12 Feb 2027 12:00:00 +0100</pubDate><guid>https://cs.lozic.me/posts/t009-balls-into-bins/</guid><description>&lt;h2 id="symptom"&gt;Symptom&lt;/h2&gt;
&lt;p&gt;You have 100 backends and a load balancer hashing request IDs to pick one.
Expected load per backend is exactly 1%, and you have checked the hash is good.&lt;/p&gt;</description></item><item><title>Concentration Bounds (Chernoff/Hoeffding)</title><link>https://cs.lozic.me/posts/t008-concentration-bounds/</link><pubDate>Fri, 18 Dec 2026 12:00:00 +0100</pubDate><guid>https://cs.lozic.me/posts/t008-concentration-bounds/</guid><description>&lt;h2 id="symptom"&gt;Symptom&lt;/h2&gt;
&lt;p&gt;Your service handles four billion requests a month and you want the error rate.
Computing it exactly means a job over four billion log lines. Someone suggests
sampling ten thousand of them.&lt;/p&gt;</description></item><item><title>Linearity of Expectation</title><link>https://cs.lozic.me/posts/t007-linearity-of-expectation/</link><pubDate>Fri, 27 Nov 2026 12:00:00 +0100</pubDate><guid>https://cs.lozic.me/posts/t007-linearity-of-expectation/</guid><description>&lt;h2 id="symptom"&gt;Symptom&lt;/h2&gt;
&lt;p&gt;You are analyzing a hash table. You want the expected number of buckets that end
up empty. The bucket occupancies are all tangled together — one key landing in
bucket 3 makes every other bucket slightly less likely to be chosen — and the
dependencies look like they will make the sum intractable.&lt;/p&gt;</description></item><item><title>The Birthday Bound</title><link>https://cs.lozic.me/posts/t074-the-birthday-bound/</link><pubDate>Fri, 06 Nov 2026 12:00:00 +0100</pubDate><guid>https://cs.lozic.me/posts/t074-the-birthday-bound/</guid><description>&lt;h2 id="symptom"&gt;Symptom&lt;/h2&gt;
&lt;p&gt;You need a short ID for uploads. Eight hex characters feels generous, so you
take the first 32 bits of a hash and move on.&lt;/p&gt;
&lt;p&gt;At about 80,000 uploads, two files collide, and one of them silently overwrites
the other, and the bug report says the customer&amp;rsquo;s invoice contains someone
else&amp;rsquo;s line items.&lt;/p&gt;</description></item></channel></rss>