<?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>L1 on CS Theorems</title><link>https://cs.lozic.me/difficulties/l1/</link><description>Recent content in L1 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/difficulties/l1/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>Consistent Hashing</title><link>https://cs.lozic.me/posts/t072-consistent-hashing/</link><pubDate>Fri, 29 Oct 2027 12:00:00 +0100</pubDate><guid>https://cs.lozic.me/posts/t072-consistent-hashing/</guid><description>&lt;h2 id="symptom"&gt;Symptom&lt;/h2&gt;
&lt;p&gt;You shard a cache across ten servers with the obvious rule:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;server&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;servers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;hash&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;servers&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It works. Then you add an eleventh server, and &lt;code&gt;% 10&lt;/code&gt; becomes &lt;code&gt;% 11&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Every key now maps somewhere else. Not one tenth of them — essentially all of
them. A key landing on the same server after the change is a coincidence with
probability about $1/11$, so roughly 91% of your cache is instantly invalid.
Every request misses, every miss hits the database, and the database, sized for
a 95% cache hit rate, now receives twenty times its provisioned load and falls
over.&lt;/p&gt;</description></item><item><title>Quorum Intersection (R + W &gt; N)</title><link>https://cs.lozic.me/posts/t065-quorum-intersection/</link><pubDate>Fri, 13 Aug 2027 12:00:00 +0100</pubDate><guid>https://cs.lozic.me/posts/t065-quorum-intersection/</guid><description>&lt;h2 id="symptom"&gt;Symptom&lt;/h2&gt;
&lt;p&gt;You have three replicas of a value. A client writes &lt;code&gt;v2&lt;/code&gt; and gets an
acknowledgement. Another client reads and gets &lt;code&gt;v1&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Nothing crashed. No network partition healed badly. Both operations completed
successfully and reported success. The write went to one replica, the read came
from another, and the two never spoke.&lt;/p&gt;</description></item><item><title>Happens-Before and Lamport Clocks</title><link>https://cs.lozic.me/posts/t058-happens-before-and-lamport-clocks/</link><pubDate>Fri, 28 May 2027 12:00:00 +0100</pubDate><guid>https://cs.lozic.me/posts/t058-happens-before-and-lamport-clocks/</guid><description>&lt;h2 id="symptom"&gt;Symptom&lt;/h2&gt;
&lt;p&gt;Two writes to the same key. Which one wins?&lt;/p&gt;
&lt;p&gt;Your first instinct is timestamps: whichever has the later wall-clock time is
newer. This works in testing. In production you get a bug report saying an
update vanished, and when you dig in, node B&amp;rsquo;s clock was 40 ms behind node A&amp;rsquo;s,
so B&amp;rsquo;s &lt;em&gt;later&lt;/em&gt; write carried an &lt;em&gt;earlier&lt;/em&gt; timestamp and lost. NTP is running.
NTP does not make clocks identical, it makes them close, and &amp;ldquo;close&amp;rdquo; is not
&amp;ldquo;ordered.&amp;rdquo;&lt;/p&gt;</description></item><item><title>P vs NP</title><link>https://cs.lozic.me/posts/t026-p-vs-np/</link><pubDate>Fri, 12 Mar 2027 12:00:00 +0100</pubDate><guid>https://cs.lozic.me/posts/t026-p-vs-np/</guid><description>&lt;h2 id="symptom"&gt;Symptom&lt;/h2&gt;
&lt;p&gt;You are handed a scheduling problem. Two hundred tasks, precedence constraints,
shared resources, and a deadline. Somebody wants an optimal schedule.&lt;/p&gt;
&lt;p&gt;Checking a proposed schedule takes seconds: walk the list, verify each
constraint, add up the makespan. Finding one is different. Your search runs for
a day and finds nothing. You try simulated annealing, then a genetic algorithm,
then branch and bound. Each gives good schedules and none gives the best one, and
you cannot tell whether the problem is hard or you are not clever enough.&lt;/p&gt;</description></item><item><title>The Coffman Conditions</title><link>https://cs.lozic.me/posts/t051-the-coffman-conditions/</link><pubDate>Fri, 29 Jan 2027 12:00:00 +0100</pubDate><guid>https://cs.lozic.me/posts/t051-the-coffman-conditions/</guid><description>&lt;h2 id="symptom"&gt;Symptom&lt;/h2&gt;
&lt;p&gt;Production is wedged. Not slow — wedged. CPU is at zero, no errors are being
logged, and two threads are sitting in a lock wait with no timeout. The stack
traces show thread A holding the account lock and waiting for the ledger lock,
thread B holding the ledger lock and waiting for the account lock. Somebody
restarts the service and it goes away.&lt;/p&gt;</description></item><item><title>The Chomsky Hierarchy</title><link>https://cs.lozic.me/posts/t038-the-chomsky-hierarchy/</link><pubDate>Fri, 08 Jan 2027 12:00:00 +0100</pubDate><guid>https://cs.lozic.me/posts/t038-the-chomsky-hierarchy/</guid><description>&lt;h2 id="symptom"&gt;Symptom&lt;/h2&gt;
&lt;p&gt;The most upvoted answer in Stack Overflow history is a refusal to answer. Someone
asked how to match nested HTML tags with a regular expression, and the reply is
a page of escalating horror about the centre not holding. It is funny, and it is
also a theorem, which is not obvious from reading it.&lt;/p&gt;</description></item><item><title>The Universal Machine</title><link>https://cs.lozic.me/posts/t013-the-universal-machine/</link><pubDate>Fri, 01 Jan 2027 12:00:00 +0100</pubDate><guid>https://cs.lozic.me/posts/t013-the-universal-machine/</guid><description>&lt;h2 id="symptom"&gt;Symptom&lt;/h2&gt;
&lt;p&gt;You write a Python program. It runs. What ran it?&lt;/p&gt;
&lt;p&gt;CPython — itself a program, written in C, compiled to x86 instructions, executed
by a CPU whose control unit is arguably interpreting microcode, possibly inside
a virtual machine, on a kernel that scheduled it, all perhaps within a container
image. At no point in that stack does anyone find it strange that a program&amp;rsquo;s
job is running other programs. We build emulators, JITs, WebAssembly runtimes,
Docker, QEMU, and browsers that download and execute arbitrary code from
strangers, and treat every layer as ordinary engineering.&lt;/p&gt;</description></item><item><title>The Church–Turing Thesis</title><link>https://cs.lozic.me/posts/t012-the-church-turing-thesis/</link><pubDate>Fri, 25 Dec 2026 12:00:00 +0100</pubDate><guid>https://cs.lozic.me/posts/t012-the-church-turing-thesis/</guid><description>&lt;h2 id="symptom"&gt;Symptom&lt;/h2&gt;
&lt;p&gt;Somebody says &amp;ldquo;CSS is Turing-complete&amp;rdquo; and the room splits. Half the people
treat it as a joke about a styling language, the other half as a serious claim
with consequences. Both reactions are common and only one is right.&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><item><title>The Two Generals Problem</title><link>https://cs.lozic.me/posts/t061-the-two-generals-problem/</link><pubDate>Fri, 30 Oct 2026 12:00:00 +0100</pubDate><guid>https://cs.lozic.me/posts/t061-the-two-generals-problem/</guid><description>&lt;h2 id="symptom"&gt;Symptom&lt;/h2&gt;
&lt;p&gt;You call the payment API. The request goes out. Nothing comes back.&lt;/p&gt;
&lt;p&gt;Did the charge happen? You genuinely do not know. Retrying might double-charge
the customer. Not retrying might drop the payment. There is no third option
available, and no amount of care in your client library creates one.&lt;/p&gt;</description></item><item><title>Conway's Law</title><link>https://cs.lozic.me/posts/t089-conways-law/</link><pubDate>Fri, 23 Oct 2026 12:00:00 +0200</pubDate><guid>https://cs.lozic.me/posts/t089-conways-law/</guid><description>&lt;h2 id="symptom"&gt;Symptom&lt;/h2&gt;
&lt;p&gt;The service has four layers. Nobody designed four layers. There were four teams.&lt;/p&gt;
&lt;p&gt;Or the version that arrives in a postmortem: the outage happened at the boundary
between two services, in the retry logic, because each side assumed the other
owned the deduplication. Both teams were right about their own component and
neither had ever been in a room with the other.&lt;/p&gt;</description></item><item><title>The Halting Problem</title><link>https://cs.lozic.me/posts/t010-the-halting-problem/</link><pubDate>Fri, 09 Oct 2026 12:00:00 +0200</pubDate><guid>https://cs.lozic.me/posts/t010-the-halting-problem/</guid><description>&lt;h2 id="symptom"&gt;Symptom&lt;/h2&gt;
&lt;p&gt;Your CI has a test that hangs. Not fails — hangs. Somebody suggests the obvious
fix: before running a test, check whether it terminates, and skip it if not.&lt;/p&gt;</description></item><item><title>Cantor's Diagonal Argument</title><link>https://cs.lozic.me/posts/t002-cantors-diagonal-argument/</link><pubDate>Fri, 02 Oct 2026 12:00:00 +0200</pubDate><guid>https://cs.lozic.me/posts/t002-cantors-diagonal-argument/</guid><description>&lt;h2 id="symptom"&gt;Symptom&lt;/h2&gt;
&lt;p&gt;Somebody proposes a tool that will find all the bugs. Not most bugs. All of
them. The pitch has the shape: we enumerate the failure modes, we write a
checker for each, we keep adding checkers, and the set of undetected bugs
shrinks toward zero.&lt;/p&gt;</description></item><item><title>Amdahl's Law</title><link>https://cs.lozic.me/posts/t081-amdahls-law/</link><pubDate>Fri, 18 Sep 2026 12:00:00 +0200</pubDate><guid>https://cs.lozic.me/posts/t081-amdahls-law/</guid><description>&lt;h2 id="symptom"&gt;Symptom&lt;/h2&gt;
&lt;p&gt;The profile was unambiguous: 94% of wall-clock time in one loop, and the loop&amp;rsquo;s
iterations are independent. You parallelise it across sixteen cores, the flame
graph flattens exactly as predicted, and the end-to-end time goes from 40
seconds to 17.&lt;/p&gt;</description></item><item><title>Hyrum's Law and Postel's Principle</title><link>https://cs.lozic.me/posts/t091-hyrums-law-and-postels-principle/</link><pubDate>Fri, 11 Sep 2026 12:00:00 +0200</pubDate><guid>https://cs.lozic.me/posts/t091-hyrums-law-and-postels-principle/</guid><description>&lt;h2 id="symptom"&gt;Symptom&lt;/h2&gt;
&lt;p&gt;You fix a typo in an error message. Four days later a customer escalates:
their alerting pipeline greps for the old string and has gone quiet.&lt;/p&gt;
&lt;p&gt;Or you make a function faster, and a test suite that had been green for two years
starts failing intermittently — not because the function is wrong, but because
it used to be slow enough to hide a race.&lt;/p&gt;</description></item><item><title>No Universal Lossless Compressor</title><link>https://cs.lozic.me/posts/t004-no-universal-lossless-compressor/</link><pubDate>Fri, 04 Sep 2026 12:00:00 +0200</pubDate><guid>https://cs.lozic.me/posts/t004-no-universal-lossless-compressor/</guid><description>&lt;h2 id="symptom"&gt;Symptom&lt;/h2&gt;
&lt;p&gt;Someone sends you a pitch deck. The claim is a compression algorithm that
reduces &lt;em&gt;any&lt;/em&gt; file by a guaranteed ratio, and — this is always the tell — that
it can be applied repeatedly. Four gigabytes down to one, then one down to two
fifty, and so on until the whole film is a few hundred bytes and a clever
decoder.&lt;/p&gt;</description></item><item><title>The Pigeonhole Principle</title><link>https://cs.lozic.me/posts/t001-pigeonhole-principle/</link><pubDate>Fri, 28 Aug 2026 12:00:00 +0200</pubDate><guid>https://cs.lozic.me/posts/t001-pigeonhole-principle/</guid><description>&lt;h2 id="symptom"&gt;Symptom&lt;/h2&gt;
&lt;p&gt;You are asked to build a cache key. You have a 64-bit hash, and someone on the
team says: &amp;ldquo;collisions are basically impossible, there are eighteen quintillion
values.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;Or: your service assigns short IDs to uploads, six characters of base-36, and
you are wondering when you need to worry.&lt;/p&gt;</description></item></channel></rss>