<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>agniv sarkar</title>
    <description>安妮武</description>
    <link>https://old.agniv.me/</link>
    <atom:link href="https://old.agniv.me/feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Wed, 25 Mar 2026 22:17:12 +0000</pubDate>
    <lastBuildDate>Wed, 25 Mar 2026 22:17:12 +0000</lastBuildDate>
    <generator>Jekyll v3.10.0</generator>
    
      <item>
        <title>Online Algorithms: A Primer</title>
        <description>&lt;p&gt;This was my final project for CS254. You can find the full PDF version &lt;a href=&quot;/assets/pdfs/CS254_Sarkar_Online_Algorithms-1.pdf&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;abstract&quot;&gt;Abstract&lt;/h2&gt;

&lt;p&gt;The $k$-server problem asks how $k$ mobile servers in a metric space should be dispatched to serve an online sequence of requests so as to minimize total distance traveled.  Introduced by Manasse, McGeoch, and Sleator [MMS88], it has driven the development of competitive analysis for over three decades.&lt;/p&gt;

&lt;p&gt;This expository work (PSST! If you don’t want to commit to reading all this, I’d recommend reading up to Section 4 and skipping the proofs in Section 4, as some of the bound analysis gets pretty dry. I’d recommend checking out 6.1, since it’s kind of fun, and 7.1 as well.) traces that development from foundations to the present day.  We begin with the paging and ski rental problems to motivate competitive ratios and adversarial models, then analyze deterministic and randomized paging algorithms, including the marking algorithm of Fiat et al. [FKL+91] and the optimal partitioning algorithm of McGeoch and Sleator [MS91].  Turning to the $k$-server problem proper, we present the deterministic lower bound of $k$, the Double coverage [CKPV91] and Balance [MMS90] algorithms for special cases, and the Work Function Algorithm of Koutsoupias and Papadimitriou [KP95], which achieves a competitive ratio of $2k-1$ on all metrics.  On the randomized side, we cover the $O(\log^2 k)$-competitive algorithm of Bubeck, Cohen, Lee, Lee, and Madry [BCL+18] for hierarchically separated trees and the recent breakthrough of Bubeck, Coester, and Rabani [BCR23], who disproved the longstanding randomized $k$-server conjecture by constructing metric spaces requiring $\Omega(\log^2 k)$ competitive ratio.  We conclude with the $k$-taxi problem [GKP24], the weighted $k$-server problem [GKP23, BMC26], and the learning-augmented framework [LV21], collecting open problems throughout.&lt;/p&gt;

&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;/h2&gt;

&lt;p&gt;Uber is currently valued at around 150 billion USD.  Abstracting the business away, their core algorithmic problem comes down to having some number of drivers in a city with a streaming set of pickup and drop-off locations, and wanting to minimize overhead.  If we knew all requests in advance we could solve this offline, but in practice, requests arrive one at a time and decisions must be made immediately.&lt;/p&gt;

&lt;p&gt;This is the regime of &lt;em&gt;online algorithms&lt;/em&gt;, and the $k$-server problem is, in my opinion, its most celebrated representative. The story of the $k$-server problem is one of a thirty-year conjecture that turned out to be both half-right and half-wrong.  We follow the arc from Sleator and Tarjan’s foundational work [ST85] through the Work Function Algorithm [KP95] to the recent disproof of the randomized conjecture [BCR23], emphasizing the techniques that were derived along the way, such as potential functions, residues, work functions, HST embeddings, and
entropic regularization.&lt;/p&gt;

&lt;p&gt;Concretely, the paper is organized as follows.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Get Online!&lt;/strong&gt;.  We define online algorithms, adversarial models, and the competitive ratio, and introduce the paging and ski rental problems.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Competitive Analysis&lt;/strong&gt;. We cover Sleator and Tarjan’s analysis of paging [ST85], the marking algorithm [FKL+91], and the   optimal partitioning algorithm [MS91].&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;The $k$-Server Problem&lt;/strong&gt;. We present the $k$-server conjecture [MMS88], the Double Coverage [CKPV91] and RES/BAL [MMS90] algorithms, and the Work Function Algorithm with its $(2k-1)$-competitiveness proof [KP95].&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Randomized $k$-Server&lt;/strong&gt;. We discuss the $\Omega(\sqrt{\log k/\log\log k})$ lower   bound [BKRS92], HST   embeddings [Bar96, FRT04], the   polylogarithmic upper bound [BBMN15], and entropic regularization [BCL+18, CL22].&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;The Randomized Conjecture is False&lt;/strong&gt;. We describe the $\Omega(\log^2 k)$ lower bound of Bubeck, Coester, and Rabani [BCR23] and its recursive metric-space construction.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Extensions and Open Problems&lt;/strong&gt;. We cover the $k$-taxi problem [GKP24], the weighted $k$-server problem [GKP23,  BMC26], and learning-augmented   algorithms [LV21, LMS25], and collect the major open questions.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This paper might feel rushed at the end, but for what it’s worth? I doubt we’ll see any fractal-like metric spaces in our lifetimes.&lt;/p&gt;

&lt;h2 id=&quot;get-online&quot;&gt;Get Online!&lt;/h2&gt;

&lt;p&gt;An online algorithm $\mathcal{A}$ is given the input a piece at a time and is forced to make a decision based on the input that we have fed it so far.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Definition.&lt;/strong&gt;
We say $\mathcal{A}$ is an online algorithm if it receives a sequence of requests $\sigma = (r_1, \ldots, r_n)$ and must choose some action after each request $r_t$ is revealed, without knowing $r_{t+1}, r_{t+2}, \ldots$.&lt;/p&gt;

&lt;p&gt;In this regime, we usually care less about the speed of the algorithm, and rather about how close we can approximate the offline, pure solution. To this end, we need to define some kind of way to score these algorithms. Note that the problem I described above (called the $k$-taxi problem) can be given a score by summing up the total amount of distance driven. Similarly, we associate a cost function $C_\mathcal{A}$ for the “cost” of the solution outputted by the online algorithm.&lt;/p&gt;

&lt;p&gt;To compare it against, we define $C_{OPT}$ as the cost of the solution produced by the Optimal Offline Algorithm (OPT has better mouthfeel than OOA). Thus we can define the notion of a competitive ratio.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Definition (Competitive Ratio).&lt;/strong&gt;
We say that an online algorithm $\mathcal{A}$ is $\alpha$-competitive if there exists a constant $\beta$ such that for every input sequence $\sigma$,
\(C_\mathcal{A}(\sigma) \le \alpha  C_{\text{OPT}}(\sigma) + \beta.\)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Definition (Randomized Competitive Ratio).&lt;/strong&gt;
A randomized online algorithm $\mathcal{A}$ is $\alpha$-competitive if there exists a constant $\beta$ such that for every input sequence $\sigma$,
\(\mathbb{E}[C_\mathcal{A}(\sigma)] \le \alpha  C_{\text{OPT}}(\sigma) + \beta,\)
 where the expectation is taken over the internal randomness of $\mathcal{A}$.&lt;/p&gt;

&lt;p&gt;We say an algorithm is not competitive if no such $\alpha$ exists. Note that these consider “all” possible $\sigma$ sequences. However, given an online algorithm, we can construct specific adversaries to analyze the algorithm’s behavior.&lt;/p&gt;

&lt;p&gt;The oblivious adversary is the simplest possible adversary. Here, we can fix the entire request sequence $\sigma$ in advance. It doesn’t adapt to the algorithm’s choices. Slightly more involved is the adaptive adversary, which chooses future requests based on the algorithm’s past behavior.&lt;/p&gt;

&lt;p&gt;In some sense, these are all the tools you really need to think about these problems.&lt;/p&gt;

&lt;h3 id=&quot;simple-problems&quot;&gt;Simple Problems&lt;/h3&gt;

&lt;p&gt;Before we hit the big leagues with the $k$-taxi question, we’re going to focus on slightly easier questions. The &lt;em&gt;paging problem&lt;/em&gt; is inspired by handling memory. We have a cache size $k$, each of which can hold one page. We have $m$ page requests. If a page in the cache is requested, we call it a hit, and if a page not in the cache is requested, we call it a fault and incur a cost of $1$. We also have to move this page into the cache and boot out another page. You can intuit this design as splitting memory between a fast and a slow part, and the cost of accessing memory from the slow memory is $1$ and $0$ from the fast. So, now the question is how to best design this algorithm to minimize the number of faults.&lt;/p&gt;

&lt;p&gt;Another conventional online algorithm is called the &lt;em&gt;ski rental problem&lt;/em&gt;. You’ve likely interacted with this problem before. Broadly, a ski-rental type problem asks if given an expensive up front cost or a less expensive repeating cost, with no real knowledge of how the future will play out (will it snow in the Bay Area?) at what point should you pay the up front cost? More specifically, assume that renting a ski costs $1$ unit a day and buying skis instead costs $b$ units. Every day you are given the option to continue renting skis or to buy a pair of skis. The online adversary, on some unknown day $D$, is going to break your legs, so you’d like to minimize the cost of skiing so you can pay for your medical treatment.&lt;/p&gt;

&lt;p&gt;Both of these problems are clearly extremely relevant to us as humans (caching and knee health) and therefore we must study them.&lt;/p&gt;

&lt;h2 id=&quot;competitive-analysis&quot;&gt;Competitive Analysis&lt;/h2&gt;

&lt;p&gt;This section will cover [ST85], one of the foundational papers in what would become competitive analysis. While the term “competitive analysis” was later coined by Karlin, Manasse, Rudolph, and Sleator [KMRS88] and the framework was further developed by Manasse, McGeoch, and Sleator [MMS88], Sleator and Tarjan’s paper established the key idea of comparing an online algorithm’s cost against the optimal offline algorithm. The paper describes the list update problem more generally and then goes into the paging problem.&lt;/p&gt;

&lt;p&gt;For this section, $k$ will refer to the cache size and $m$ will refer to the number of requests made. First, we describe the optimal offline algorithm, which is simple and greedy. In the case of a fault, eject a page that we know will never be used again, or if you can’t, eject the page whose future use is the furthest away. This is Bélády’s algorithm, also known as Longest Forward Distance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Theorem (Bélády’s Algorithm).&lt;/strong&gt;
Longest Forward Distance is optimal for the paging problem.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Proof.&lt;/em&gt;
For contradiction, assume that longest forward distance (LFD) is not optimal. Then there exists a finite input sequence $\sigma$ where LFD does not return an optimal solution. Let OPT be an optimal algorithm, and suppose LFD and OPT first differ at step $i$.&lt;/p&gt;

&lt;p&gt;We will modify OPT so that its cost does not increase and it agrees with LFD on steps $1,\ldots,i$.&lt;/p&gt;

&lt;p&gt;First suppose the $i$th request does not cause a page fault under LFD. Then LFD makes no eviction, while OPT must evict some page to differ. Since both caches are identical before step $i$, OPT does not need to evict any page. Thus we can modify OPT so that it also performs no eviction at step $i$. If OPT later needs the page it unnecessarily evicted, it can evict it at that later time instead, without increasing the total cost. Hence OPT can be modified to match LFD at step $i$ without increasing cost.&lt;/p&gt;

&lt;p&gt;Now suppose the $i$th request is a page fault. Then LFD and OPT evict different pages; let $p$ be the page evicted by LFD and $p’$ the page evicted by OPT. By definition of LFD, the next request to $p$ occurs strictly later than the next request to $p’$ (or $p$ is never requested again).&lt;/p&gt;

&lt;p&gt;Let $l$ be the first future time at which either $p$ or $p’$ is requested again. Since $p$ is requested later than $p’$, the request at time $l$ must be for $p’$.&lt;/p&gt;

&lt;p&gt;We construct a modified algorithm OPT$’$ as follows:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;At step $i$, OPT$’$ evicts $p$ instead of $p’$.&lt;/li&gt;
  &lt;li&gt;From steps $i+1$ through $l-1$, OPT$’$ behaves exactly like OPT.&lt;/li&gt;
  &lt;li&gt;At step $l$, OPT$’$ incurs a page fault for $p’$ and loads it into the cache, evicting $p$ if necessary.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Up to time $l-1$, OPT$’$ has all pages that OPT needs, so it incurs no additional faults. At time $l$, OPT$’$ incurs one fault for $p’$. However, OPT must eventually incur a fault for whichever page it does not have among ${p,p’}$ when that page is requested. Thus OPT$’$ incurs no more faults than OPT overall.&lt;/p&gt;

&lt;p&gt;Therefore OPT$’$ has cost no greater than OPT and agrees with LFD for the first $i$ steps, contradicting the choice of $i$ as the first point of disagreement. Hence LFD is optimal.
□&lt;/p&gt;

&lt;p&gt;Now, another name for this algorithm is called the clairvoyant algorithm. So unless we have access to a psychic, this doesn’t work in the online case. However, as one might’ve guessed already, an adaptive adversary might screw us over.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Theorem.&lt;/strong&gt;
Any deterministic online algorithm cannot be less than $k$-competitive.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Proof.&lt;/em&gt;
Let $\mathcal{A}$ be any deterministic online algorithm for the paging problem with cache size $k$. We consider a universe of $k+1$ distinct pages. Before each request, $\mathcal{A}$ has exactly $k$ pages in its cache, so there is always one page not currently in the cache. An adversary can request precisely that page. Thus $\mathcal{A}$ incurs a page fault on every request. For a sequence of length $m$, the total cost of $\mathcal{A}$ is therefore $m$.&lt;/p&gt;

&lt;p&gt;Now consider the optimal offline algorithm OPT. Since there are only $k+1$ pages total, at any time OPT also has $k$ pages in its cache and is missing exactly one page. By the adversary’s construction, $\mathcal{A}$ always faults on every request. OPT, however, holds $k$ of the $k+1$ pages at any time, and after serving a request it can keep that page in cache until a request arrives for the unique page it does not currently store.&lt;/p&gt;

&lt;p&gt;We may assume OPT uses Bélády’s algorithm. When OPT faults and evicts some page $w$, it chooses $w$ to be the page whose next request is farthest in the future (or which is never requested again). After the eviction, OPT’s cache contains $k$ pages, each of which has its next request strictly before the next request to $w$. Therefore, all $k$ cached pages must be requested before $w$ is requested again, giving at least $k$ requests between consecutive OPT faults.&lt;/p&gt;

&lt;p&gt;It follows that over a sequence of length $m$,
\(C_{\text{OPT}} \le \left\lceil \frac{m}{k} \right\rceil.\)
 Since $C_{\mathcal{A}} = m$, we obtain
\(\frac{C_{\mathcal{A}}}{C_{\text{OPT}}}\ge\frac{m}{\lceil m/k \rceil} \ge k - o(1).\)
 Thus no deterministic online algorithm can have competitive ratio strictly smaller than $k$.
□&lt;/p&gt;

&lt;p&gt;This is a lower bound style result for online algorithms, at least for the worst-case competitive analysis. Inside of Sleator and Tarjan [ST85], they list out a few deterministic demand paging (only replace when necessary) algorithms from previous work:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Least Recently Used (LRU).&lt;/strong&gt; When a replacement is necessary, evict the page whose most recent access occurred farthest in the past.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;First-In, First-Out (FIFO).&lt;/strong&gt; Evict the page that has been in fast memory the longest.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Last-In, First-Out (LIFO).&lt;/strong&gt; Evict the page that was most recently brought into fast memory.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Least Frequently Used (LFU).&lt;/strong&gt; Evict the page that has been accessed the fewest times.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We will only really discuss the competitiveness of the LRU and FIFO.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Theorem (LRU).&lt;/strong&gt;
LRU is $k$-competitive.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Proof.&lt;/em&gt;
Partition the request sequence into &lt;em&gt;phases&lt;/em&gt; as follows. The first phase begins with the first request and ends just before the $(k+1)$-st distinct page is requested. Each subsequent phase begins with the
first request not included in the previous phase and again ends just before the next request that would introduce a $(k+1)$-st distinct page within that phase.
Thus, each phase contains requests to at most $k$ distinct pages.&lt;/p&gt;

&lt;p&gt;Consider LRU during a phase. At the beginning of a phase, the cache may contain any pages. However, during the phase there are at most $k$ distinct pages requested, so after the first request to each of those pages, LRU will contain all of them in its cache. Therefore, LRU incurs at most $k$ faults per phase.&lt;/p&gt;

&lt;p&gt;Now consider the optimal offline algorithm (OPT). Between two consecutive phases, at least $k+1$ distinct pages are requested (otherwise the phases would merge). Since the cache holds only $k$ pages, OPT must incur at least one fault in each phase after the first.&lt;/p&gt;

&lt;p&gt;If there are $m$ phases, LRU incurs at most $km$ faults, while OPT incurs at least $m-1$ faults. Hence
\(\text{LRU} \le k \cdot \text{OPT} + k,\)
 which implies LRU is $k$-competitive.
□&lt;/p&gt;

&lt;p&gt;This concept of a phase is the main method of chunking and analyzing these paging style algorithms.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/online-algorithms/page-05.jpeg&quot; alt=&quot;Figure 1: Phase structure for paging proofs&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Theorem (FIFO).&lt;/strong&gt;
FIFO is $k$-competitive.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Proof.&lt;/em&gt;
We use the same phase partition as in the LRU proof: each phase contains at most $k$ distinct pages.&lt;/p&gt;

&lt;p&gt;We claim FIFO incurs at most $k$ faults per phase. Suppose FIFO faults more than $k$ times in a phase. Each fault inserts a new page into the cache and evicts the oldest resident page. After $k$ such faults, all pages currently in the cache must have been requested during the phase. A further fault would require requesting a page not currently in cache, which would imply more than $k$ distinct pages were requested in the phase, contradicting the definition of a phase. Thus FIFO has at most $k$ faults per phase.&lt;/p&gt;

&lt;p&gt;As before, OPT must incur at least one fault per phase after the first, since each phase introduces at least one page not present among the previous $k$ distinct pages.&lt;/p&gt;

&lt;p&gt;If there are $m$ phases, FIFO incurs at most $km$ faults and OPT incurs at least $m-1$ faults, so
\(\text{FIFO} \le k \cdot \text{OPT} + k.\)
 Therefore FIFO is $k$-competitive.
□&lt;/p&gt;

&lt;h3 id=&quot;marking-algorithm&quot;&gt;Marking Algorithm&lt;/h3&gt;

&lt;p&gt;In 1991, Fiat, Karp, Luby, McGeoch, Sleator, and Young [FKL+91] devised a randomized online algorithm for this problem called the marking algorithm. They were able to achieve a randomized competitive ratio of $2H_k \leq 2\ln(k) + 2$.&lt;/p&gt;

&lt;p&gt;The algorithm is as follows. Our cache currently contains the pages $1$ to $k$, and we “mark” all of these pages. After each request, we mark the page that is being requested. Once $k+1$ pages are marked, all the marks except the most recently requested page are erased. If the requested page is already inside of the cache, we do nothing (other than marking it). Otherwise, a page is chosen uniformly at random from among the unmarked pages currently in the cache and is evicted; the requested page is then brought into the cache and marked.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Algorithm 1: Marking Algorithm for Paging&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-pseudocode&quot;&gt;Initialize cache with pages 1 to k
Mark all pages currently in cache
For each request p in the request sequence:
    Mark page p
    If more than k pages are marked:
        Erase all marks except the mark on p
    If p is already in cache:
        continue
    Else:
        Choose a page uniformly at random from the unmarked pages in cache
        Evict the chosen page and bring p into cache
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Intuitively, marks ensure that during any period in which at most $k$ distinct pages are requested, each page is evicted at most once in expectation. The paper describes this as a randomized-variant of LRU.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Theorem (Marking Algorithm).&lt;/strong&gt;
The marking algorithm is $2H_k$-competitive.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Proof.&lt;/em&gt;
We use the same notion of phases, though now we partition the request sequence into phases defined by the algorithm itself: a new phase begins each time the marks are cleared. Within each complete phase, exactly $k$ distinct pages are requested before the marks are cleared (the final phase may have fewer).&lt;/p&gt;

&lt;p&gt;Fix a phase $p \ge 2$. At the start of the phase, the cache holds $k$ pages, all unmarked. Let $Q$ denote the set of (at most $k$) distinct pages requested in phase $p$. Partition the pages into three categories:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Old pages:&lt;/strong&gt; pages in $Q \cap S$, where $S$ is the cache at the start of the phase. These are pages already in the cache that will be requested during this phase.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;New pages:&lt;/strong&gt; pages in $Q \setminus S$. These are not in cache and will each cause exactly one fault when first requested.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Stale pages:&lt;/strong&gt; pages in $S \setminus Q$. These are in cache but will not be requested during this phase.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let $d = \lvert Q \setminus S \rvert$ denote the number of new pages. Since $\lvert S \rvert = k$ and $\lvert Q \rvert \le k$, there are also exactly $d$ stale pages and $k - d$ old pages.&lt;/p&gt;

&lt;p&gt;Every new page causes exactly one fault. Additionally, an old page causes a fault if and only if it is evicted (by a random eviction) before it is first requested. Once an old page is requested, it is marked and protected from eviction for the remainder of the phase. So the total number of faults in this phase is&lt;/p&gt;

\[\text{faults in phase } p = d + \text{(number of old pages prematurely evicted)}.\]

&lt;p&gt;Order the old pages as $o_1, o_2, \ldots, o_{k-d}$ by the time of their first request in this phase ($o_1$ is requested first, etc.). We claim that for each $i$,&lt;/p&gt;

\[\Pr[o_i \text{ is evicted before its first request}] \le \frac{d}{d + (k - d) - (i - 1)} = \frac{d}{k - i + 1}.\]

&lt;p&gt;To see this, consider the moment just before $o_i$ is first requested. At this point, $o_1, \ldots, o_{i-1}$ have already been requested and marked, so they are safe. The unmarked pages in the cache are $o_i$ itself, the old pages $o_{i+1}, \ldots, o_{k-d}$ (not yet requested), and whatever stale pages have not yet been evicted. All evictions prior to $o_i$’s request chose uniformly among unmarked pages. By a symmetry argument (each unmarked page is equally likely to be chosen at each eviction step), the probability that $o_i$ was selected before any of the remaining $d$ stale pages plus the other $(k - d - i)$ unrequested old pages is at most $\frac{d}{k - i + 1}$.&lt;/p&gt;

&lt;p&gt;By linearity of expectation:&lt;/p&gt;

\[\begin{align}
    \mathbb{E}[\text{faults in phase } p]
    &amp;amp;= d + \sum_{i=1}^{k-d} \Pr[o_i \text{ evicted prematurely}] \\
    &amp;amp;\le d + \sum_{i=1}^{k-d} \frac{d}{k - i + 1} \\
    &amp;amp;= d + d \sum_{j=d+1}^{k} \frac{1}{j} \quad (\text{substituting } j = k - i + 1) \\
    &amp;amp;= d\!\left(1 + \sum_{j=d+1}^{k} \frac{1}{j}\right)
    = d\!\left(1 + H_k - H_d\right)
    \le d \cdot H_k,
\end{align}\]

&lt;p&gt;Consider two consecutive phases $p$ and $p+1$. Phase $p$ requests a set $Q_p$ of $k$ distinct pages, and the $(k+1)$-st distinct page triggers the start of phase $p+1$ with its set $Q_{p+1}$. Thus $\lvert Q_p \cup Q_{p+1} \rvert \ge k + 1$. Since OPT has a cache of size $k$, it must incur at least $\lvert Q_p \cup Q_{p+1} \rvert - k \ge 1$ faults across phases $p$ and $p+1$.&lt;/p&gt;

&lt;p&gt;More precisely, let $d_{p+1} = \lvert Q_{p+1} \setminus Q_p \rvert$ be the number of new pages in phase $p+1$ relative to the previous phase’s requests. Then OPT must fault at least $d_{p+1}$ times across phases $p$ and $p+1$, since the $d_{p+1}$ pages in $Q_{p+1} \setminus Q_p$ were not in $Q_p$, and OPT’s cache can hold at most $k$ pages from $Q_p$.&lt;/p&gt;

&lt;p&gt;From our bound, the marking algorithm’s expected faults in phase $p+1$ is at most $d_{p+1} \cdot H_k$. Since OPT incurs at least $d_{p+1}$ faults across the pair of phases $p$ and $p+1$, we incur at most $H_k$ times OPT’s cost per pair. Summing over all phases and accounting for the double-counting (each phase participates in two consecutive pairs), we obtain:&lt;/p&gt;

\[\mathbb{E}[C_{\text{Marking}}] \le 2 H_k \cdot C_{\text{OPT}}.\]

&lt;p&gt;□&lt;/p&gt;

&lt;p&gt;Perhaps surprisingly, the marking algorithm’s factor of $2H_k$ is not tight, rather, the lower bound for randomized paging is $H_k$, proved in the same paper [FKL+91]. McGeoch and Sleator [MS91] closed this gap with the &lt;em&gt;partitioning algorithm&lt;/em&gt;, which achieves the optimal competitive ratio of exactly $H_k$. The key idea is to maintain a dynamically evolving labeled partition of the page universe that tracks the behavior of OPT, and then use this partition to guide randomized eviction decisions more carefully than the marking algorithm does.&lt;/p&gt;

&lt;p&gt;The algorithm maintains an ordered sequence of disjoint sets $S_\alpha, S_{\alpha+1}, \ldots, S_\beta$ whose union is the full set of $n$ pages. Each set $S_i$ (except $S_\beta$) carries an integer label $k_i$ satisfying $k_\alpha = 0$ and $k_i = k_{i-1} + \lvert S_i \rvert - 1$ for $\alpha &amp;lt; i \leq \beta - 1$, so that $k_{\beta - 1} = k - \lvert S_\beta \rvert$.&lt;/p&gt;

&lt;p&gt;The set $S_\alpha$ consists of pages not in cache (analogous to “new” pages in the marking algorithm), while $S_\beta$ consists of the most recently touched pages. These labels track how many pages OPT can afford to keep from each group.&lt;/p&gt;

&lt;p&gt;The partition is augmented with a system of &lt;em&gt;marks&lt;/em&gt;: for each $i$ with $\alpha \leq i &amp;lt; \beta$, there are $k_i$ distinct $i$-marks placed on $i$-&lt;em&gt;eligible&lt;/em&gt; pages (those in $S_i$ or having an $(i-1)$-mark). The algorithm keeps in cache every page in $S_\beta$ and every page with a $(\beta-1)$-mark.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Algorithm 2: Partitioning Algorithm for Paging (McGeoch–Sleator [MS91])&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-pseudocode&quot;&gt;Initialize: alpha &amp;lt;- 1, beta &amp;lt;- 2, S_1 &amp;lt;- pages not in cache, S_2 &amp;lt;- cached pages, no marks
For each request to page v:
    Let i be such that v in S_i
    If v in S_beta:                       // Cache hit
        Do nothing
    ElsIf alpha &amp;lt; i &amp;lt; beta:              // In an intermediate set
        For j = i to beta - 1:           // Load v with marks
            If v does not have a j-mark:
                Pick a page w with a j-mark uniformly at random
                Transfer all l-marks (l &amp;gt;= j) from w to v
                If a (beta-1)-mark moves, load v into cache and evict w
        Move v to S_beta; erase all marks on v; recompute labels k_i to restore the invariant
    ElsIf v in S_alpha:                  // Cache miss on uncached page
        Increment beta; move v into the new S_beta
        Create k-1 new (beta-1)-marks; distribute uniformly among the k currently cached pages
        The page not receiving a mark is evicted from cache; load v
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The crucial difference from the marking algorithm is the refined partition structure. Where the marking algorithm uses a single binary distinction (marked/unmarked) and double-counts OPT’s cost across consecutive phases, the partitioning algorithm maintains a multi-level partition that tracks OPT’s state precisely via Lemma 1 of [MS91]. This allows the potential function $\Phi = \sum_{\alpha \leq i &amp;lt; \beta} (H_{k_i + 1} - 1)$ to absorb the algorithm’s cost exactly, eliminating the factor of $2$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Theorem (Partitioning Algorithm [MS91]).&lt;/strong&gt;
The partitioning algorithm is $H_k$-competitive for the paging problem.&lt;/p&gt;

&lt;p&gt;This first problem hopefully makes it clear that there is a division between the approximations between the optimal offline algorithm, an online algorithm with access to randomization, and a deterministic online algorithm.&lt;/p&gt;

&lt;h2 id=&quot;server-questions&quot;&gt;Server Questions&lt;/h2&gt;

&lt;p&gt;The paging problem is actually a special case of a much more general framework. Manasse, McGeoch, and Sleator [MMS88] in 1988 formalized the $k$-server problem, which captures a broad class of online problems on metric spaces, and described certain conjectures that would direct the field over the next 30-so years. We still aren’t advanced enough yet to hit the uber/taxi problem, but we’re close.&lt;/p&gt;

&lt;p&gt;First, we need to define a metric space.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Definition (Metric Space).&lt;/strong&gt;
A metric space is a pair $(M, d)$ where $M$ is a set and $d : M \times M \to \mathbb{R}$ that satisfies distance axioms. Specifically, $d(x, x) = 0$, $d(x, y) = d(y, x) &amp;gt; 0$ for $x \neq y$, and $d(x, z) \leq d(x, y) + d(y, z)$.&lt;/p&gt;

&lt;p&gt;Now, the $k$-server problem is as follows. We are given some metric space $M, d$ and a set of $k$ “servers,” where each server is represented as a labeled point in the metric space. Each request that comes in is in the form of a point in the space. As each request arrives, the algorithm must move a server to the requested point, and the total cost is the sum of all the distance covered in $M$, which is given to us by $d$. Intuitively, this captures problems like sending server repairers to servers that need it in some city, and again you want to minimize travel time and costs.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/online-algorithms/page-09.jpeg&quot; alt=&quot;Figure 2: The k-server problem&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Now, the first algorithm to pop into any unsuspecting student’s mind (it did for me) is the greedy algorithm. For our sake, let’s use the standard metric on $\mathbb{R}$, and let’s use $2$ servers, which we place at $0, 1$ for now. The greedy algorithm would simply be to move the closest server to the request location.&lt;/p&gt;

&lt;p&gt;Intuitively, one would hope that this algorithm minimizes globally. However, it does not. Consider the stream of inputs alternating $(0.75, 1.25)$. Note that the server originally at $1$ simply moves between them and we gain infinite cost, even though moving the $0$ server to $0.75$ and the $1$ server to $1.25$ would give us a finite cost. Therefore, the greedy algorithm doesn’t even have a finite competitive ratio!&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/online-algorithms/page-09(1).jpeg&quot; alt=&quot;Figure 3: Greedy algorithm failure&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Perhaps surprisingly, a very soft modification of the greedy algorithm admits a provably competitive solution. Chrobak, Karloff, Payne, and Vishwanathan [CKPV91] introduced the Double Coverage (DC) algorithm, which is $k$-competitive for $k$ servers on a line. We describe it here for the $2$-server case. Let $x_i, y_i$ denote the positions of the two servers before the $i$th request $r_i$. The Double Coverage (DC) algorithm works as follows:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;If $r_i \le x_i$, move $x_i$ directly to $r_i$.&lt;/li&gt;
  &lt;li&gt;If $r_i \ge y_i$, move $y_i$ directly to $r_i$.&lt;/li&gt;
  &lt;li&gt;If $r_i$ lies strictly between $x_i$ and $y_i$, move both servers toward $r_i$ at the same speed until one of them reaches the request.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Intuitively, DC spreads its servers evenly over the line and only moves both when the request is “between” them, ensuring that no server travels too far unnecessarily.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/online-algorithms/page-10.jpeg&quot; alt=&quot;Figure 4: Double Coverage cases&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Theorem (DC).&lt;/strong&gt;
Double Coverage is $2$-competitive for two servers on a line.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Proof.&lt;/em&gt;
We use a potential function argument. Let $x$ and $y$ denote the positions of the two DC servers with $x \le y$, and let $p_1, p_2$ denote the positions of the two OPT servers. After the $t$-th request has been served by both DC and OPT, define the following quantities:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;The &lt;em&gt;minimum-weight matching&lt;/em&gt; between DC’s servers and OPT’s servers:&lt;/li&gt;
&lt;/ul&gt;

\[M = \min\bigl(|x - p_1| + |y - p_2|, |x - p_2| + |y - p_1|\bigr).\]

&lt;ul&gt;
  &lt;li&gt;The &lt;em&gt;spread&lt;/em&gt; of DC’s servers: $S = y - x \ge 0$.&lt;/li&gt;
  &lt;li&gt;The &lt;em&gt;potential&lt;/em&gt;: $\Phi = 2M + S$.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Note that $\Phi \ge 0$ always, since both $M \ge 0$ and $S \ge 0$.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/online-algorithms/page-10(1).jpeg&quot; alt=&quot;Figure 5: DC potential function&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The proof is as follows. We will show that for each request $r_t$,&lt;/p&gt;

\[C_{\text{DC}}(t) + \Delta\Phi(t) \le 2  C_{\text{OPT}}(t),\]

&lt;p&gt;where $\Delta\Phi(t) = \Phi^{(\text{after})} - \Phi^{(\text{before})}$ is the net change in potential during the $t$-th request.&lt;/p&gt;

&lt;p&gt;Summing the above inequality over all $T$ requests and telescoping:
\(\sum_{t=1}^{T} C_{\text{DC}}(t) + \Phi_T - \Phi_0 \le 2 \sum_{t=1}^{T} C_{\text{OPT}}(t).\)
 Since $\Phi_T \ge 0$, we may drop it from the left side, yielding
\(C_\text{DC} \le 2  C_\text{OPT} + \Phi_0,\)
 where $\Phi_0$ is the initial potential (a constant depending on the starting configurations of DC and OPT). Thus DC is $2$-competitive.&lt;/p&gt;

&lt;p&gt;Now we must prove the amortized inequality above. Fix a request $r$. We decompose the potential change into OPT’s response and DC’s response:
\(\Delta\Phi = \Delta\Phi_{\text{OPT}} + \Delta\Phi_{\text{DC}}.\)
 We analyze each in turn to compute delta.&lt;/p&gt;

&lt;p&gt;Suppose OPT moves one of its servers a distance $d_{\text{OPT}}$ to serve $r$. The spread $S = y - x$ does not change during OPT’s move (only OPT’s servers move). For the matching cost $M$, consider the two possible matchings. The cost of whichever matching was optimal before OPT’s move changes by at most $d_{\text{OPT}}$ (by the triangle inequality). The new minimum matching can only be cheaper, so $M$ increases by at most $d_{\text{OPT}}$. Therefore,
\(\Delta\Phi_{\text{OPT}} = 2\Delta M_{\text{OPT}} + \underbrace{\Delta S_{\text{OPT}}}_{=0} \le 2  d_{\text{OPT}} = 2  C_{\text{OPT}}(t).\)&lt;/p&gt;

&lt;p&gt;Now, we analyze DC’s move. We consider two cases based on the position of the request $r$ relative to the interval $[x, y]$.&lt;/p&gt;

&lt;p&gt;In the first case, say $r \not \in [x, y]$. Without loss of generality, suppose $r &amp;lt; x$. Then DC moves only the left server $x$ to the request point $r$, traveling a distance $d_{\text{DC}} = x - r &amp;gt; 0$. The spread increases: $\Delta S = d_{\text{DC}}$.&lt;/p&gt;

&lt;p&gt;After OPT has moved, one of OPT’s servers is at $r$. Consider the matching that pairs DC’s left server (now at $r$) with OPT’s server at $r$ at cost $0$, and pairs DC’s right server $y$ with OPT’s remaining server. Since $y$ has not moved, the cost of the second pair is unchanged from before. Before DC’s move, the matching that paired DC’s left server $x$ with OPT’s server at $r$ had cost $\lvert x - r \rvert = d_{\text{DC}}$ for that pair; this pair now costs $0$. Since the minimum matching $M$ is at most the cost of any particular matching, $M$ decreases by at least $d_{\text{DC}}$: $\Delta M \le -d_{\text{DC}}$. Therefore,
\(\Delta\Phi_{\text{DC}} = 2\Delta M_{\text{DC}} + \Delta S_{\text{DC}} \le 2(-d_{\text{DC}}) + d_{\text{DC}} = -d_{\text{DC}}.\)&lt;/p&gt;

&lt;p&gt;Now say that $r \in [x, y]$. Let $\ell = r - x$ and $\ell’ = y - r$, so $\ell + \ell’ = S$ and both are non-negative. Assume without loss of generality that $\ell \le \ell’$. By the Double Coverage rule, both servers move toward $r$ at equal speed until one arrives. The left server reaches $r$ first (after moving $\ell$), and the right server moves $\ell$ toward $r$ as well. The total cost to DC is $C_{\text{DC}}(t) = 2\ell$. The new spread is $S’ = (y - \ell) - r = \ell’ - \ell$, so $\Delta S = -2\ell$.&lt;/p&gt;

&lt;p&gt;After OPT has moved, one of OPT’s servers is at $r$. DC’s left server is now also at $r$, so these can be matched at cost $0$. DC’s right server has moved from $y$ to $y - \ell$. Consider the minimum-weight matching after DC’s move. One candidate matching pairs DC’s left server (at $r$) with OPT’s server at $r$ at cost $0$, and pairs DC’s right server ($y - \ell$) with OPT’s remaining server. Before DC’s move, the matching that used the same pairing had cost $\lvert r - x \rvert + \lvert y - q \rvert$ for some OPT server $q$, and now the first pair costs $0$ and the second pair changes by at most $\ell$ (since the right server moved distance $\ell$). Since the minimum matching $M$ is at most the cost of any particular matching, and we have exhibited one whose cost did not increase, we conclude $\Delta M_{\text{DC}} \le 0$. Therefore,
\(\Delta\Phi_{\text{DC}} = 2\Delta M_{\text{DC}} + \Delta S_{\text{DC}} \le 2(0) + (-2\ell) = -2\ell = -C_{\text{DC}}(t).\)&lt;/p&gt;

&lt;p&gt;In both cases, $\Delta\Phi_{\text{DC}} \le -C_{\text{DC}}(t)$. Adding the contributions:&lt;/p&gt;

\[\begin{aligned}
C_{\text{DC}}(t) + \Delta\Phi(t) &amp;amp;= C_{\text{DC}}(t) + \Delta\Phi_{\text{OPT}} + \Delta\Phi_{\text{DC}} \\
&amp;amp;\le C_{\text{DC}}(t) + 2C_{\text{OPT}}(t) - C_{\text{DC}}(t) \\
&amp;amp;= 2C_{\text{OPT}}(t).
\end{aligned}\]

&lt;p&gt;This establishes the amortized inequality, completing the proof.
□&lt;/p&gt;

&lt;p&gt;In this proof, we introduced the notion of a &lt;em&gt;potential function&lt;/em&gt;. Here, the potential measured two things: how “out of place” DC’s servers were relative to OPT (via the minimum-weight matching $M$) and how spread out DC’s servers were (via the spread $S$). The key mechanism is amortized analysis. Even though DC may pay a cost on a given request, this cost is always offset by a corresponding drop in potential. The factor of $2$ in $\Phi = 2M + S$ is chosen precisely so that the bookkeeping works out, as when DC moves outside the interval, the spread increase is exactly canceled by twice the matching decrease, and when DC moves inside the interval, the spread decrease alone pays for everything.&lt;/p&gt;

&lt;h3 id=&quot;lower-bound-for-k-server&quot;&gt;Lower Bound for $k$-server&lt;/h3&gt;

&lt;p&gt;Note that the $k$-server problem is defined for a general metric space and most numbers are larger than $2$. In fact, the following theorem can be shown.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Theorem (Lower Bound on Servers).&lt;/strong&gt;
For any (symmetric) $k$-server problem, there is no $\alpha$-competitive deterministic algorithm for $\alpha &amp;lt; k$.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Proof.&lt;/em&gt;
It suffices to exhibit a metric space on which no deterministic algorithm can achieve competitive ratio smaller than $k$. Consider the &lt;em&gt;uniform metric&lt;/em&gt; on $k+1$ points ${p_1, \ldots, p_{k+1}}$, where the distance between every pair of distinct points is $1$.&lt;/p&gt;

&lt;p&gt;Just like with the paging problem, we’re going to have an adaptive adversary. Let $\mathcal{A}$ be any deterministic online algorithm with $k$ servers. At any time, $\mathcal{A}$ occupies $k$ of the $k+1$ points, leaving exactly one point uncovered. The adversary generates a request sequence $\sigma$ of length $m$ by always requesting the unique point not currently occupied by $\mathcal{A}$. Since $\mathcal{A}$ must move a server (distance $1$) to serve every request,
\(C_{\mathcal{A}}(\sigma) = m.\)
 Note that consecutive requests are always to distinct points, since $\mathcal{A}$ covers the previous request before the adversary chooses the next.&lt;/p&gt;

&lt;p&gt;We now show that the optimal offline algorithm satisfies $C_{\text{OPT}}(\sigma) \le \lceil m/k \rceil$. On the uniform metric, each server movement costs exactly $1$, so $C_{\text{OPT}}$ equals the number of requests at which OPT must move a server (i.e., the number of OPT “faults”).&lt;/p&gt;

&lt;p&gt;For now we assume without proof that OPT uses Bélády’s algorithm: when OPT must move a server, it vacates the point whose next request in $\sigma$ is the farthest in the future (or which is never requested again). The proof of Bélády’s algorithm being optimal on the uniform metric is very similar to the one we have already done for the paging problem. Now, we claim that between any two consecutive OPT faults, at least $k$ requests occur.&lt;/p&gt;

&lt;p&gt;To see this, suppose OPT faults at time $t$, serving request $r_t$ by moving its server off some point $w$ (the point with the farthest next request, by Bélády’s rule). After this move, OPT covers the $k$ points $S = {p_1, \ldots, p_{k+1}} \setminus {w}$. The next OPT fault occurs when $w$ is eventually requested. Until then, all requests are to points in $S$.&lt;/p&gt;

&lt;p&gt;By the Bélády eviction rule, every point in $S$ has its next request strictly before the next request to $w$. Therefore, each of the $k$ points in $S$ must be requested at least once before $w$ is requested again. This gives at least $k$ requests between the fault at time $t$ and the next fault.&lt;/p&gt;

&lt;p&gt;It follows that over $m$ requests, OPT faults at most $\lceil m/k \rceil$ times (including the possible initial fault). Hence,
\(C_{\text{OPT}}(\sigma) \le \left\lceil \frac{m}{k} \right\rceil.\)&lt;/p&gt;

&lt;p&gt;Thus, the competitive ratio of $\mathcal{A}$ on the sequence $\sigma$ satisfies
\(\frac{C_{\mathcal{A}}(\sigma)}{C_{\text{OPT}}(\sigma)} \ge \frac{m}{\lceil m/k \rceil} \ge \frac{m}{m/k + 1} = \frac{k}{1 + k/m} \to k \quad \text{as } m \to \infty.\)&lt;/p&gt;

&lt;p&gt;More precisely, for any constant $\beta$, the inequality $C_{\mathcal{A}}(\sigma) \le \alpha  C_{\text{OPT}}(\sigma) + \beta$ requires $m \le \alpha \lceil m/k \rceil + \beta$, which fails for large $m$ whenever $\alpha &amp;lt; k$. Since $\mathcal{A}$ was arbitrary, no deterministic online algorithm achieves competitive ratio strictly less than $k$.
□&lt;/p&gt;

&lt;p&gt;Generally speaking, dealing with metrics on $\mathbb{R}^n$ is somewhat annoying, and so instead we often think of dealing with metric spaces with finitely many points (oftentimes just $k+1$) and set distances between any two points such that it respects a metric. These can be represented as graphs and embedded in $\mathbb{R}^n$ so it is hopefully clear that working in the reduced metric space setting doesn’t really abstract that much away.&lt;/p&gt;

&lt;p&gt;Now, inside of [MMS90], they describe a general $2$-competitive algorithm for the $2$-server problem on an arbitrary $n$-vertex graph. Before we get there, we need a tool that will be useful for proving competitiveness.&lt;/p&gt;

&lt;h4 id=&quot;residues&quot;&gt;Residues&lt;/h4&gt;

&lt;p&gt;Recall that in the lower bound and DC proofs, we compared the online algorithm’s cost against $C_{\text{OPT}}(\sigma)$, the cost of the best offline solution on the entire input $\sigma$. However, the optimal offline algorithm might end with its servers in any one of many possible configurations! So, it ends up being useful to track the optimal cost conditioned on the final state.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Definition (State-Conditioned Optimal Cost).&lt;/strong&gt;
Given a request sequence $\sigma$ and an initial server configuration $S_0$, define $C_{\text{OPT}}(\sigma, S)$ to be the minimum cost of any lazy (doesn’t move if it doesn’t have to) offline algorithm that processes $\sigma$ starting from $S_0$ and ends with servers in configuration $S$. If no such algorithm exists, $C_{\text{OPT}}(\sigma, S) = \infty$.&lt;/p&gt;

&lt;p&gt;This function can be computed by dynamic programming, where at each step, the algorithm either stays in its current state (if the request is already covered) or transitions to a new state by moving one server. The overall optimal cost is $\min_S C_{\text{OPT}}(\sigma, S)$.&lt;/p&gt;

&lt;p&gt;Now, given an online algorithm $\mathcal{A}$ and a target competitive factor $\alpha$, we define the &lt;em&gt;$\alpha$-residue&lt;/em&gt; as a measure of how much slack $\mathcal{A}$ has relative to $\alpha$ times the optimal.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Definition (Residue).&lt;/strong&gt;
Let $\mathcal{A}$ be an online algorithm with cost $C_\mathcal{A}(\sigma)$ after processing $\sigma$. The $\alpha$-residue for state $S$ is&lt;/p&gt;

\[R_\alpha(\sigma, S) = \alpha \cdot C_{\text{OPT}}(\sigma, S) - C_\mathcal{A}(\sigma).\]

&lt;p&gt;Since $\alpha \cdot C_{\text{OPT}}(\sigma) = \alpha \cdot \min_S C_{\text{OPT}}(\sigma, S) \leq \alpha \cdot C_{\text{OPT}}(\sigma, S)$ for any state $S$, we have&lt;/p&gt;

\[\alpha \cdot C_{\text{OPT}}(\sigma) - C_\mathcal{A}(\sigma) \geq \min_S R_\alpha(\sigma, S).\]

&lt;p&gt;Therefore, $\mathcal{A}$ is $\alpha$-competitive if and only if there exists a constant $\beta$ such that $R_\alpha(\sigma, S) \geq -\beta$ for all $\sigma$ and all states $S$. In other words, to prove competitiveness, it suffices to show that the residues never drop below some fixed constant.&lt;/p&gt;

&lt;p&gt;So, instead of directly bounding the ratio $C_\mathcal{A} / C_{\text{OPT}}$, we can instead maintain an invariant on the residue vector. Since the state-conditioned optimal cost $C_{\text{OPT}}(\sigma, S)$ can be updated incrementally via dynamic programming, any online algorithm can compute its own residue vector as it processes requests.&lt;/p&gt;

&lt;h4 id=&quot;the-res-algorithm&quot;&gt;The RES Algorithm&lt;/h4&gt;

&lt;p&gt;With residues in hand, we can describe the algorithm RES for two servers on an $n$-vertex metric space $(M, d)$. At any point, RES has two servers on distinct vertices. We adopt the convention that vertex $1$ denotes the most recently requested vertex and vertex $2$ denotes the other vertex occupied by RES. An offline algorithm must also cover vertex $1$, but may place its other server at any of the remaining $n - 1$ vertices. So at any step there are $n - 1$ finite $2$-residues, one for each possible location of the offline algorithm’s second server.&lt;/p&gt;

&lt;p&gt;Write $R_{1,i}$ for the $2$-residue comparing RES to an offline algorithm occupying vertices $1$ and $i$. Algorithm RES initializes&lt;/p&gt;

\[R_{1,i} = d(1, i) + 2d(2, i) \quad \text{for each } i \notin \{1\}.\]

&lt;p&gt;When a request arrives at an unoccupied vertex $i$, RES moves from vertex $1$ if&lt;/p&gt;

\[\min_k \bigl\{ R_{1,k} + 2d(k, i) \bigr\} \geq 2d(1, i) + d(1, 2),\]

&lt;p&gt;and moves from vertex $2$ otherwise.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Algorithm 3: Algorithm RES for 2 Servers on (M, d)&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-pseudocode&quot;&gt;Place servers at initial vertices v_1, v_2; label 1 &amp;lt;- v_1, 2 &amp;lt;- v_2
R_{1,i} &amp;lt;- d(1,i) + 2d(2,i) for all i != 1
For each request at vertex i:
    If i is already covered:
        continue
    If min_k { R_{1,k} + 2d(k,i) } &amp;gt;= 2d(1,i) + d(1,2):   // Move from vertex 1
        Move server from 1 to i
        R_{i,1} &amp;lt;- min_k{R_{1,k} + 2d(k,i)} - d(1,i)
        R_{i,j} &amp;lt;- R_{1,j} - d(1,i) for all j not in {1, i}
        Relabel: 1 &amp;lt;- i, vertex 2 unchanged
    Else:                                                     // Move from vertex 2
        Move server from 2 to i
        R_{i,2&apos;} &amp;lt;- min_k{R_{1,k} + 2d(k,i)} - d(2,i)
        R_{i,j} &amp;lt;- R_{1,j} + 2d(1,i) - 2d(2,i) for all j not in {2&apos;, i}
        Relabel: 1 &amp;lt;- i, 2 &amp;lt;- old vertex 1
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;To prove that RES is $2$-competitive, Manasse, McGeoch, and Sleator [MMS90] maintain an invariant on the pairwise sums of residues. Define the function&lt;/p&gt;

\[Y(a, b, c, e) = \min\bigl\{2d(a,b) + 2d(c,e), 2d(a,c) + 2d(b,e), 2d(a,e) + 2d(b,c)\bigr\}.\]

&lt;p&gt;This is symmetric in its arguments (permuting them does not change the value, since the minimum ranges over all three perfect matchings of four points). The triangle inequality ensures&lt;/p&gt;

\[Y(u, v, w, x) + 2d(u, y) \geq Y(y, v, w, x).\]

&lt;p&gt;&lt;strong&gt;Theorem (RES [MMS90]).&lt;/strong&gt;
RES is $2$-competitive for the symmetric $2$-server problem on any $n$-vertex metric space.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Proof.&lt;/em&gt;[Proof sketch]
The proof shows by induction that after every request,&lt;/p&gt;

\[R_{1,i} + R_{1,j} \geq Y(1, 2, i, j)\]

&lt;p&gt;for every pair of vertices $i, j$ (including $i = j$). Since $Y \geq 0$, this gives a constant lower bound on all residues, which by our earlier discussion implies $2$-competitiveness.&lt;/p&gt;

&lt;p&gt;With the initial values $R_{1,i} = d(1,i) + 2d(2,i)$:&lt;/p&gt;

\[R_{1,i} + R_{1,j} = d(1,i) + d(1,j) + 2d(2,i) + 2d(2,j).\]

&lt;p&gt;To verify the invariant, consider whichever of the three matchings achieves $Y(1,2,i,j)$. If the minimum is $2d(1,j) + 2d(2,i)$, then $2d(1,i) + 2d(2,j) \geq 2d(1,j) + 2d(2,i)$, which gives $d(1,i) - d(1,j) \geq d(2,i) - d(2,j)$, so&lt;/p&gt;

\[\begin{aligned}
R_{1,i} + R_{1,j} - Y &amp;amp;= d(1,i) - d(1,j) + 2d(2,j) \\
&amp;amp;\geq d(2,i) - d(2,j) + 2d(2,j) \\
&amp;amp;= d(2,i) + d(2,j) \geq 0.
\end{aligned}\]

&lt;p&gt;The other two cases follow by a symmetric argument.&lt;/p&gt;

&lt;p&gt;Suppose the invariant holds and a request arrives at unoccupied vertex $i$. We consider the two cases of the decision rule (equation above).&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Case 1: RES moves from vertex $1$.&lt;/em&gt; Vertex $i$ becomes the new vertex $1’$, and vertex $2$ is unchanged. The updated residues are&lt;/p&gt;

\[R_{1&apos;,j} = \begin{cases}
\min_k\{R_{1,k} + 2d(k,i)\} - d(1,i) &amp;amp; \text{if } j = 1, \\
R_{1,j} - d(1,i) &amp;amp; \text{otherwise.}
\end{cases}\]

&lt;p&gt;To verify the invariant for the new labeling, one checks all pairs $(j, l)$ using the old invariant, the triangle inequality, and the $Y$ inequality property.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Case 2: RES moves from vertex $2$.&lt;/em&gt; Vertex $i$ becomes the new $1’$, and the old vertex $1$ becomes the new $2’$. The updated residues are&lt;/p&gt;

\[R_{1&apos;,j} = \begin{cases}
\min_k\{R_{1,k} + 2d(k,i)\} - d(2,i) &amp;amp; \text{if } j = 2&apos;, \\
R_{1,j} + 2d(1,i) - 2d(2,i) &amp;amp; \text{otherwise.}
\end{cases}\]

&lt;p&gt;The most delicate sub-case is verifying the invariant for pairs $j, l$ with $j, l \neq 2’$. Here one expands $R_{1’,j} + R_{1’,l}$ using the old invariant for two separate pairs, applies the decision rule (which in this case gives $\min_k{R_{1,k} + 2d(k,i)} &amp;lt; 2d(1,i) + d(1,2)$), and finishes with the triangle inequality. The full case analysis involves six sub-cases and is carried out in [MMS90].
□&lt;/p&gt;

&lt;p&gt;The intuition behind RES is somewhat similar to the potential function argument we used for DC, as the residues encode a “budget” measuring how much slack RES has relative to twice the optimal cost, and the decision rule chooses which server to move so as to best preserve this budget. The $Y$ function captures the minimum cost of matching two pairs of vertices, and the invariant ensures that RES’s accumulated slack always exceeds this minimum.&lt;/p&gt;

&lt;p&gt;The same paper also describes an algorithm called BAL (short for “balance”) for the case of $n - 1$ servers on an $n$-vertex graph. BAL maintains, for each server, the total cumulative distance $D_i$ it has traveled since the start. When a request arrives at an uncovered vertex $j$, BAL moves the server at vertex $i$ that minimizes $D_i + d(i, j)$. In other words, BAL always moves whichever server would have the smallest total distance traveled after the move, spreading the work evenly across servers. Using a residue argument similar in spirit to (but simpler than) the one for RES, Manasse, McGeoch, and Sleator [MMS90] show that BAL is $(n-1)$-competitive for $n - 1$ servers on $n$ vertices.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Algorithm 4: Balance Algorithm (BAL) for n - 1 Servers on n Vertices&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-pseudocode&quot;&gt;Initialize servers at n - 1 distinct vertices of (M, d)
Set D_i &amp;lt;- 0 for each server at vertex i
For each request at vertex j:
    If j is already covered by a server:
        continue
    i* &amp;lt;- argmin_i { D_i + d(i, j) } among all vertices i with a server
    Move server from i* to j
    D_{i*} &amp;lt;- D_{i*} + d(i*, j)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;So at this point we have two strongly competitive algorithms, RES for $k = 2$ and BAL for $k = n - 1$, each matching the $k$-server lower bound exactly (the lower bound theorem above). I find these satisfying results, but they sit at the two extremes of the problem. For $k = 2$, RES needs to reason about pairs of servers, which is manageable. For $k = n - 1$, BAL benefits from the fact that only one vertex is ever uncovered. The difficult case is everything in between, with a moderate number of servers on a relatively large metric space, where neither trick can apply.&lt;/p&gt;

&lt;p&gt;This is what makes the $k$-server conjecture, stated by Manasse, McGeoch, and Sleator in the same paper [MMS88], so compelling:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conjecture ($k$-Server Conjecture).&lt;/strong&gt;
For every metric space with more than $k$ points, there exists a deterministic $k$-competitive online algorithm for the $k$-server problem.&lt;/p&gt;

&lt;p&gt;Given the lower bound we proved, $k$ is the best one could hope for. For six years (Technically, it could be seven years, since it’s between the conference and the journal paper. Six seven.) after the conjecture was posed, the best known upper bound for general metrics was exponential in $k$, as one could always view the $k$-server problem as a task system on $\binom{n}{k}$ states, giving a competitive ratio exponential in $k$, but this is absurdly large! The situation changed dramatically in 1995, when Koutsoupias and Papadimitriou [KP95] introduced the &lt;em&gt;work function algorithm&lt;/em&gt; and proved it $(2k - 1)$-competitive on any metric space. This is tantalizingly close to $k$, and as of today, it remains the best deterministic upper bound for general metrics.&lt;/p&gt;

&lt;h3 id=&quot;the-work-function-algorithm&quot;&gt;The Work Function Algorithm&lt;/h3&gt;

&lt;p&gt;The idea behind the work function algorithm (WFA) is so simple you can explain it while drunk (No comment on how the author knows. What stays in the UK stays in the UK.): it combines the greedy instinct of “move cheaply” with the global awareness of “don’t stray too far from what the optimal solution would do.” To make this precise, we need the state-conditioned optimal cost from the previous section.&lt;/p&gt;

&lt;p&gt;Recall that we write $C_{\text{OPT}}(\sigma, X)$ for the minimum cost of serving the request sequence $\sigma$ and ending in configuration $X$. This function is called the &lt;em&gt;work function&lt;/em&gt; after $\sigma$ requests and is typically denoted $w_t$ after the $t$-th request:&lt;/p&gt;

\[w_t(X) = C_{\text{OPT}}((r_1, \ldots, r_t), X).\]

&lt;p&gt;This tells us the cheapest way to serve all requests so far and end up with servers at the locations described by $X$. The work function satisfies the following key property. If a configuration $Y$ already covers the request $r_t$, then $w_t(Y) = w_{t-1}(Y)$, since an optimal algorithm reaching $Y$ can just stay there and serve $r_t$ for free. For a configuration $X$ that may or may not cover $r_t$, we have&lt;/p&gt;

\[w_t(X) = \min_{Y \ni r_t}\bigl\{w_t(Y) + d(Y, X)\bigr\},\]

&lt;p&gt;where $Y \ni r_t$ means $Y$ is a configuration containing a server at $r_t$, and $d(Y, X)$ is the minimum-cost way to move servers from configuration $Y$ to configuration $X$. This says that the cheapest way to serve $t$ requests and end at $X$ is to first reach some configuration $Y$ that covers $r_t$ (paying $w_t(Y)$), then rearrange to $X$ (paying $d(Y, X)$). This property follows from the triangle inequality and will be crucial in the proof.&lt;/p&gt;

&lt;p&gt;The WFA uses this function to decide how to move. Let $X_{t-1}$ be the algorithm’s configuration before the $t$-th request $r_t$. The WFA serves $r_t$ by choosing the configuration $X_t$ that minimizes the sum of the work function value and the cost of getting there:&lt;/p&gt;

\[X_t = \arg\min_{X \ni r_t} \bigl\{w_t(X) + d(X_{t-1}, X)\bigr\}.\]

&lt;p&gt;In practice, since we want a lazy algorithm (one that only moves a single server per request if needed, and in fact all optimal algorithms can be modified to be lazy), this amounts to choosing which server $s \in X_{t-1}$ to send to $r_t$. The configuration $X_t$ is then $X_{t-1}$ with $s$ replaced by $r_t$, and the cost is $d(s, r_t)$. So the decision rule is among all servers that could move to $r_t$, pick the one $s$ that minimizes $w_t(X_{t-1} \cup {r_t} \setminus {s}) + d(s, r_t)$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Algorithm 5: Work Function Algorithm (WFA)&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-pseudocode&quot;&gt;Initialize servers at configuration X_0
Set w_0(X_0) = 0 and w_0(X) = d(X_0, X) for all configurations X
For each request r_t:
    If r_t in X_{t-1}:
        X_t &amp;lt;- X_{t-1}                   // Request already covered
    Else:
        Update w_t(X) = min_{Y containing r_t}{w_{t-1}(Y) + d(X, Y)} for all X
        X_t &amp;lt;- argmin_{X containing r_t}{w_t(X) + d(X_{t-1}, X)}
        Move the appropriate server from X_{t-1} to r_t
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Notice that WFA doesn’t commit to any fixed heuristic like “move the nearest server” or “balance cumulative distances.” Instead, it consults the entire history (compressed into the work function) and asks “which move leaves me closest to the optimal, accounting for both the quality of the resulting configuration and the cost of reaching it?” This is what makes it so powerful but is also why it is expensive to implement, since maintaining $w_t$ requires tracking exponentially many configurations. But our concern here is the competitive ratio, not the running time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Theorem (Koutsoupias–Papadimitriou [KP95]).&lt;/strong&gt;
The Work Function Algorithm is $(2k - 1)$-competitive for the $k$-server problem on any metric space.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Proof.&lt;/em&gt;
Let $X_0, X_1, \ldots, X_T$ be the configurations chosen by WFA for the request sequence $\sigma = (r_1, \ldots, r_T)$. The proof tracks how $w_t(X_t)$, the work function evaluated at WFA’s own configuration, evolves over time.&lt;/p&gt;

&lt;p&gt;Consider the difference $w_t(X_t) - w_{t-1}(X_{t-1})$ at step $t$. We decompose this by adding and subtracting $w_t(X_{t-1})$:&lt;/p&gt;

\[w_t(X_t) - w_{t-1}(X_{t-1}) = \underbrace{\bigl(w_t(X_t) - w_t(X_{t-1})\bigr)}_{\text{WFA&apos;s choice}} + \underbrace{\bigl(w_t(X_{t-1}) - w_{t-1}(X_{t-1})\bigr)}_{\text{new request&apos;s impact}}.\]

&lt;p&gt;The first term measures how WFA’s move from $X_{t-1}$ to $X_t$ changes the work function value. By the WFA decision rule, $X_t$ minimizes $w_t(X) + d(X_{t-1}, X)$ over configurations $X$ covering $r_t$, while $X_{t-1}$ is one such configuration only if $r_t \in X_{t-1}$ (in which case $X_t = X_{t-1}$ and the term is zero).&lt;/p&gt;

&lt;p&gt;When $r_t \notin X_{t-1}$, we apply the property&lt;/p&gt;

\[w_t(X_{t-1}) = \min_{Y \ni r_t}\{w_t(Y) + d(Y, X_{t-1})\}.\]

&lt;p&gt;The WFA decision rule says $X_t$ minimizes $w_t(X) + d(X_{t-1}, X)$ over all $X \ni r_t$. Since $X_t \ni r_t$, it is a candidate for $Y$ in the property, so $w_t(X_{t-1}) \leq w_t(X_t) + d(X_t, X_{t-1})$.&lt;/p&gt;

&lt;p&gt;For the reverse direction, let $Y^{\ast}$ be the configuration achieving the minimum, so that $w_t(X_{t-1}) = w_t(Y^{\ast}) + d(Y^{\ast}, X_{t-1})$. Since $Y^{\ast} \ni r_t$, the WFA decision rule gives $w_t(X_t) + d(X_{t-1}, X_t) \leq w_t(Y^{\ast}) + d(X_{t-1}, Y^{\ast}) = w_t(X_{t-1})$, i.e., $w_t(X_{t-1}) \geq w_t(X_t) + d(X_t, X_{t-1})$. Thus equality holds:&lt;/p&gt;

\[w_t(X_{t-1}) = w_t(X_t) + d(X_t, X_{t-1}),\]

&lt;p&gt;which gives $w_t(X_t) - w_t(X_{t-1}) = -d(X_t, X_{t-1})$. In other words, the first term equals the negative of WFA’s movement cost at step $t$.&lt;/p&gt;

&lt;p&gt;For the second term, define the &lt;em&gt;extended cost&lt;/em&gt;&lt;/p&gt;

\[\text{EXT}_t = \max_X \bigl\{w_t(X) - w_{t-1}(X)\bigr\},\]

&lt;p&gt;the maximum increase in the work function over all configurations. Since $X_{t-1}$ is one particular configuration, $w_t(X_{t-1}) - w_{t-1}(X_{t-1}) \leq \text{EXT}_t$.&lt;/p&gt;

&lt;p&gt;Substituting both bounds into the decomposition above and summing over all $T$ steps:&lt;/p&gt;

\[w_T(X_T) - w_0(X_0) \leq \sum_{t=1}^T \text{EXT}_t - \sum_{t=1}^T d(X_{t-1}, X_t).\]

&lt;p&gt;Since $w_T(X_T) \geq \min_X w_T(X) = C_{\text{OPT}}(\sigma)$ and $w_0(X_0) = 0$, the left side is at least $C_{\text{OPT}}(\sigma)$. Recognizing $\sum_t d(X_{t-1}, X_t) = C_{\text{WFA}}(\sigma)$, we rearrange:&lt;/p&gt;

\[C_{\text{OPT}}(\sigma) + C_{\text{WFA}}(\sigma) \leq \sum_{t=1}^T \text{EXT}_t.\]

&lt;p&gt;The rest of the proof bounds $\sum_t \text{EXT}_t$. This is where the three key ingredients of Koutsoupias and Papadimitriou come in, which they outline in their abstract. First comes quasiconvexity. Then comes duality. Finally, potential.&lt;/p&gt;

&lt;p&gt;The work function $w_t$ satisfies a quasiconvexity property, for any two configurations $X$ and $Y$ that differ in the position of a single server, the work function does not have “local maxima” along the path between them. More precisely, if $X$ and $Y$ differ only in that $X$ has a server at $a$ while $Y$ has a server at $b$, then for any point $c$ on a shortest path from $a$ to $b$, the configuration $Z$ (which agrees with $X$ and $Y$ except with a server at $c$) satisfies $w_t(Z) \leq \max(w_t(X), w_t(Y))$. This is a structural property of optimal costs that follows from the triangle inequality.&lt;/p&gt;

&lt;p&gt;Using quasiconvexity, Koutsoupias and Papadimitriou characterize the configurations that achieve the maximum increase $\text{EXT}_t$. They show that the maximum is achieved at a configuration $Y_t$ that is, in a precise sense, “antipodal” to the request $r_t$, where the servers are as far from $r_t$ as possible while remaining consistent with the metric structure.&lt;/p&gt;

&lt;p&gt;In the special case of $n = k + 1$ points, this antipodal configuration is simply $Y_t = M \setminus \{r_t\}$, the unique configuration that avoids the request.&lt;/p&gt;

&lt;p&gt;For $n = k + 1$ points, define the potential $\Phi_t = \sum_X w_t(X)$, where the sum runs over all $k + 1$ possible configurations. Since work functions are monotone non-decreasing ($w_t(X) \geq w_{t-1}(X)$ for all $X$), we have&lt;/p&gt;

\[\begin{aligned}
\Phi_t - \Phi_{t-1} &amp;amp;= \sum_X (w_t(X) - w_{t-1}(X)) \\
&amp;amp;\geq \max_X (w_t(X) - w_{t-1}(X)) = \text{EXT}_t,
\end{aligned}\]

&lt;p&gt;so $\sum_t \text{EXT}_t \leq \Phi_T$. Since there are $k + 1$ configurations and each satisfies $w_T(X) \leq C_{\text{OPT}}(\sigma) + kD$ (where $D$ is the diameter), we get&lt;/p&gt;

\[\Phi_T \leq (k + 1)(C_{\text{OPT}}(\sigma) + kD).\]

&lt;p&gt;Plugging into the key inequality:&lt;/p&gt;

\[C_{\text{WFA}}(\sigma) \leq k \cdot C_{\text{OPT}}(\sigma) + k(k+1)D.\]

&lt;p&gt;So WFA is $k$-competitive when $n = k + 1$.&lt;/p&gt;

&lt;p&gt;For the general case ($n &amp;gt; k + 1$), the argument is considerably more involved. The duality lemma tells us that $\text{EXT}_t$ is achieved at a minimizer of $r_t$, defined as a configuration $A$ that minimizes&lt;/p&gt;

\[w_t(X) - \sum_{x \in X} d(r_t, x)\]

&lt;p&gt;over all configurations $X$. Intuitively, this is the configuration whose servers are “as far from the request as possible” relative to the work function.&lt;/p&gt;

&lt;p&gt;Koutsoupias and Papadimitriou then define a potential $\Phi(w)$ as the minimum of an expression \(\Psi(w, U, B_1, \ldots, B_k)\) over $k + 1$ configurations, specifically a “central” configuration $U$ containing the most recent request, and $k$ “satellite” configurations $B_1, \ldots, B_k$. The expression $\Psi$ involves the work function values at these configurations and all pairwise distances between them. The key calculation shows that the change in potential $\Phi(w’) - \Phi(w)$ bounds the extended cost $\text{EXT}_t$ from above. Telescoping and bounding the initial and final potentials yields:&lt;/p&gt;

\[\sum_{t=1}^T \text{EXT}_t \leq 2k \cdot C_{\text{OPT}}(\sigma) + k^2 D.\]

&lt;p&gt;Substituting into the key inequality:&lt;/p&gt;

\[C_{\text{WFA}}(\sigma) \leq (2k - 1) \cdot C_{\text{OPT}}(\sigma) + k^2 D,\]

&lt;p&gt;which establishes $(2k - 1)$-competitiveness.
□&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Remark (The antipodal viewpoint).&lt;/em&gt;
There is an appealing geometric way to see why the factor $2k$ arises in the general case, described in the lecture notes of Chawla [Cha07].&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/online-algorithms/page-18.jpeg&quot; alt=&quot;Figure 6: Antipodal construction&quot; /&gt;&lt;/p&gt;

&lt;p&gt;One constructs an “extended” metric space $M \cup \overline{M}$ by adding, for each point $a \in M$, an &lt;em&gt;antipode&lt;/em&gt; $\bar{a}$ with distances&lt;/p&gt;

\[d(a, \bar{a}) = D, \qquad
d(\bar{a}, \bar{b}) = d(a, b), \qquad
d(a, \bar{b}) = D - d(a, b),\]

&lt;p&gt;where $D$ is the diameter of $M$ (see figure above). One then considers a $k$-server instance on this $2n$-point space. The key observation is that the duality structure of the extended metric allows one to reduce the general-$n$ analysis to the simpler $n = k+1$ case; informally, the antipodal copies “double” the space so that the BAL-style argument applies. The duality lemma’s “minimizer” corresponds in this picture to placing all $k$ servers at the antipode of the request, which is the configuration that is literally as far as possible from $r_t$. One can then bound $\sum_t \text{EXT}_t$ by pairing each request with the OPT server that eventually serves it, giving the same $2k$ factor.&lt;/p&gt;

&lt;p&gt;Recall that the lower bound is $k$, and WFA gives us an upper bound of $2k - 1$. The WFA is widely conjectured to actually be $k$-competitive. For other metric spaces, we know $k$-competitive algorithms. Manasse, McGeoch, and Sleator [MMS88] settled the case $k = 2$ entirely, and specific $k$-competitive algorithms are known for the line [CKPV91] and trees [CL91] (the DC algorithm in both cases). For WFA specifically, Bartal and Koutsoupias [BK04] proved it is $k$-competitive on the line, on weighted stars, and on all metrics with $k + 2$ points. But for general metrics, closing the factor-of-two gap remains open.&lt;/p&gt;

&lt;p&gt;Anyway. What happens if we start gambling?&lt;/p&gt;

&lt;h2 id=&quot;randomized-k-server&quot;&gt;Randomized $k$-server&lt;/h2&gt;

&lt;p&gt;The deterministic picture, as we left it, is essentially stuck at $2k - 1$. Given that the marking algorithm gave us an exponential improvement from deterministic $k$ to randomized $H_k \approx \ln k$ for paging, it is natural to ask whether randomization can help on all metrics, not just the uniform one.&lt;/p&gt;

&lt;h3 id=&quot;the-randomized-conjecture&quot;&gt;The Randomized Conjecture&lt;/h3&gt;

&lt;p&gt;Recall that paging is the $k$-server problem on the uniform metric, and the marking algorithm achieves $O(\log k)$ competitive ratio there. Fiat et al. [FKL+91] proved that no randomized paging algorithm can achieve competitive ratio better than $H_k$, and McGeoch and Sleator [MS91] gave a matching $H_k$-competitive algorithm. Since paging is a special case of $k$-server, any randomized $k$-server algorithm must have competitive ratio at least $H_k = \Omega(\log k)$ on at least one metric. The prevailing belief for many years was that the uniform metric is the hardest case for randomized algorithms, and that this logarithmic barrier is the truth everywhere.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conjecture (Randomized $k$-Server Conjecture).&lt;/strong&gt;
For every metric space with more than $k$ points, there exists a randomized $O(\log k)$-competitive online algorithm for the $k$-server problem.&lt;/p&gt;

&lt;p&gt;This conjecture appears as folklore in the online algorithms literature, see Koutsoupias’s survey [Kou09] for a discussion. We will see that this conjecture is false, but getting there required decades of work from both the upper and lower bound sides.&lt;/p&gt;

&lt;h3 id=&quot;lower-bounds&quot;&gt;Lower Bounds&lt;/h3&gt;

&lt;p&gt;There are two kinds of lower bounds to track: &lt;em&gt;universal&lt;/em&gt; bounds (holding on all metrics with more than $k$ points) and &lt;em&gt;existential&lt;/em&gt; bounds (showing that some metric requires a high competitive ratio). The first super-constant lower bound for randomized $k$-server was proved by Blum, Karloff, Rabani, and Saks [BKRS92].&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Theorem (Blum–Karloff–Rabani–Saks [BKRS92]).&lt;/strong&gt;
For every metric space with at least $k + 1$ points, the randomized competitive ratio for the $k$-server problem against an oblivious adversary is $\Omega\left(\sqrt{\log k / \log\log k}\right)$.&lt;/p&gt;

&lt;p&gt;Their proof uses a decomposition theorem that reduces the problem to smaller subproblems and establishes lower bounds on each piece. This universal bound was later superseded by work of Bartal, Bollobás, and Mendel [BBM06], who proved Ramsey-type theorems for metric spaces for the $k$-server problem, and they showed the following theorem using quantitative bounds of Bartal, Linial, Mendel, and Naor [BLMN05].&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Theorem (Metric Ramsey Theorem [BBM06, BLMN05]).&lt;/strong&gt;
Every sufficiently large $n$-point metric space contains a subspace that is approximately a hierarchically separated tree (HST), which yields an $\Omega(\log n / \log\log n)$ lower bound for metrical task systems (MTS) on any $n$-point metric space.&lt;/p&gt;

&lt;p&gt;Since $k$-server on $k+1$ points is a special case of MTS, this yields a universal $k$-server lower bound of $\Omega(\log k / \log\log k)$, nearly matching the conjectured $\Theta(\log k)$. Equally importantly, the BBM framework established HSTs as the key structure underlying hard instances, a perspective that would drive the next two decades of progress.&lt;/p&gt;

&lt;h3 id=&quot;hierarchically-separated-trees&quot;&gt;Hierarchically Separated Trees&lt;/h3&gt;

&lt;p&gt;HSTs are the single most important class of metric spaces in the randomized $k$-server story, so we should define them properly. A &lt;em&gt;$\tau$-hierarchically separated tree&lt;/em&gt; ($\tau$-HST) is a rooted tree $T$ with positive vertex weights $w : V \to \mathbb{R}_+$ that are non-increasing along every root-to-leaf path, decreasing by a factor of at least $\tau$ at each step. The metric space is defined on the &lt;em&gt;leaves&lt;/em&gt; of $T$, with the distance between two leaves being the weight of their least common ancestor.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/online-algorithms/page-20.jpeg&quot; alt=&quot;Figure 7: HST example&quot; /&gt;&lt;/p&gt;

&lt;p&gt;For example, the uniform metric on $n$ points is a (degenerate) HST with a single root whose children are all the leaves, each at weight $1$. A more interesting HST might have depth $d$ with branching factor $b$ and weights that decrease geometrically: the root has weight $\Delta$, its children have weight $\Delta / \tau$, and so on down to $\Delta / \tau^{d-1}$ at the bottom. The key feature is that the distance between two leaves depends only on their depth of divergence, as leaves that diverge high up in the tree are far apart, while leaves that share a long common path from the root are close together.&lt;/p&gt;

&lt;p&gt;Why are HSTs central? Because of a remarkable theorem of Bartal [Bar96], who showed that every $n$-point metric space can be probabilistically embedded into HSTs with $O(\log^2 n)$ distortion. This was later made tight by Fakcharoenphol, Rao, and Talwar [FRT04]:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Theorem (HST Embedding [FRT04]).&lt;/strong&gt;
Every $n$-point metric space can be probabilistically embedded into a distribution over HSTs with distortion $O(\log n)$.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/online-algorithms/page-21.jpeg&quot; alt=&quot;Figure 8: HST embedding reduction&quot; /&gt;&lt;/p&gt;

&lt;p&gt;This means that if you have an $\alpha$-competitive algorithm for $k$-server on HSTs, you can turn it into an $O(\alpha \log n)$-competitive algorithm on any $n$-point metric space, at the cost of a single $O(\log n)$ factor from the embedding. So solving $k$-server on HSTs is “almost” the same as solving it in general.&lt;/p&gt;

&lt;h3 id=&quot;the-polylogarithmic-upper-bound&quot;&gt;The Polylogarithmic Upper Bound&lt;/h3&gt;

&lt;p&gt;The first major breakthrough in the randomized regime came from Bansal, Buchbinder, Madry, and Naor [BBMN15], who gave the first polylogarithmic-competitive randomized algorithm for $k$-server on general metrics in FOCS 2011, though it was published in 2015 proper:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Theorem (Bansal–Buchbinder–Madry–Naor [BBMN15]).&lt;/strong&gt;
There exists a randomized $O(\log^3 n \cdot \log^2 k \cdot \log\log n)$-competitive algorithm for the $k$-server problem on any $n$-point metric space.&lt;/p&gt;

&lt;p&gt;Their algorithm works by reducing the problem to HSTs (via Bartal’s embedding framework) and then solving recursively on the tree. Since the competitive ratio involves both $n$ and $k$, it only improves on the deterministic $2k - 1$ bound when $n$ is sub-exponential in $k$. Still, this was a landmark result, as it was the first randomized algorithm to break through the linear-in-$k$ barrier for a wide range of metric spaces. The competitive ratio’s dependence on $n$, however, meant that the randomized conjecture, which demands $O(\log k)$ independent of the metric, remained open.&lt;/p&gt;

&lt;p&gt;The next breakthrough came from Bubeck, Cohen, Y. T. Lee, J. R. Lee, and Madry [BCL+18], who introduced the technique of multiscale entropic regularization.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Theorem (Bubeck–Cohen–Lee–Lee–Madry [BCL+18]).&lt;/strong&gt;
There exists a randomized $O(\log^2 k)$-competitive algorithm for the $k$-server problem on any HST.&lt;/p&gt;

&lt;p&gt;This was the first time the competitive ratio on HSTs was bounded purely in terms of $k$. The idea is to formulate the $k$-server problem as a continuous optimization problem on a polytope of “fractional server allocations,” and then use mirror descent with an entropy-based potential function that operates at multiple scales of the tree simultaneously. Coester and Lee [CL22] further developed these entropic regularization techniques in the related setting of metrical task systems. Combined with Bartal’s static HST embedding, BCLLM gives $O(\log^2 k \cdot \log n)$ on $n$-point metric spaces. BCLLM also give a dynamic embedding yielding $O(\log^3 k \cdot \log \Delta)$, where $\Delta$ is the aspect ratio (the ratio of the largest to smallest nonzero distance), which removes the dependence on $n$ at the cost of depending on $\Delta$.&lt;/p&gt;

&lt;p&gt;A natural next step would be to remove the dependence on the geometry entirely. Lee [Lee18] proposed an elegant approach using “fusible” HSTs, which were dynamic embeddings that adapt to the request sequence rather than being fixed in advance. The key idea is that by allowing the HST approximation to evolve over time, one can avoid the $O(\log n)$ distortion penalty of a static embedding and obtain a competitive ratio of $O(\log^6 k)$ depending only on $k$. However, a non-trivial gap was subsequently found in the proof, and as of this writing the claimed result has been retracted by the author. (See &lt;a href=&quot;https://homes.cs.washington.edu/~jrl/papers/kserver-erratum.html&quot;&gt;https://homes.cs.washington.edu/~jrl/papers/kserver-erratum.html&lt;/a&gt;. Lee notes that a proposed fix exists but its integration with the rest of the argument is not yet complete.) The fusible HST framework remains a promising direction, but the $O(\text{poly}(\log k))$ competitive ratio on general metrics is not yet established.&lt;/p&gt;

&lt;p&gt;On general metric spaces, the situation is even less resolved. The best standing upper bound is the $O(\log^2 k \cdot \log n)$ obtained by combining BCLLM’s HST algorithm [BCL+18] with the $O(\log n)$-distortion embedding of FRT [FRT04]. BCLLM also give $O(\log^3 k \cdot \log \Delta)$ via a dynamic embedding, where $\Delta$ is the aspect ratio. The randomized conjecture predicted $O(\log k)$.&lt;/p&gt;

&lt;h2 id=&quot;the-randomized-conjecture-is-false&quot;&gt;The Randomized Conjecture is False&lt;/h2&gt;

&lt;p&gt;In 2022, Bubeck, Coester, and Rabani [BCR23] proved several bombshell lower bounds that completely reshaped the landscape.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Theorem (Bubeck–Coester–Rabani [BCR23]).&lt;/strong&gt;
The following lower bounds hold for the randomized $k$-server problem:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;There exist $(k+1)$-point metric spaces on which the randomized competitive ratio is $\Omega(\log^2 k)$.&lt;/li&gt;
  &lt;li&gt;For all $n$-point metric spaces with $n &amp;gt; k$, the randomized competitive ratio is at least $\Omega(\log k)$, and this is asymptotically tight.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The first bound kills the randomized $k$-server conjecture! On certain metrics, no randomized algorithm can do better than $\Omega(\log^2 k)$, whereas the conjecture predicted $O(\log k)$ everywhere. The second bound is also significant, as it improves the previous universal bound of $\Omega(\log k / \log\log k)$ (due to BBM [BBM06] and BLMN [BLMN05]) to a tight $\Omega(\log k)$ on all metrics, matching the paging lower bound.&lt;/p&gt;

&lt;h3 id=&quot;how-to-build-a-hard-metric&quot;&gt;How to Build a Hard Metric&lt;/h3&gt;

&lt;p&gt;The construction that achieves the $\Omega(\log^2 k)$ lower bound is recursive and deeply clever. We will describe the high-level idea without attempting to reproduce the full proof.&lt;/p&gt;

&lt;p&gt;Bubeck, Coester, and Rabani construct a sequence of metric spaces $\mathcal{M}_0, \mathcal{M}_1, \mathcal{M}_2, \ldots$ of growing size, parameterized by a sequence of natural numbers $m_0 \leq m_1 \leq m_2 \leq \cdots$. Each metric is defined as the shortest-path metric of an underlying graph. The base case $\mathcal{M}_0$ is simply a single edge of weight $1$. The metric $\mathcal{M}_1$ is a cycle of $6m_0$ copies of $\mathcal{M}_0$, which is a cycle with $6m_0$ edges. Two antipodal vertices $s$ and $t$ are designated as “special,” with $\text{diam}(\mathcal{M}_1) = d_1(s, t)$.&lt;/p&gt;

&lt;p&gt;More generally, $\mathcal{M}_{w+1}$ is built from $\mathcal{M}_w$ in the same way that $\mathcal{M}_1$ was built from $\mathcal{M}_0$: take a cycle of $6m_w$ edges, and replace each edge $\{u, v\}$ by a copy of $\mathcal{M}_w$ whose special vertices are identified with $u$ and $v$.&lt;/p&gt;

&lt;p&gt;The result is a “cycle of cycles” with a cycle of $6m_w$ copies of $\mathcal{M}_w$, glued together at their special vertices. The new special vertices $s$ and $t$ in $\mathcal{M}_{w+1}$ are chosen to be antipodal, so that $\text{diam}(\mathcal{M}_{w+1}) = d_{w+1}(s, t)$. Notice that $\mathcal{M}_{w+1}$ can be viewed as consisting of a left path of $3m_w$ copies of $\mathcal{M}_w$ and a right path of another $3m_w$ copies, forming the two halves of the cycle from $s$ to $t$.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/online-algorithms/page-22.jpeg&quot; alt=&quot;Figure 9: BCR recursive metric construction&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The key insight is that this “cycle of cycles” structure creates multiple scales at which the adversary can challenge the algorithm. On the uniform metric (paging), there is only one scale, and the best the adversary can do is force a $\log k$ factor. But on $\mathcal{M}_w$, the adversary can exploit the cycle structure at each level of the recursion independently.&lt;/p&gt;

&lt;p&gt;At the top level, the adversary forces the algorithm to commit its servers to one half of the cycle (say the left path of copies of $\mathcal{M}_{w-1}$), then issues requests on the other half. Within each copy of $\mathcal{M}_{w-1}$, the adversary recurses, exploiting the cycle structure at the next scale down.&lt;/p&gt;

&lt;p&gt;Since the algorithm must spread its mass across both halves of the cycle, the adversary can always find a half where the algorithm is underrepresented (take the road less travelled by, à la Robert Frost). With $d \sim \log k$ levels of recursion, the lower bound accumulates to $\Omega(\log^2 k)$.&lt;/p&gt;

&lt;h3 id=&quot;where-things-stand&quot;&gt;Where Things Stand&lt;/h3&gt;

&lt;p&gt;Let us summarize the current state of affairs for the randomized $k$-server problem. On HSTs, we have:&lt;/p&gt;

\[\Omega(\log k) \leq \text{randomized competitive ratio on HSTs} \leq O(\log^2 k).\]

&lt;p&gt;The upper bound is from BCLLM [BCL+18]. The lower bound of $\Omega(\log k)$ already follows from the paging lower bound, since the uniform metric is a (degenerate) $1$-HST. Closing the gap between $\log k$ and $\log^2 k$ on HSTs remains open.&lt;/p&gt;

&lt;p&gt;On general metric spaces, the situation is even less resolved. The best standing upper bound is the $O(\log^2 k \cdot \log n)$ obtained by combining BCLLM’s HST algorithm [BCL+18] with the $O(\log n)$-distortion embedding of FRT [FRT04], which still depends on $n$. BCLLM also give $O(\log^3 k \cdot \log \Delta)$ via a dynamic embedding, where $\Delta$ is the aspect ratio. Lee’s fusible HST approach [Lee18] would give $O(\log^6 k)$ independent of both $n$ and $\Delta$, but the proof remains incomplete. From below, BCR [BCR23] construct specific $(k+1)$-point metric spaces (not HSTs, but cycle-of-cycles graphs) on which the competitive ratio is $\Omega(\log^2 k)$, and they prove that on all metrics with more than $k$ points, the competitive ratio is $\Omega(\log k)$, improving the previous universal bound of $\Omega(\log k / \log\log k)$ due to BBM and BLMN, and matching the paging lower bound. Whether a competitive ratio depending only on $k$ is achievable on all metrics, let alone what the right polynomial in $\log k$ is, remains wide open.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/online-algorithms/page-23.jpeg&quot; alt=&quot;Figure 10: Timeline of randomized k-server results&quot; /&gt;&lt;/p&gt;

&lt;p&gt;It is worth pausing to appreciate the arc of this story. For over thirty years, the community believed that randomization should reduce the $k$-server competitive ratio from $\Theta(k)$ down to $O(\log k)$, matching paging. The intuition was that the uniform metric, where every point looks the same, should be the hardest case for randomized algorithms, since the adversary has the least structure to exploit. Bubeck, Coester, and Rabani showed that this intuition is exactly backwards, as metrics with more structure are harder, because the adversary can exploit each scale independently. And with Lee’s result still incomplete, even the basic question of whether an $n$-independent polylogarithmic competitive ratio is achievable on all metrics remains unresolved.&lt;/p&gt;

&lt;h2 id=&quot;the-k-taxi-problem-online-algorithms-and-further-questions&quot;&gt;The $k$-taxi Problem, Online Algorithms, and Further Questions&lt;/h2&gt;

&lt;p&gt;We began this paper with a 150-billion-dollar rideshare company. The $k$-server problem captures only half of Uber’s problem, since their drivers don’t just teleport to a passenger and vanish, but they pick the passenger up at a source and drive them to a destination. This motivates a natural generalization.&lt;/p&gt;

&lt;h3 id=&quot;the-k-taxi-problem&quot;&gt;The $k$-taxi Problem&lt;/h3&gt;

&lt;p&gt;The $k$-taxi problem was introduced by Fiat, Rabani, and Ravid [FRR90], building on a formulation of Karloff. We are given an $n$-point metric space $(M, d)$ and $k$ taxis (servers). Requests now arrive as &lt;em&gt;pairs&lt;/em&gt; $(s_q, t_q)$, where $s_q$ is a source (the pickup) and $t_q$ is a sink (the destination). To serve a request, the algorithm must move some taxi to $s_q$, then transport it to $t_q$, before the next request arrives.&lt;/p&gt;

&lt;p&gt;There are two versions of the problem depending on what we charge for. In the easy version, we include the cost of driving from $s_q$ to $t_q$ in the objective, and there is a straightforward constant-factor reduction to $k$-server. The more interesting hard version only charges for the &lt;em&gt;overhead&lt;/em&gt;, or the distance taxis travel while not serving a request. This is what Uber actually wants to minimize, and it is what we mean by $k$-taxi from here on.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/online-algorithms/page-24.png&quot; alt=&quot;Figure 11: k-server vs k-taxi comparison&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Notice that $k$-server is the special case where $s_q = t_q$ for every request, so that there is no “serving” phase and all movement is overhead. One might hope that $k$-taxi is only mildly harder than $k$-server. In the deterministic setting, this hope is badly wrong. Coester and Koutsoupias [CK19] showed that the deterministic competitive ratio for $k$-taxi is $\Omega(2^k)$, which is exponentially worse than the $\Theta(k)$ picture for $k$-server. Intuitively, the serving phase reshuffles the taxis in ways that the algorithm cannot control, and a clever adversary can exploit this to create exponentially many traps.&lt;/p&gt;

&lt;p&gt;The randomized setting is more forgiving. Prior to 2024, several randomized algorithms were known, but all had competitive ratios that were either exponential in $k$ or polynomial in $n$:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;$O(2^k \log n)$, due to Coester and Koutsoupias [CK19], based on a $(2^k - 1)$-competitive algorithm on HSTs.&lt;/li&gt;
  &lt;li&gt;$O((n \log k)^2 \log n)$, due to Bubeck, Buchbinder, Coester, and Sellke [BBCS21], via a reduction to metrical service systems under transformations of the metric space.&lt;/li&gt;
  &lt;li&gt;$2^{O(\sqrt{\log \Delta \cdot \log k})} \cdot \log_\Delta n$, due to Buchbinder, Coester, and Naor [BCN21], using ideas from the Double Coverage algorithm, where $\Delta$ is the aspect ratio (ratio between longest and shortest distance in the metric space) of the metric.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The best lower bound is $\Omega(\log^2 k)$, inherited from the $k$-server lower bound of Bubeck, Coester, and Rabani [BCR23]. None of the upper bounds above are polylogarithmic in all parameters simultaneously, so a large gap persisted.&lt;/p&gt;

&lt;p&gt;Gupta, Kumar, and Panigrahi [GKP24] resolved this at SODA 2024 by giving the first polylogarithmic competitive ratio for $k$-taxi.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Theorem (Gupta–Kumar–Panigrahi [GKP24]).&lt;/strong&gt;
There exists a randomized $O(\log^3 \Delta \cdot \log^2(nk\Delta))$-competitive algorithm for the $k$-taxi problem on any $n$-point metric space with aspect ratio $\Delta$.&lt;/p&gt;

&lt;p&gt;Their approach is a departure from the combinatorial techniques used by all previous $k$-taxi algorithms. They formulate a new covering LP relaxation for $k$-taxi on HSTs, derived from the min-cost flow formulation of the offline problem, and solve it with a hierarchical primal-dual algorithm that exploits the compositionality of the LP constraints across subtrees of the HST. The rounding step adapts existing techniques from the HST $k$-server literature [BBMN15, BCL+18].&lt;/p&gt;

&lt;p&gt;That the dependence on $\Delta$ remains is notable. For metric spaces with polynomially bounded aspect ratio, this gives a truly polylogarithmic guarantee. But removing the $\log \Delta$ dependence entirely, which would put $k$-taxi on equal footing with $k$-server (where $O(\log^2 k)$ is known on HSTs), remains an open and interesting challenge.&lt;/p&gt;

&lt;h3 id=&quot;the-weighted-k-server-problem&quot;&gt;The Weighted $k$-server Problem&lt;/h3&gt;

&lt;p&gt;Another natural generalization gives the servers different weights. In the &lt;em&gt;weighted $k$-server problem&lt;/em&gt;, each server $i$ has a weight $w_i &amp;gt; 0$, and the cost of moving server $i$ a distance $d$ is $w_i \cdot d$. This models settings where resources have different deployment costs, where you value some Ubers more than others.&lt;/p&gt;

&lt;p&gt;On general metrics, the weighted $k$-server problem is notoriously difficult, and even the uniform metric (where all pairwise distances are $1$) is hard. Gupta, Kumar, and Panigrahi [GKP23] studied this offline case at APPROX 2023 and proved a striking collection of results, which we summarize here. On the computational side, they showed that assuming the Unique Games Conjecture, no polynomial-time algorithm can achieve a sub-polynomial approximation factor for the offline weighted $k$-server problem on the uniform metric, even with $c$-resource augmentation for any $c &amp;lt; 2$. That’s a lot of words, but I’m already almost hitting 30 pages, so I’m not covering them all. Maybe CS254B.&lt;/p&gt;

&lt;p&gt;On the online side, Ayyadevara and Chiplunkar [AC21] showed that the randomized competitive ratio for weighted $k$-server is at least exponential in $k$, even on the uniform metric. Very recently, Bijoy, Mondal, and Chiplunkar [BMC26] gave a matching $\exp(O(k^2))$-competitive randomized upper bound on uniform metrics, resolving the doubly-vs-singly exponential gap. This is a dramatic contrast with the unweighted case, where $O(\log^2 k)$ is achievable on HSTs.&lt;/p&gt;

&lt;h3 id=&quot;learning-augmented-algorithms&quot;&gt;Learning-Augmented Algorithms&lt;/h3&gt;

&lt;p&gt;All of the results we have discussed live squarely in the worst-case framework. The adversary is omniscient (or at least oblivious), the algorithm knows nothing about the future, and the competitive ratio measures performance against a pathological input sequence that the algorithm will almost certainly never encounter in practice. Hopefully we are unlikely to see fractal-like metric spaces in the real world.&lt;/p&gt;

&lt;p&gt;This motivates a different question: what if the algorithm has access to (possibly imperfect) predictions about the future? The &lt;em&gt;learning-augmented&lt;/em&gt; or &lt;em&gt;algorithms with predictions&lt;/em&gt; framework, introduced by Lykouris and Vassilvitskii [LV21] and Purohit, Svitkina, and Kumar [KPS18], formalizes this idea. The algorithm receives a prediction (say, from a machine-learned model) alongside each request, and the goal is to design algorithms that are simultaneously near-optimal when the predictions are accurate, and no worse than the best classical online algorithm when the predictions are arbitrarily bad.&lt;/p&gt;

&lt;p&gt;Ideally, the competitive ratio degrades smoothly as a function of the prediction error $\eta$, interpolating between these two extremes.&lt;/p&gt;

&lt;p&gt;For paging, Lykouris and Vassilvitskii [LV21] showed how to modify the marking algorithm to incorporate predictions of the next arrival time for each page. Their algorithm achieves a competitive ratio that decreases with the prediction error and is always at most $O(\log k)$, matching the best unconditional bound. Rohatgi [Roh20] and Wei [Wei20] subsequently improved the error dependence. In particular, this means that a learning-augmented paging algorithm can &lt;em&gt;beat&lt;/em&gt; the $H_k$ lower bound when predictions are good, while never performing worse than the classical guarantee.&lt;/p&gt;

&lt;p&gt;For the $k$-server problem on the line, Lindermayr, Megow, and Simon [LMS25] gave a learning-augmented variant of the Double Coverage algorithm. Their algorithm integrates a user-defined confidence parameter that controls how much to trust the predictions: when the confidence is high and the predictions are accurate, the algorithm achieves $1$-consistency (i.e. optimal performance), while retaining $k$-robustness. Moreover, they showed that this consistency-robustness tradeoff is essentially optimal within a natural class of deterministic algorithms that respect the local and memoryless structure of DC.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/online-algorithms/page-26.png&quot; alt=&quot;Figure 12: Learning-augmented paradigm&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Antoniadis, Coester, Eliáš, Polak, and Simon [ACE+20] extended this paradigm to general metrical task systems, which as we have seen in the form of $k$-server. Their framework shows that any MTS algorithm can be augmented with predictions while preserving robustness, though the consistency guarantees depend on the structure of the specific problem. The same authors [ACE+23] later showed how to combine multiple predictors for MTS, achieving $O(\ell^2)$-competitiveness against the best dynamic combination of $\ell$ predictors.&lt;/p&gt;

&lt;p&gt;This line of work is growing rapidly. Mitzenmacher and Vassilvitskii [MV20] provide a survey of the broader landscape, and a comprehensive list of results is maintained at the &lt;a href=&quot;https://algorithms-with-predictions.github.io/&quot;&gt;Algorithms with Predictions website&lt;/a&gt;. Much remains to be done, particularly for the $k$-server and $k$-taxi problems on general metrics, where learning-augmented algorithms that are both practically efficient and theoretically well-understood are largely absent.&lt;/p&gt;

&lt;h3 id=&quot;open-problems&quot;&gt;Open Problems&lt;/h3&gt;

&lt;p&gt;We close by collecting some of the major open questions that emerge from this survey.&lt;/p&gt;

&lt;p&gt;The oldest and most famous is the &lt;em&gt;$k$-server conjecture&lt;/em&gt; itself: is there a deterministic $k$-competitive algorithm for every metric space? The work function algorithm gives $2k - 1$, and it is widely believed to actually be $k$-competitive, but proving this has resisted all efforts for thirty years. Even the special case of WFA on the Euclidean plane is open.&lt;/p&gt;

&lt;p&gt;On the randomized side, the central question left open by the disproof of the randomized conjecture is: &lt;em&gt;what is the correct competitive ratio on HSTs?&lt;/em&gt; We have $\Omega(\log k)$ from paging and $O(\log^2 k)$ from BCLLM [BCL+18]. Closing this gap is perhaps the single most important open problem in the area. A related question is whether a competitive ratio depending &lt;em&gt;only&lt;/em&gt; on $k$ (and not on the number of points $n$ or the aspect ratio $\Delta$) is achievable on all metric spaces. Lee’s fusible HST approach [Lee18] would give $O(\log^6 k)$, but the proof remains incomplete.&lt;/p&gt;

&lt;p&gt;For $k$-taxi, the gap is even wider, with $\Omega(\log^2 k)$ versus $O(\log^3 \Delta \cdot \log^2(nk\Delta))$. Removing the dependence on $\Delta$ and $n$, or proving that such dependence is necessary, would be a significant advance.&lt;/p&gt;

&lt;p&gt;For weighted $k$-server, the situation is arguably the most mysterious. The exponential lower bound on the randomized competitive ratio suggests that this problem is fundamentally harder than its unweighted cousin, but as far as I am aware, we do not have a clear understanding of why. Understanding the boundary between tractable and intractable server problems seems like a broad and important direction.&lt;/p&gt;

&lt;p&gt;Finally, the learning-augmented framework offers an interesting bridge between theory and practice, but the theory is still in its infancy for server problems beyond the line. Designing learning-augmented $k$-server algorithms for general metrics, with provable consistency-robustness tradeoffs, is wide open.&lt;/p&gt;

&lt;p&gt;We began with Uber and ended with fractal-like metric spaces that no rideshare company will ever encounter. The gap between the theory of online algorithms and the practice of dispatching cars in San Francisco remains vast. But the landscape has never been more interesting: the randomized conjecture, which guided the field for three decades, is false; the correct answer on HSTs is unknown; and the learning-augmented paradigm offers a way to make worst-case theory relevant to a world where predictions, however imperfect, are cheap and abundant.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/hB8A4B49B.png&quot; alt=&quot;Figure 13: I&apos;m tired of being online...&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;i’m tired of being online…&lt;/em&gt;&lt;/p&gt;

&lt;h2 id=&quot;references&quot;&gt;References&lt;/h2&gt;

&lt;p&gt;[AC21] Nikhil Ayyadevara and Ashish Chiplunkar. The randomized competitive ratio of weighted $k$-server is at least exponential. In &lt;em&gt;29th Annual European Symposium on Algorithms (ESA)&lt;/em&gt;, volume 204 of &lt;em&gt;LIPIcs&lt;/em&gt;, pages 9:1–9:11. Schloss Dagstuhl, 2021.&lt;/p&gt;

&lt;p&gt;[ACE+20] Antonios Antoniadis, Christian Coester, Marek Eliáš, Adam Polak, and Bertrand Simon. Online metric algorithms with untrusted predictions. In &lt;em&gt;Proceedings of the 37th International Conference on Machine Learning (ICML)&lt;/em&gt;, volume 119 of &lt;em&gt;Proceedings of Machine Learning Research&lt;/em&gt;, pages 345–355. PMLR, 2020.&lt;/p&gt;

&lt;p&gt;[ACE+23] Antonios Antoniadis, Christian Coester, Marek Eliáš, Adam Polak, and Bertrand Simon. Mixing predictions for online metric algorithms. In &lt;em&gt;Proceedings of the 40th International Conference on Machine Learning (ICML)&lt;/em&gt;, volume 202 of &lt;em&gt;Proceedings of Machine Learning Research&lt;/em&gt;, pages 969–983. PMLR, 2023.&lt;/p&gt;

&lt;p&gt;[Bar96] Yair Bartal. Probabilistic approximation of metric spaces and its algorithmic applications. In &lt;em&gt;Proceedings of the 37th Annual Symposium on Foundations of Computer Science (FOCS)&lt;/em&gt;, pages 184–193, 1996.&lt;/p&gt;

&lt;p&gt;[BBCS21] Sébastien Bubeck, Niv Buchbinder, Christian Coester, and Mark Sellke. Metrical service systems with transformations. In &lt;em&gt;Proceedings of the 12th Innovations in Theoretical Computer Science Conference (ITCS)&lt;/em&gt;, volume 185 of &lt;em&gt;LIPIcs&lt;/em&gt;, pages 49:1–49:20. Schloss Dagstuhl, 2021.&lt;/p&gt;

&lt;p&gt;[BBM06] Yair Bartal, Béla Bollobás, and Manor Mendel. Ramsey-type theorems for metric spaces with applications to online problems. &lt;em&gt;Journal of Computer and System Sciences&lt;/em&gt;, 72(5):890–921, 2006.&lt;/p&gt;

&lt;p&gt;[BBMN15] Nikhil Bansal, Niv Buchbinder, Aleksander Madry, and Joseph (Seffi) Naor. A polylogarithmic-competitive algorithm for the $k$-server problem. &lt;em&gt;Journal of the ACM&lt;/em&gt;, 62(5):40:1–40:49, 2015.&lt;/p&gt;

&lt;p&gt;[BCL+18] Sébastien Bubeck, Michael B. Cohen, Yin Tat Lee, James R. Lee, and Aleksander Madry. $k$-server via multiscale entropic regularization. In &lt;em&gt;Proceedings of the 50th Annual ACM Symposium on Theory of Computing (STOC)&lt;/em&gt;, pages 3–16, 2018.&lt;/p&gt;

&lt;p&gt;[BCN21] Niv Buchbinder, Christian Coester, and Joseph (Seffi) Naor. Online $k$-taxi via double coverage and time-reverse primal-dual. In &lt;em&gt;Integer Programming and Combinatorial Optimization (IPCO)&lt;/em&gt;, volume 12707 of &lt;em&gt;LNCS&lt;/em&gt;, pages 15–29. Springer, 2021.&lt;/p&gt;

&lt;p&gt;[BCR23] Sébastien Bubeck, Christian Coester, and Yuval Rabani. The randomized $k$-server conjecture is false! In &lt;em&gt;Proceedings of the 55th Annual ACM Symposium on Theory of Computing (STOC)&lt;/em&gt;, pages 581–594. ACM, 2023. Best Paper Award.&lt;/p&gt;

&lt;p&gt;[BK04] Yair Bartal and Elias Koutsoupias. On the competitive ratio of the work function algorithm for the $k$-server problem. &lt;em&gt;Theoretical Computer Science&lt;/em&gt;, 324(2–3):337–345, 2004. Preliminary version in STACS 2000.&lt;/p&gt;

&lt;p&gt;[BKRS92] Avrim Blum, Howard J. Karloff, Yuval Rabani, and Michael E. Saks. A decomposition theorem and bounds for randomized server problems. In &lt;em&gt;Proceedings of the 33rd Annual Symposium on Foundations of Computer Science (FOCS)&lt;/em&gt;, pages 197–207, 1992.&lt;/p&gt;

&lt;p&gt;[BLMN05] Yair Bartal, Nathan Linial, Manor Mendel, and Assaf Naor. On metric Ramsey-type phenomena. &lt;em&gt;Annals of Mathematics&lt;/em&gt;, 162(2):643–709, 2005.&lt;/p&gt;

&lt;p&gt;[BMC26] Adithya Bijoy, Ankit Mondal, and Ashish Chiplunkar. Weighted $k$-server admits an exponentially competitive. In &lt;em&gt;Proceedings of the 2026 Annual ACM-SIAM Symposium on Discrete Algorithms (SODA)&lt;/em&gt;, pages 4188–4208. SIAM, 2026.&lt;/p&gt;

&lt;p&gt;[Cha07] Shuchi Chawla. Lecture 22: $k$-server problem (continued); online learning. CS787: Advanced Algorithms, University of Wisconsin–Madison. Scribed by Mayank Maheshwari and Priyananda Shenoy, 2007. &lt;a href=&quot;https://pages.cs.wisc.edu/~shuchi/courses/787-F07/scribe-notes/lecture22.pdf&quot;&gt;https://pages.cs.wisc.edu/~shuchi/courses/787-F07/scribe-notes/lecture22.pdf&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;[CK19] Christian Coester and Elias Koutsoupias. The online $k$-taxi problem. In &lt;em&gt;Proceedings of the 51st Annual ACM Symposium on Theory of Computing (STOC)&lt;/em&gt;, pages 1136–1147. ACM, 2019.&lt;/p&gt;

&lt;p&gt;[CKPV91] Marek Chrobak, Howard Karloff, T. H. Payne, and Sundar Vishwanathan. New results on server problems. &lt;em&gt;SIAM Journal on Discrete Mathematics&lt;/em&gt;, 4(2):172–181, 1991.&lt;/p&gt;

&lt;p&gt;[CL91] Marek Chrobak and Lawrence L. Larmore. An optimal on-line algorithm for $k$-servers on trees. &lt;em&gt;SIAM J. Comput.&lt;/em&gt;, 20:144–148, 1991.&lt;/p&gt;

&lt;p&gt;[CL22] Christian Coester and James R. Lee. Pure entropic regularization for metrical task systems. &lt;em&gt;Theory of Computing&lt;/em&gt;, 18:Paper No. 23, 24 pp., 2022.&lt;/p&gt;

&lt;p&gt;[FKL+91] Amos Fiat, Richard M. Karp, Michael Luby, Lyle A. McGeoch, Daniel D. Sleator, and Neal E. Young. Competitive paging algorithms. &lt;em&gt;Journal of Algorithms&lt;/em&gt;, 12(4):685–699, 1991.&lt;/p&gt;

&lt;p&gt;[FRR90] Amos Fiat, Yuval Rabani, and Yiftach Ravid. Competitive $k$-server algorithms (extended abstract). In &lt;em&gt;Proceedings of the 31st Annual Symposium on Foundations of Computer Science (FOCS)&lt;/em&gt;, pages 454–463, 1990.&lt;/p&gt;

&lt;p&gt;[FRT04] Jittat Fakcharoenphol, Satish Rao, and Kunal Talwar. A tight bound on approximating arbitrary metrics by tree metrics. &lt;em&gt;Journal of Computer and System Sciences&lt;/em&gt;, 69(3):485–497, 2004.&lt;/p&gt;

&lt;p&gt;[GKP23] Anupam Gupta, Amit Kumar, and Debmalya Panigrahi. Efficient algorithms and hardness results for the weighted $k$-server problem. In &lt;em&gt;Approximation, Randomization, and Combinatorial Optimization. Algorithms and Techniques (APPROX/RANDOM)&lt;/em&gt;, volume 275 of &lt;em&gt;LIPIcs&lt;/em&gt;, pages 12:1–12:19. Schloss Dagstuhl, 2023.&lt;/p&gt;

&lt;p&gt;[GKP24] Anupam Gupta, Amit Kumar, and Debmalya Panigrahi. Poly-logarithmic competitiveness for the $k$-taxi problem. In &lt;em&gt;Proceedings of the 35th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA)&lt;/em&gt;, pages 4220–4246. SIAM, 2024.&lt;/p&gt;

&lt;p&gt;[KMRS88] Anna R. Karlin, Mark S. Manasse, Larry Rudolph, and Daniel Dominic Sleator. Competitive snoopy caching. &lt;em&gt;Algorithmica&lt;/em&gt;, 3(1):79–119, 1988.&lt;/p&gt;

&lt;p&gt;[Kou09] Elias Koutsoupias. The $k$-server problem. &lt;em&gt;Computer Science Review&lt;/em&gt;, 3(2):105–118, 2009.&lt;/p&gt;

&lt;p&gt;[KP95] Elias Koutsoupias and Christos H. Papadimitriou. On the $k$-server conjecture. &lt;em&gt;Journal of the ACM&lt;/em&gt;, 42(5):971–983, 1995.&lt;/p&gt;

&lt;p&gt;[KPS18] Ravi Kumar, Manish Purohit, and Zoya Svitkina. Improving online algorithms via ML predictions. In &lt;em&gt;Advances in Neural Information Processing Systems (NeurIPS)&lt;/em&gt;, volume 31, 2018.&lt;/p&gt;

&lt;p&gt;[Lee18] James R. Lee. Fusible HSTs and the randomized $k$-server conjecture. In &lt;em&gt;Proceedings of the 59th Annual Symposium on Foundations of Computer Science (FOCS)&lt;/em&gt;, pages 438–449, 2018. Main result retracted; see erratum at &lt;a href=&quot;https://homes.cs.washington.edu/~jrl/papers/kserver-erratum.html&quot;&gt;https://homes.cs.washington.edu/~jrl/papers/kserver-erratum.html&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;[LM23] Alexander Lindermayr and Nicole Megow. ALPS – algorithms with predictions. &lt;a href=&quot;https://algorithms-with-predictions.github.io/&quot;&gt;https://algorithms-with-predictions.github.io/&lt;/a&gt;, 2023. Comprehensive bibliography maintained online.&lt;/p&gt;

&lt;p&gt;[LMS25] Alexander Lindermayr, Nicole Megow, and Bertrand Simon. Boosting double coverage for $k$-server via imperfect predictions. &lt;em&gt;Algorithmica&lt;/em&gt;, 2025. Preliminary version at ITCS 2022.&lt;/p&gt;

&lt;p&gt;[LV21] Thodoris Lykouris and Sergei Vassilvitskii. Competitive caching with machine learned advice. &lt;em&gt;Journal of the ACM&lt;/em&gt;, 68(4):24:1–24:25, 2021.&lt;/p&gt;

&lt;p&gt;[MMS88] Mark S. Manasse, Lyle A. McGeoch, and Daniel Dominic Sleator. Competitive algorithms for on-line problems. In &lt;em&gt;Proceedings of the 20th Annual ACM Symposium on Theory of Computing (STOC)&lt;/em&gt;, pages 322–333, 1988.&lt;/p&gt;

&lt;p&gt;[MMS90] Mark S. Manasse, Lyle A. McGeoch, and Daniel Dominic Sleator. Competitive algorithms for server problems. &lt;em&gt;Journal of Algorithms&lt;/em&gt;, 11(2):208–230, 1990.&lt;/p&gt;

&lt;p&gt;[MS91] Lyle A. McGeoch and Daniel Dominic Sleator. A strongly competitive randomized paging algorithm. &lt;em&gt;Algorithmica&lt;/em&gt;, 6(6):816–825, 1991.&lt;/p&gt;

&lt;p&gt;[MV20] Michael Mitzenmacher and Sergei Vassilvitskii. Algorithms with predictions. In Tim Roughgarden, editor, &lt;em&gt;Beyond the Worst-Case Analysis of Algorithms&lt;/em&gt;, pages 646–662. Cambridge University Press, 2020.&lt;/p&gt;

&lt;p&gt;[Roh20] Dhruv Rohatgi. Near-optimal bounds for online caching with machine learned advice. In &lt;em&gt;Proceedings of the 31st Annual ACM-SIAM Symposium on Discrete Algorithms (SODA)&lt;/em&gt;, pages 1834–1845. SIAM, 2020.&lt;/p&gt;

&lt;p&gt;[ST85] Daniel Dominic Sleator and Robert Endre Tarjan. Amortized efficiency of list update and paging rules. &lt;em&gt;Communications of the ACM&lt;/em&gt;, 28(2):202–208, 1985.&lt;/p&gt;

&lt;p&gt;[Wei20] Alexander Wei. Better and simpler learning-augmented online caching. In &lt;em&gt;Approximation, Randomization, and Combinatorial Optimization. Algorithms and Techniques (APPROX/RANDOM)&lt;/em&gt;, volume 176 of &lt;em&gt;LIPIcs&lt;/em&gt;, pages 60:1–60:17. Schloss Dagstuhl, 2020.&lt;/p&gt;
</description>
        <pubDate>Wed, 25 Mar 2026 00:00:00 +0000</pubDate>
        <link>https://old.agniv.me/blog/online-algorithms/</link>
        <guid isPermaLink="true">https://old.agniv.me/blog/online-algorithms/</guid>
        
        <category>math</category>
        
        <category>algorithms</category>
        
        
      </item>
    
      <item>
        <title>Writing an OS in Haskell</title>
        <description>&lt;p&gt;The code is &lt;a href=&quot;https://github.com/agniv-the-marker/haskell-os&quot;&gt;here&lt;/a&gt;. This was a solo class project. I wanted to see what happens when you take a language designed for functional programming and force it to talk to hardware registers.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/haskell-os/realos.png&quot; alt=&quot;HaskellOS architecture&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;what-is-this&quot;&gt;What Is This&lt;/h2&gt;

&lt;p&gt;HaskellOS is a bare-metal operating system for the Raspberry Pi Zero. It boots on real hardware, gives you a shell with 18 commands, reads files off an SD card, blinks LEDs, talks over wireless radio, runs green threads, garbage collects, and has an embedded Lisp interpreter.&lt;/p&gt;

&lt;p&gt;The codebase is about 4,900 lines of Haskell, 1,350 lines of C, and 310 lines of ARM assembly. The Haskell handles all the logic, the C does the byte-level grunt work, and the assembly boots the thing.&lt;/p&gt;

&lt;h2 id=&quot;why-haskell&quot;&gt;Why Haskell&lt;/h2&gt;

&lt;p&gt;The honest answer is that I wanted to see if it was possible. The slightly more considered answer is that operating systems are full of state machines, mode switches, and “if this flag is set and that register has this value and we’re in this mode then do X.” Pattern matching is genuinely great for this, since the compiler checks you handled every case. No forgotten edge cases, no fall-through bugs.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/haskell-os/haskellmeme.png&quot; alt=&quot;C vs Haskell data types&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The type system also prevents real hardware mistakes at compile time. Output pins and input pins are different types. You literally cannot call a read function on an output pin. In C, you’d need to remember not to. In Haskell, the compiler remembers for you.&lt;/p&gt;

&lt;h2 id=&quot;the-trick-microhs&quot;&gt;The Trick: MicroHS&lt;/h2&gt;

&lt;p&gt;You can’t use GHC for bare-metal development. GHC’s runtime depends on &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mmap&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pthreads&lt;/code&gt;, signals, and a whole pile of Linux/POSIX infrastructure that doesn’t exist when you’re the only thing running on the CPU.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/haskell-os/slides.png&quot; alt=&quot;MicroHS motivation&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Instead, I used &lt;a href=&quot;https://github.com/augustss/MicroHs&quot;&gt;MicroHS&lt;/a&gt;, a minimal Haskell compiler by Lennart Augustsson that compiles Haskell to SKI-style combinators. The runtime is tiny. The output is a graph reducer, not native code, so the C runtime just needs to set up memory and kick off the combinator evaluator. No OS required underneath.&lt;/p&gt;

&lt;p&gt;The boot sequence looks like this:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;GPU loads the kernel image from SD card&lt;/li&gt;
  &lt;li&gt;ARM assembly sets up supervisor mode&lt;/li&gt;
  &lt;li&gt;C runtime zeros BSS, allocates the heap&lt;/li&gt;
  &lt;li&gt;MicroHS combinator reducer initializes&lt;/li&gt;
  &lt;li&gt;Haskell takes over&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/haskell-os/image.png&quot; alt=&quot;The feature domino effect&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;features&quot;&gt;Features&lt;/h2&gt;

&lt;h3 id=&quot;shell&quot;&gt;Shell&lt;/h3&gt;

&lt;p&gt;Everything runs over UART serial. The commands break into a few categories:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;File ops&lt;/strong&gt;: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ls&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cat&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;touch&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;write&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rm&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mv&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Hardware&lt;/strong&gt;: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;blink&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;gpio&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;timer&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;echo&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;System&lt;/strong&gt;: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;info&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;vm&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;heartbeat&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;uptime&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;reboot&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Radio&lt;/strong&gt;: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nrf init&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nrf send&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nrf recv&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nrf stats&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nrf status&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Scripting&lt;/strong&gt;: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;lisp&lt;/code&gt; (REPL) and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;lisp run &amp;lt;file&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Command dispatch is pattern matching on the command string, so adding a new command is just adding a new clause to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;dispatchCommand&lt;/code&gt;. Each handler parses its own arguments using the parser combinator library and calls into the relevant hardware module.&lt;/p&gt;

&lt;h3 id=&quot;fat32-filesystem&quot;&gt;FAT32 Filesystem&lt;/h3&gt;

&lt;p&gt;The OS reads and writes files on the SD card’s FAT32 partition. The core types mirror the on-disk structures:&lt;/p&gt;

&lt;div class=&quot;language-haskell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kr&quot;&gt;data&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;BPB&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;BPB&lt;/span&gt;             &lt;span class=&quot;c1&quot;&gt;-- BIOS Parameter Block&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;bpbBytesPerSec&lt;/span&gt;  &lt;span class=&quot;o&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Word16&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;bpbSecPerClus&lt;/span&gt;   &lt;span class=&quot;o&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Word8&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;bpbReservedSecs&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Word16&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;bpbNumFATs&lt;/span&gt;      &lt;span class=&quot;o&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Word8&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;bpbTotalSecs&lt;/span&gt;    &lt;span class=&quot;o&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Word32&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;bpbFATSize&lt;/span&gt;      &lt;span class=&quot;o&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Word32&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;bpbRootCluster&lt;/span&gt;  &lt;span class=&quot;o&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Word32&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;kr&quot;&gt;data&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;DirEntry&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;DirEntry&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;deName&lt;/span&gt;      &lt;span class=&quot;o&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;String&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;deCluster&lt;/span&gt;   &lt;span class=&quot;o&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Word32&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;deSize&lt;/span&gt;      &lt;span class=&quot;o&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Word32&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;deIsDir&lt;/span&gt;     &lt;span class=&quot;o&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Bool&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Mounting works in stages. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mountFS&lt;/code&gt; initializes the SD card, reads the MBR, parses the boot sector into a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;BPB&lt;/code&gt;, and calculates the LBA offsets for the FAT and cluster regions. File reads follow the FAT chain from a directory entry’s starting cluster. I also wrote a custom &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MaybeIO&lt;/code&gt; monad that threads &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Maybe&lt;/code&gt; through &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;IO&lt;/code&gt; so that any step in the chain (bad MBR signature, missing partition, corrupt FAT entry) short-circuits cleanly without nested case statements.&lt;/p&gt;

&lt;p&gt;The painful part was byte-level access. Haskell’s FFI only gives you 32-bit word operations. Reading a single byte means loading an aligned word and masking off the bits you want. One line in C becomes six in Haskell.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/haskell-os/memcpymeme.png&quot; alt=&quot;The memcpy situation&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;green-threads-and-processes&quot;&gt;Green Threads and Processes&lt;/h3&gt;

&lt;p&gt;MicroHS provides &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;forkIO&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MVar&lt;/code&gt;, and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;threadDelay&lt;/code&gt; out of the box. The scheduler runs round-robin with ~10ms preemption via ARM timer interrupts at 100Hz. Sleeping threads enter a time queue and consume zero CPU.&lt;/p&gt;

&lt;p&gt;On top of this I built a typed channel system for message passing between threads:&lt;/p&gt;

&lt;div class=&quot;language-haskell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kr&quot;&gt;data&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Chan&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Chan&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;chanRead&lt;/span&gt;  &lt;span class=&quot;o&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;MVar&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;MVar&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;ChItem&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;chanWrite&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;MVar&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;MVar&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;ChItem&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;newChan&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;IO&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;Chan&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;send&lt;/span&gt;    &lt;span class=&quot;o&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Chan&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;IO&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;recv&lt;/span&gt;    &lt;span class=&quot;o&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Chan&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;IO&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;        &lt;span class=&quot;c1&quot;&gt;-- blocks until data available&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;tryRecv&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Chan&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;IO&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;Maybe&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;-- non-blocking&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;select&lt;/span&gt;  &lt;span class=&quot;o&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;Chan&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;IO&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;-- wait on first available&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The channels are unbounded linked lists backed by MVars. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;send&lt;/code&gt; never blocks, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;recv&lt;/code&gt; blocks until data arrives, and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;select&lt;/code&gt; polls multiple channels round-robin (useful when a thread needs to listen to several sources).&lt;/p&gt;

&lt;p&gt;There’s also an Erlang-style supervisor that monitors child processes and restarts them according to a policy:&lt;/p&gt;

&lt;div class=&quot;language-haskell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kr&quot;&gt;data&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;RestartPolicy&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Permanent&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Temporary&lt;/span&gt;

&lt;span class=&quot;kr&quot;&gt;data&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;ChildSpec&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;ChildSpec&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;csName&lt;/span&gt;   &lt;span class=&quot;o&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;String&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;csAction&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;IO&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;()&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;csPolicy&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;RestartPolicy&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;supervisor&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;ChildSpec&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;IO&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;A &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Permanent&lt;/code&gt; child gets restarted whenever it exits. A &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Temporary&lt;/code&gt; child runs once. The supervisor checks every 100ms. Without &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;try&lt;/code&gt;/&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;catch&lt;/code&gt; in MicroHS, crash detection is limited (the thread just silently dies and stays in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Running&lt;/code&gt; state forever), but clean exits work fine.&lt;/p&gt;

&lt;h3 id=&quot;virtual-memory&quot;&gt;Virtual Memory&lt;/h3&gt;

&lt;p&gt;Page table entries are algebraic data types. The full &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PageTableEntry&lt;/code&gt; encodes an ARMv6 1MB section descriptor:&lt;/p&gt;

&lt;div class=&quot;language-haskell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kr&quot;&gt;data&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;PageTableEntry&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;PTE&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ptePA&lt;/span&gt;      &lt;span class=&quot;o&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Word32&lt;/span&gt;       &lt;span class=&quot;c1&quot;&gt;-- physical address (1MB-aligned)&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pteAP&lt;/span&gt;      &lt;span class=&quot;o&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;AccessPerm&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pteDomain&lt;/span&gt;  &lt;span class=&quot;o&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Word8&lt;/span&gt;        &lt;span class=&quot;c1&quot;&gt;-- domain 0-15&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pteCache&lt;/span&gt;   &lt;span class=&quot;o&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;CachePolicy&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pteExecute&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Bool&lt;/span&gt;         &lt;span class=&quot;c1&quot;&gt;-- Execute Never flag&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;kr&quot;&gt;data&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;AccessPerm&lt;/span&gt;  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;APNoAccess&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;APPrivOnly&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;APUserRO&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;APFullAccess&lt;/span&gt;
&lt;span class=&quot;kr&quot;&gt;data&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;CachePolicy&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Uncached&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;WriteThrough&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;WriteBack&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Invalid memory configurations are literally unrepresentable. You can’t accidentally map a page with nonsense permissions because the type doesn’t have a constructor for that.&lt;/p&gt;

&lt;p&gt;Memory regions are defined declaratively and mapped during boot:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Region&lt;/th&gt;
      &lt;th&gt;Address&lt;/th&gt;
      &lt;th&gt;Size&lt;/th&gt;
      &lt;th&gt;Permissions&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Kernel code&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0x00000000&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;1 MB&lt;/td&gt;
      &lt;td&gt;Privileged, cached&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Kernel heap&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0x00100000&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;128 MB&lt;/td&gt;
      &lt;td&gt;Privileged, cached&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Device registers&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0x20000000&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;16 MB&lt;/td&gt;
      &lt;td&gt;Privileged, uncached&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;MicroHS heap&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0x0A000000&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;configurable&lt;/td&gt;
      &lt;td&gt;Privileged, cached&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;initMMU&lt;/code&gt; creates the page table, maps all regions, sets domain 0 to client mode, and flips the MMU on permanently.&lt;/p&gt;

&lt;h3 id=&quot;wireless-networking&quot;&gt;Wireless Networking&lt;/h3&gt;

&lt;p&gt;Two NRF24L01+ radio modules connected over SPI give the Pi wireless communication at 2.4GHz. The driver is configured through a record type:&lt;/p&gt;

&lt;div class=&quot;language-haskell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kr&quot;&gt;data&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;NrfConfig&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;NrfConfig&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;nrfChannel&lt;/span&gt;     &lt;span class=&quot;o&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Word8&lt;/span&gt;    &lt;span class=&quot;c1&quot;&gt;-- 0-125&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;nrfPayloadSize&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Word8&lt;/span&gt;    &lt;span class=&quot;c1&quot;&gt;-- 1-32 bytes&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;nrfDataRate&lt;/span&gt;    &lt;span class=&quot;o&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;DataRate&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;-- 250Kbps / 1Mbps / 2Mbps&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;nrfPower&lt;/span&gt;       &lt;span class=&quot;o&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;PowerLevel&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;nrfSpiCS&lt;/span&gt;       &lt;span class=&quot;o&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Word8&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;nrfCEPin&lt;/span&gt;       &lt;span class=&quot;o&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Word8&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Transmission uses hardware acknowledgment with exponential backoff retry. When the radio reports MAX_RT (max retransmissions exceeded), the driver waits $500 \cdot 2^{\text{attempt}} + \text{random_us}$ microseconds before trying again, up to 7 attempts. After that, the packet is counted as lost. The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;NrfHandle&lt;/code&gt; uses an &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MVar&lt;/code&gt; for state coordination and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;IORef&lt;/code&gt;s for statistics tracking (messages sent, received, retransmitted, lost).&lt;/p&gt;

&lt;p&gt;The interesting part is the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;NetChan&lt;/code&gt; bridge. It serializes typed Haskell values through a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Msg&lt;/code&gt; algebraic data type for wireless transmission, so on the receiving end you can pattern match on radio data just like any other Haskell value. This lets you build distributed systems across multiple Pis where the type system spans the radio link.&lt;/p&gt;

&lt;h3 id=&quot;lisp-interpreter&quot;&gt;Lisp Interpreter&lt;/h3&gt;

&lt;p&gt;The parser combinator library implements four typeclass instances (Functor, Applicative, Monad, Alternative) which lets you compose parsers readably:&lt;/p&gt;

&lt;div class=&quot;language-haskell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;parseExpr&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;parseNumber&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;|&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;parseBool&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;|&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;parseString&lt;/span&gt;
        &lt;span class=&quot;o&quot;&gt;&amp;lt;|&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;parseQuote&lt;/span&gt;  &lt;span class=&quot;o&quot;&gt;&amp;lt;|&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;parseList&lt;/span&gt;  &lt;span class=&quot;o&quot;&gt;&amp;lt;|&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;parseAtom&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;lt;|&amp;gt;&lt;/code&gt; operator tries each parser in order and backtracks on failure. The Lisp itself is a simple eval/apply interpreter over S-expressions, with the standard primitives (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;car&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cdr&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cons&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;define&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;lambda&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;if&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;quote&lt;/code&gt;, arithmetic).&lt;/p&gt;

&lt;p&gt;The fun part is the hardware FFI. The Lisp environment binds OS functions so you can do things like blink an LED or read a timer directly from the REPL. Running Lisp inside Haskell inside a combinator reducer on bare-metal ARM hardware is a sentence I never expected to write.&lt;/p&gt;

&lt;h2 id=&quot;the-hard-parts&quot;&gt;The Hard Parts&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/haskell-os/haskellmeme1.png&quot; alt=&quot;Haskell is simple&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GC corruption.&lt;/strong&gt; MicroHS’s garbage collector didn’t check for NULL pointers. On Linux, address &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0x0&lt;/code&gt; is unmapped, so dereferencing it crashes immediately and you notice. On bare metal, address &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0x0&lt;/code&gt; is the ARM exception vector table, which contains perfectly valid-looking bytes. The GC would interpret vector table entries as heap node pointers, follow them into nonsense memory, and silently corrupt the heap. The fix was adding boundary checks to keep the GC inside the actual heap region.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SD card initialization.&lt;/strong&gt; The GPU had already initialized the EMMC controller before my kernel ran, leaving it in an unknown state with stale interrupt flags. Getting reliable SD card access meant clearing old state, retrying initialization with delays, etc.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Off-by-one in memory maps.&lt;/strong&gt; The EMMC controller lives at &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0x20300000&lt;/code&gt;. My peripheral region was mapped to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0x20000000&lt;/code&gt;-&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0x202FFFFF&lt;/code&gt;, and debugging this was so ghhg.&lt;/p&gt;

&lt;h2 id=&quot;thoughts&quot;&gt;Thoughts&lt;/h2&gt;

&lt;p&gt;Haskell is genuinely good for and fun to write the the logic layer of an OS. It is nice to move every possible runtime error into compile time.&lt;/p&gt;

&lt;p&gt;But it fights you on anything byte-level. Packing and unpacking structures, copying memory regions, bit-twiddling registers are all things C was born to do and Haskell was born to abstract away. The FFI bridge works, but it was my first time using it, so it felt awkward.&lt;/p&gt;

&lt;p&gt;Logic belongs in Haskell, raw bytes in C, with FFI as the bridge. The kernel compiles to about 300KB.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/haskell-os/haskellmeme2.png&quot; alt=&quot;Hello world in Haskell&quot; /&gt;&lt;/p&gt;
</description>
        <pubDate>Wed, 25 Mar 2026 00:00:00 +0000</pubDate>
        <link>https://old.agniv.me/blog/haskell-os/</link>
        <guid isPermaLink="true">https://old.agniv.me/blog/haskell-os/</guid>
        
        <category>computer-science</category>
        
        <category>haskell</category>
        
        
      </item>
    
      <item>
        <title>the worst seven months of my life</title>
        <description>&lt;p&gt;The short and sweet of this is that I tried to apply a cool method (the entropy method) to a problem (chvatals conjecture) that it could never work on. Specifically, Chvatal’s conjecture is a local statement (there exists a maximal star), but my early formulations of the entropy method gave global gaurentees over all maximal intersecting families.&lt;/p&gt;

&lt;p&gt;However, I realized much of my approach needed to be fixed…&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/soover.png&quot; alt=&quot;its over&quot; /&gt;&lt;/p&gt;

&lt;p&gt;There are ~3 issues. Starting in reverse order of severity, I have a function that I was unable to formally show was decreasing.&lt;/p&gt;

&lt;p&gt;UPDATE: MY PROFESSOR (&lt;a href=&quot;https://sites.google.com/site/marywootters&quot;&gt;Prof. Mary Wooters&lt;/a&gt;) FOUND THAT FOR SUFFICIENTLY LARGE $s, u$, THIS FUNCTION IS ACTUALLY INCREASING NEAR THE END OF THE INTERVAL:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/ohwhatthefuck.png&quot; alt=&quot;oh shoot&quot; /&gt;&lt;/p&gt;

&lt;p&gt;THIS WAS COMPUTED USING PYTHON AND DECIMALS DUE TO ACCURACY CONCERNS WITH THE BINARY ENTROPY FUNCTION, BUT IT SEEMS TO BE INCREASING.&lt;/p&gt;

&lt;p&gt;FOR CLARITY HERE IS THE ORIGINAL PROBLEM: Specifically, let $s \in (0,1),$ let $r=\frac{1-\sqrt{s^2-s+1}}{s} &amp;lt;0.5$. Fix $u\in (r, 1/2).$ Write $T_1(v) = v + sv - sv^2$ and $T_2(v) = v + s - sv$. We define $\Psi(v) = \frac{(1-u)\,H(T_1(v)) + (u-v)\,H(T_2(v))}{(1-v)\,H(v)}$ where $H$ is the binary entropy function and $v \in (r, u].$ The goal is to prove that this function is decreasing on the interval.&lt;/p&gt;

&lt;p&gt;I BELIEVE THIS IS FIXABLE SINCE $u$ IS UP TO US, SO SOLVING FOR $u$ SUCH THAT THE FUNCTION IS ONE AND THEN CHOOSING THE SMALLER SO THE FUNCTION STAYS DECREASING WOULD STILL ALLOW THIS TO WORK, BUT THE OTHER ISSUES IN THE PAPER ARE STILL LOOMING.&lt;/p&gt;

&lt;p&gt;The second issue has to do with the formulation of $s$-uniformity. I believe this condition to be so strong and so limiting that the only possible downsets that admit $s&amp;gt;0$ must have generators that already heavily overlap. Say that we have the generators $1, 2, 3$ and $3,4,5.$ This has 0 uniformity because seeing the presence of $2, 4$ in the first and second set respectively force the conditional probability to go to $0.$&lt;/p&gt;

&lt;p&gt;Finally, the biggest issue has to do with my thinning argument. To apply the original Gilmer method, you need the induction to hold all the way through, which is why I have an adaptive way of combining the randomly sampled sets. However, the probabilities $p_i, q_i,$ are dependent on conditioning if our sets could be within a generator or not, so we don’t actually have a way of combining our algebra together.&lt;/p&gt;

&lt;p&gt;I spent maybe in total a few weeks of deep focus on this paper on and off for the course of 7 months, which makes it deeply embarrassing how much I failed to understand probability. I imagine that much of this was simply getting used to the analysis that Sawin was doing, and I did appreciate learning more about the analytical combinatorics.&lt;/p&gt;

&lt;p&gt;In this sense, I have tried out something new and learned. So I have not yet wasted my time.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/assets/pdfs/chvátal.pdf&quot;&gt;You can look at the PDF here.&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;The most important questions of life are indeed, for the most part, really only problems of probability.
Probability theory is nothing but common sense reduced to calculation.&lt;/p&gt;

  &lt;p&gt;Laplace, Pierre Simon. Théorie Analytique des Probabilités, 1812, &lt;a href=&quot;https://www.stat.berkeley.edu/~jpopen/probweb/quotes.html&quot;&gt;berkeley quotes&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
</description>
        <pubDate>Wed, 04 Mar 2026 00:00:00 +0000</pubDate>
        <link>https://old.agniv.me/blog/the-worst-seven-months/</link>
        <guid isPermaLink="true">https://old.agniv.me/blog/the-worst-seven-months/</guid>
        
        <category>math</category>
        
        
      </item>
    
      <item>
        <title>Grobner Bases Explainer</title>
        <description>&lt;p&gt;Alternatively: I showed Prof. Brian Conrad something new (the Koiran result), though he later made fun of the fact that I forgot how to read a clock on the spot (I was checking for my timer on my phone, but instead looked at the clock and forgot when I had started).&lt;/p&gt;

&lt;p&gt;I now think that reading Fulton is probably not the best way to “learn algebraic geometry,” most notably because he avoids talking about sheaves for the longest time. You should read some text in Commutative Algebra, and then either the Rising Sea or Hartshorne, where read is the same as “do the problems in.”&lt;/p&gt;

&lt;h2 id=&quot;abstract&quot;&gt;Abstract&lt;/h2&gt;

&lt;p&gt;Algebraic Geometry can be thought of as bridging together polynomial equations over general fields to an geometric space that describes the set of solutions of those polynomials. The question is then how one might computationally attack these problems. This caused the birth of the field of computational algebraic geometry in 1979. The main object of interest at the time was that of a Gröbner Basis. This work will go into describing what this is and hopefully how it is utilized.&lt;/p&gt;

&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;/h2&gt;

&lt;p&gt;We let $k$ be a field. This expository paper will use Schenck [Schenck2003], Lauritzen [Lauritzen2003], and Abramson [Abramson2009] as my main resources, as they are meant to be helpful introductions to the subject.&lt;/p&gt;

&lt;h2 id=&quot;motivation-and-history&quot;&gt;Motivation and History&lt;/h2&gt;

&lt;p&gt;The formal derivation of a Gröbner basis was developed in Bruno Buchberger’s 1965 Ph.D. thesis. Gröbner was his advisor, and the thesis problem was to find “a basis of the residue class ring of a zero-dimensional polynomial ideal”. For clarity, a zero-dimensional polynomial ideal $I \in k[X_1, \ldots, X_n]$ simply means that the quotient $k[X_1, \ldots, X_n]/I$ is finitely generated, and thus the question is simply “how do we find good basis elements of this quotient ring?” Note that an equivalent kind of question that is a direct result of Hilbert’s Basis Theorem is “how do we find good generating elements of $I$”? This question matters almost immediately to check if an arbitrary polynomial is present within the ideal $I$! So the question we have to deal with here first is what is “good” and then derive an algorithm.&lt;/p&gt;

&lt;p&gt;While Buchberger apparently invented and named this object, he attributed to Gröbner as he had developed these methods over the course of “about 17 years,” applying them mostly to problems such as finding bases of integrals of differential equations. However, as he was doing this work in the 1930s, the notion of a computational problem was not yet well-founded, and so Buchberger had the task of formalizing “goodness” and asserting termination/correctness of the respective algorithm.&lt;/p&gt;

&lt;p&gt;To understand why this is a hard question, one doesn’t really have to look any further than Gaussian Elimination. If we are only dealing with linear polynomials in our ideal $I$, we can immediately apply the Gaussian Elimination algorithm to get our free variables, which admit a basis of the quotient ring immediately. If we have some equalities left over, we can use the Euclidean Algorithm on these (as a polynomial ring over a field is a Euclidean domain) to further simplify.&lt;/p&gt;

&lt;p&gt;In some sense, you can also do this if you have higher-degree polynomials, but as you might have many more auxiliary variables than equations, you may not be able to simplify the problem at all.&lt;/p&gt;

&lt;p&gt;To attack this problem, Buchberger had to invent the formal notion of an $S$-polynomial. We will get there soon.&lt;/p&gt;

&lt;h2 id=&quot;basic-definitions&quot;&gt;Basic Definitions&lt;/h2&gt;

&lt;p&gt;First, let us attack the moral question of what makes a “good” polynomial. First, let us live in $k[X]$. If we are given an ideal with some set of generators, we want to find “better” generators. Note that $k[X]$ is a principal ideal domain, so in some sense this is the easiest possible problem we could handle.&lt;/p&gt;

&lt;p&gt;Oftentimes, when we write down a polynomial, we write it down in order of “the most impactful terms,” i.e. the ones with largest degree are first and we end with the constant term. So, when we are asked to solve problems of this type, we solve it via the Euclidean Algorithm, which allows us to efficiently compute the GCD of polynomials in our generating set.&lt;/p&gt;

&lt;p&gt;The standard argument for this algorithm is based upon invariants, in this specific case being the degree of the polynomials, and decreasing it at every step. So, we’d like to bring this over to the multivariate case in $k[X_1, \ldots, X_n]$.&lt;/p&gt;

&lt;p&gt;First, we need to have some notion of term order that is similar to the ordering of degrees. To this end, we have some definitions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Definition.&lt;/strong&gt; Letting $\alpha = (\alpha_1, \ldots, \alpha_n) \in \mathbb{N}^n$, we write \(x^{\alpha} := X_1^{\alpha_1}\cdots X_n^{\alpha_n}.\) We call elements of this type &lt;em&gt;terms&lt;/em&gt;, which are monomials with coefficient one. We write $\mid\alpha\mid = \sum_i \alpha_i$ as the degree of the term.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Definition.&lt;/strong&gt; A monomial/term order $&amp;gt;$ is a total order on the terms of $k[X_1, \ldots, X_n]$, equivalently a total order on $\mathbb{N}^n$, which satisfies the following properties:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;For any $\gamma$, if $\alpha &amp;gt; \beta$, then $\alpha + \gamma &amp;gt; \beta + \gamma$.&lt;/li&gt;
  &lt;li&gt;Any nonempty subset of terms has a smallest element, i.e. $&amp;gt;$ admits a well-ordering.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Note that a total order is the same as a linear order, and that the second property forces it to have similar properties to the natural ordering on $\mathbb{N}$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Definition.&lt;/strong&gt; We define the &lt;em&gt;initial monomial&lt;/em&gt;, denoted by $\mathrm{in}(f)$, as the largest monomial that appears in $f$ under a fixed term ordering $&amp;lt;$. As $f$ is an element of a polynomial ring over a field, we can always force the coefficient of $\mathrm{in}(f)$ to be $1$, which forces which representative of $f$ we use.&lt;/p&gt;

&lt;p&gt;Clearly, we have been using these all our lives. We have the lexicographic ordering, where we say $\alpha &amp;gt; \beta$ if the leftmost nonzero entry of $\alpha - \beta$ is positive, which immediately admits this property. This is the normal degree ordering in $k[X]$. However, in the multivariate case such as $k[X, Y, Z]$ we would then have $X &amp;gt; Y^{10000} &amp;gt; Z$, and it is much nicer to operate over some of these than the others.&lt;/p&gt;

&lt;p&gt;So, we instead “grade” the term by the degree first. More normally, we use the Graded Lexicographic ordering, where $\alpha &amp;gt; \beta$ if $\mid\alpha\mid &amp;gt; \mid\beta\mid$ or $\mid\alpha\mid = \mid\beta\mid$ and the leftmost nonzero entry of $\alpha - \beta$ is positive. This gives us the notion of $Y^{10000} &amp;gt; X &amp;gt; Z$, which is much nicer in the multivariate case.&lt;/p&gt;

&lt;p&gt;So, assume we have some monomial order on $k[X_1, \ldots, X_n]$ denoted by $&amp;lt;$. Say $f, f_1, \ldots, f_m \in k[X_1, \ldots, X_n]$, and we want to see if $f \in (f_1, \ldots, f_m)$. In the spirit of the Euclidean Algorithm, we run the following algorithm:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Algorithm 1&lt;/strong&gt; (Simple Division Algorithm)&lt;/p&gt;

&lt;p&gt;Let $\mathrm{div}, \mathrm{rem} := 0, 0$.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;If $f = 0$ then we are done. Otherwise,&lt;/li&gt;
  &lt;li&gt;If $\mathrm{in}(f_i) \cdot a_i = \mathrm{in} (f)$ for some $a_i \in k[X_1, \ldots, X_n]$, then add $a_if_i$ to $\mathrm{div}$, and subtract $a_if_i$ from $f$. Note that the initial term is decreasing.&lt;/li&gt;
  &lt;li&gt;If there is no $a_i$ that works, add $\mathrm{in}(f)$ to the remainder, and subtract $\mathrm{in}(f)$ from $f$.&lt;/li&gt;
  &lt;li&gt;Repeat this process.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This terminates as at each step, the initial term of $f$ decreases, and by the well-ordering property, this process cannot go on indefinitely. Letting $a_i$ be the total sum of each partial $a_i$ witnessed during this algorithm and $r$ as the remainder term, we can then write $f = \sum_i a_if_i + r$. Can we then faithfully say that if $r = 0$, then $f \in (f_1, \ldots, f_m)$?&lt;/p&gt;

&lt;p&gt;No! This clearly doesn’t work! First of all, it is sensitive to the ordering of the $f_i$’s, but it is also sensitive to the ordering that we choose! Say we want to check if $x \in (x^{100}, x^{100}+x)$. Using the graded lexicographic ordering… it immediately fails. But this failure shows us that we have to focus on the basis’s generating elements, and more specifically that we want the ability to cancel out initial terms whenever possible. We can now look at the notion of a Gröbner basis.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Definition.&lt;/strong&gt; A subset ${g_1, \ldots, g_k}$ of an ideal $I$ is called &lt;em&gt;Gröbner&lt;/em&gt; for $I$ if the ideal generated by initial monomials of elements of $I$, which we denote as $\mathrm{in}(I)$, is also generated by $(\mathrm{in}(g_1), \ldots, \mathrm{in}(g_k))$. Note that $k$ might be larger than our given set of generating polynomials!&lt;/p&gt;

&lt;p&gt;I’ll skip over the proof that it exists as the proof of termination of an algorithm computing it is sufficient.&lt;/p&gt;

&lt;p&gt;However, for this to be useful, we do need to guarantee that a Gröbner subset is also a basis!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lemma.&lt;/strong&gt; A Gröbner subset of $I$ is also a basis of $I$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; Let ${g_1, \ldots, g_k}$ be a Gröbner subset of ideal $I$. We run Algorithm 1 on $f \in I$ to get $f = \sum_i a_i g_i + r$. We want to show that $r = 0$. Assume that it is not. Then note $r \in I$. Note then that $\mathrm{in}(r) \in \mathrm{in}(I)$. However, as $(\mathrm{in}(g_1), \ldots, \mathrm{in}(g_k))$ generates $\mathrm{in}(I)$, so $\mathrm{in}(r)$ is a multiple of some $\mathrm{in}(g_j)$. However, note that within the algorithm, each monomial within the remainder term must not have been divisible by some initial element. Thus we have a contradiction, so $r = 0$. Note the other inclusion direction is immediate as a Gröbner subset is a subset of $I$. $\square$&lt;/p&gt;

&lt;p&gt;So, how does Algorithm 1 change when we use a Gröbner basis? Well, it actually works!&lt;/p&gt;

&lt;p&gt;So… how do we compute it? What was Buchberger’s insight? Well, we want some kind of way of getting rid of those nasty leading terms…&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Definition.&lt;/strong&gt; We define the syzygy pair, or $S$-pair/$S$-polynomial of monic polynomials $f, g$ as&lt;/p&gt;

\[S(f, g) := \frac{\mathrm{lcm}(\mathrm{in}(f), \mathrm{in}(g))}{\mathrm{in}(f)}\cdot f - \frac{\mathrm{lcm}(\mathrm{in}(f), \mathrm{in}(g))}{\mathrm{in}(g)} \cdot g.\]

&lt;p&gt;Note that $\mathrm{lcm}$ on a term takes the maximum of each exponent.&lt;/p&gt;

&lt;p&gt;Note that if $f, g$ are in an ideal, then their $S$-polynomial must also necessarily be. Also note that this polynomial attempts to cancel out leading terms, as it minimally raises both $f, g$ to a common leading term and gets rid of it by monotonicity.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Theorem&lt;/strong&gt; (Buchberger’s Criterion). Let $G = {g_1, \ldots, g_k}$ be a basis of some ideal $I$. Then $G$ is a Gröbner basis iff $S(g_i, g_j)$ has remainder $0$ after running Algorithm 1 using $G$, for all pairs $g_i, g_j \in G$.&lt;/p&gt;

&lt;p&gt;We sketch this out by allowing ourselves a hidden lemma.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lemma.&lt;/strong&gt; Suppose we have a finite sum $\sum_i p_i$ where the initial term for each $p_i$ is $\alpha \in \mathbb{N}^n$ but the sum has initial term strictly less than $\alpha$, i.e. we have cancellation. Then we have that $\sum_i p_i$ can be expressed as a $k$-linear combination of the $S$-polynomials $S(p_j, p_l)$.&lt;/p&gt;

&lt;p&gt;Note that each $S$-polynomial has initial term strictly less than $\delta$, which tells us that we can pass our sums downward until we do not have a cancellation of initial terms. We can now outline the proof sketch of Buchberger’s Criterion.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; Let $f \in I$ and let $G = {g_1, \ldots g_k} \subset I$ such that $G$ is a basis and all $S$-pairs of $g_i, g_j$ are in $(G)$. We want to show that $G$ is Gröbner, which means that we want to show that $\mathrm{in}(f) \in (\mathrm{in}(g_1), \ldots, \mathrm{in}(g_k))$. As $G$ is basis, we can write $f = \sum_i a_ig_i$. Then we can have two cases. First we might have $\mathrm{in}(f)$ is the same initial monomial of one of the $a_ig_i$, in which case we are done by taking initials on both sides.&lt;/p&gt;

&lt;p&gt;Otherwise, we have some cancellation of larger initial terms (i.e. they appear multiple times across the sum), call the largest $\alpha$. Isolate those $a_ig_i$’s with the largest initial terms. Further isolate them by splitting that sum into $\mathrm{in}(a_i)g_i + (a_i - \mathrm{in}(a_i))g_i$. Note that only the first term has the larger initial term. By the previous lemma, we can rewrite the sum of those terms as a linear combination of $S$-polynomials of $\mathrm{in}(a_i)g_i$. It can be shown that&lt;/p&gt;

\[S(\mathrm{in}(a_i)g_i, \mathrm{in}(a_j)g_j) = X^{\alpha - \beta_{ij}}S(g_i, g_j)\]

&lt;p&gt;where $\beta_{ij} = \mathrm{lcm}(\mathrm{in}(g_i), \mathrm{in}(g_j))$.&lt;/p&gt;

&lt;p&gt;As the $S$-polynomials admit zero remainder after being divided by $G$ by hypothesis, and by the nature of the algorithm, when we write $S(g_i, g_j) = \sum_w q_wg_w$, we must have that $\mathrm{in}(q_wg_w)$ is bounded above by the initial term in $S(g_i, g_j)$.&lt;/p&gt;

&lt;p&gt;Thus we can reduce the largest initial term if it is not already $\mathrm{in}(f)$ by using the decompositions of the $S$ terms, which then have largest initial term $\alpha - \beta_{ij} + \mathrm{in}(S(g_i, g_j))$. Note that $\beta_{ij} &amp;gt; \mathrm{in}(S(g_i, g_j)$ by the nature of the $S$-polynomial construction.&lt;/p&gt;

&lt;p&gt;So we have rewritten $\sum_i a_ig_i$ as a new sum $\sum_i b_ig_i$ where $\mathrm{in}(b_ig_i) &amp;lt; \alpha$. We keep on doing this until we reach $\mathrm{in}(b_ig_i) = \mathrm{in}(f)$, thus we have shown $G$ is Gröbner. $\square$&lt;/p&gt;

&lt;p&gt;And so now we have a computable criterion! So here comes the algorithm of the hour.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Algorithm 2&lt;/strong&gt; (Buchberger’s Algorithm). Let $I = (f_1, \ldots, f_m)$ be a polynomial ideal over $k[X_1, \ldots, X_n]$. We construct a Gröbner basis as follows. Let $G = {f_1, \ldots, f_m}$. Then,&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Let $G’ = G$.&lt;/li&gt;
  &lt;li&gt;For each pair $p\neq q$ in $G’$ compute $r$ under the result of dividing $S(p, q)$ by $G’$ using Algorithm 1. If $r \neq 0$, add it to $G$. Otherwise do nothing.&lt;/li&gt;
  &lt;li&gt;If $G’ = G$, i.e. we didn’t add anything, then we are done. Otherwise, repeat this process.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Theorem.&lt;/strong&gt; The algorithm (Buchberger’s Algorithm) terminates in a finite number of steps and admits a Gröbner basis.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; Note that throughout this process, $(G) = I$, as $G$ contains a basis of $I$, and we only add the remainder of the polynomial $S(p, q)$ under division by polynomials already in $G$, meaning we only add polynomials in $(G)$. So we do not add too many elements ever. Clearly, if the algorithm terminates, it is correct.&lt;/p&gt;

&lt;p&gt;Letting $G_0, G_1, G_2, \ldots$ be $G’$ at the $i$th step, note that we have $G_0 \subseteq G_1 \subseteq G_2 \subseteq \ldots$. Note that we must have $\mathrm{in}(G_0) \subseteq \mathrm{in}(G_1) \subseteq \mathrm{in}(G_2) \subseteq \ldots$, where $\mathrm{in}(S)$ is the ideal generated by initial terms of polynomials in the set $S$. Note that these ideals live in $k[X_1, \ldots, X_n]$, which under Hilbert’s Basis Theorem is Noetherian, meaning this ascending chain of ideals terminates. So, we will eventually have $\mathrm{in}(G’) = \mathrm{in}(G)$.&lt;/p&gt;

&lt;p&gt;We will show that this implies $G = G’$ by contrapositive. Say $G’ \neq G$, i.e. some nonzero remainder $r$ of an $S$-polynomial in $G’$ has been adjoined to $G$. This means that $\mathrm{in}(r)$ is not divisible by the leading terms of elements in $G’$, meaning $\mathrm{in}(r) \not \in \mathrm{in}(G’)$, so $\mathrm{in}(G’) \subset \mathrm{in}(G)$.&lt;/p&gt;

&lt;p&gt;Thus whenever we get $\mathrm{in}(G’) = \mathrm{in}(G)$, we must have $G = G’$, so this algorithm terminates in a finite number of steps. $\square$&lt;/p&gt;

&lt;p&gt;This is the Buchberger algorithm. Note the main powerful theorem we needed to compute a good basis that admits a membership division algorithm/canonical representative in the quotient ring was Hilbert’s Basis Theorem, which asserts that $k[X_1, \ldots, X_n]$ is Noetherian, meaning not only that our ideals are describable with a finite number of polynomials, but that this algorithm is even possible via the ascending chain condition.&lt;/p&gt;

&lt;p&gt;We end with the following definition. We cannot simply use the size of a basis for uniqueness here, but instead we have to do the following.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Definition&lt;/strong&gt; (Reduced Gröbner Basis). A reduced Gröbner basis $G = {g_1, \ldots, g_k}$ for an ideal $I$ is a Gröbner basis for $I$ such that each $g_k$ is monic (doesn’t matter for us, as we are poly over a field), and also for all $p \in G$, no monomial of $p$ is inside of $\mathrm{in}(G \setminus {p})$.&lt;/p&gt;

&lt;p&gt;It is hopefully clear that you can use the aforementioned algorithms to compute this once you have a basis already, though it is clearly tedious as of now to do so. However, this admits the following representation theorem.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Theorem.&lt;/strong&gt; For a nonzero ideal $I$ and a given monomial order, $I$ has a unique reduced Gröbner basis.&lt;/p&gt;

&lt;p&gt;This allows us to check if $I = J$ for two different ideals $I, J$.&lt;/p&gt;

&lt;h2 id=&quot;computed-examples&quot;&gt;Computed Examples&lt;/h2&gt;

&lt;p&gt;Let’s work over simple examples.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; Let $I = (x^2 + y^2 - 1, x - y)$. Note this is the unit circle and a line. We use the lex-ordering $x &amp;gt; y$.&lt;/p&gt;

&lt;p&gt;First, we compute the $S$-polynomial of these&lt;/p&gt;

\[S(x^2+y^2-1, x-y) = x^2+y^2-1 - x^2+xy = xy + y^2 - 1\]

&lt;p&gt;Under the division algorithm, we get the remainder&lt;/p&gt;

\[xy + y^2 - 1 = y(x - y) + [2y^2 -  1]\]

&lt;p&gt;As $2y^2 - 1$ is not zero, we add it to $I$. Now we only need to check $S(y^2 - 1/2, x^2+y^2-1)$ and $S(y^2-1/2, x-y)$.&lt;/p&gt;

\[S(y^2 - 1/2, x^2+y^2-1) = y^2-1/2 - x^2-y^2 + 1 = -x^2 + 1/2\]

\[S(y^2-1/2, x-y) = xy^2-x/2 - xy^2-y^3 = -x/2-y^3\]

&lt;p&gt;Forcing monotonicity, we have the polynomials $x^2 - 1/2$ and $x - 2y^3$. Using our division algorithm,&lt;/p&gt;

\[x^2-1/2 = (x^2+y^2-1) + (y^2 - 1/2)\]

\[x-2y^3 = (x-y) + (-2y)(y^2-1/2)\]

&lt;p&gt;Thus these $S$-polynomials reduce to $0$, and so our basis is $(x^2 + y^2 - 1, x-y, y^2-1/2)$. Furthermore $(x-y, y^2-1/2)$ is the reduced Gröbner basis.&lt;/p&gt;

&lt;p&gt;Now say we are solving for $V(I)$. Note this last polynomial in our basis is single variable and so we can solve it exactly, which gives us $y = \pm \sqrt{1/2}$. Then this makes $x-y$ into a single variable equation $x\mp \sqrt{1/2}$, which admits all solutions.&lt;/p&gt;

&lt;p&gt;This is a simple example, but the general truth is when you have a lexicographic term ordering with $x_1 &amp;gt; x_2 &amp;gt; \ldots &amp;gt; x_n$, you will often end up with a minimal-variable number polynomial at the end of it (as you are decreasing the initial term) and so it will become much easier to solve. However, note that the lex ordering doesn’t actually care about the degree, meaning that we might end up with few variable high degree polynomials. The lexicographic ordering admits degree explosion and is therefore computationally somewhat expensive.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example 2.&lt;/strong&gt; We will use a term ordering called graded reverse lexicographic. We let $\alpha &amp;gt; \beta$ if $\mid\alpha\mid &amp;gt; \mid\beta\mid$ or $\mid\alpha\mid = \mid\beta\mid$ and the rightmost nonzero term of $\alpha - \beta$ is negative. Intuitively, this allows us to bias for total degree and for smaller indeterminants to appear more often. This is used in Gröbner basis solvers. We call this grevlex.&lt;/p&gt;

&lt;p&gt;Let $I = (x^2 - y, xy-1)$. It can be shown that under the lex-ordering we get the basis $(y^3-1, x-y^2)$. We compute the $S$-polynomials with respect to the grevlex:&lt;/p&gt;

\[S(x^2-y, xy-1) = x^2y-y^2 - x^2y + x = -y^2+x\]

&lt;p&gt;The leading term here is $-y^2$, so we rewrite it as $y^2-x$. Note that this cannot be divided using the division algorithm, so we have to add it to our system. We compute the two new $S$-polynomials&lt;/p&gt;

\[S(y^2-x, x^2-y) = y^2x^2-x^3 - x^2y^2 + y^3 = -x^3+y^3\]

\[S(y^2-x, xy-1) = y^2x-x^2-xy^2+y = -x^2+y\]

&lt;p&gt;The second $S$ polynomial immediately reduces, and we have $x^3 - y^3 = x(x^2-y) -y(y^2-x)$, so both $S$ polynomials reduce. Thus we have a grevlex-basis $(x^2-y, xy-1, y^2-x)$. This can be further reduced to $(x^2-y, y^2-x)$. This method keeps the degree of the generating elements at most $2$.&lt;/p&gt;

&lt;p&gt;So, the lex-order forces the elimination of earlier indeterminants by creating higher powers of later ones, and grevlex keeps the calculations degree controlled while still attempting to do what lex is doing.&lt;/p&gt;

&lt;p&gt;You can solve for $V(I)$ using the lex-order and computing a Gröbner basis. Note that solving $V(I)$ is really useful when solving optimization problems via the Lagrangian!&lt;/p&gt;

&lt;h2 id=&quot;complexity-of-algorithms&quot;&gt;Complexity of Algorithms&lt;/h2&gt;

&lt;p&gt;It should be very clear that Algorithm 1 and Buchberger’s Algorithm are descriptively very simple and as a result computationally quite slow. There are multiple ways of speeding them up, but most of them will require some slight tweaking of what Buchberger’s Criterion really says. However, what is the actual lower bound on these bases?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Theorem&lt;/strong&gt; (Mayr-Meyer-Dubé). There exist ideals $I \subset k[X_1, \ldots, X_n]$ such that minimal Gröbner bases have size of order&lt;/p&gt;

\[\mid I\mid = e^{e^{\Omega(n)}}.\]

&lt;p&gt;As a result, you can’t really hope to be that much faster. This is kind of an extension of what Hermann did in ‘26 as well, when he wrote down a bound on the degrees in representations of elements in an ideal. It also gives us an effective version of the nullstellensatz with upper bounds singly exponential. But what happens in practice?&lt;/p&gt;

&lt;p&gt;In 1999, Faugére developed a practically faster algorithm for the same problem. Specifically, when we run Buchberger’s algorithm, we have to compute each $S(f_i, f_j)$ under the result of the division algorithm. Faugére’s F4 algorithm finds for all critical pairs of a fixed degree $d$ the set&lt;/p&gt;

\[S_d = \{S(f_i, f_j) \mid \deg(\mathrm{lcm}(\mathrm{in}(f_i), \mathrm{in}(f_j))) = d\}\]

&lt;p&gt;and then converts each polynomial in $S_d$ into the row of a sparse matrix whose columns correspond to monomials. Then, you perform sparse Gaussian elimination on this matrix to &lt;em&gt;simultaneously&lt;/em&gt; perform all reductions on the $S$ polynomials.&lt;/p&gt;

&lt;p&gt;Note that you expect $\mid R_{F4}\mid \ll \mid R_B\mid$ where $R_A$ is the set of remainder polynomials added by algorithm $A$. Thus at each step we have a faster way of calculating the remainder polynomials &lt;em&gt;and we expect to compute less&lt;/em&gt;! Formally, you should be somewhat suspicious of this as we are using some $S$-polynomials to reduce other ones, but all this requires is revisiting the cancellation lemma.&lt;/p&gt;

&lt;p&gt;Now, Faugére also has another algorithm called the F5 algorithm. This algorithm has a pretty new add-on, wherein it tracks a computational `signature’ of a polynomial that detect polynomial syzygies before we even begin this simultaneous reduction. You can understand a signature of the generators $f_i$ as $(i, 1)$ and of $mf_i$ as $(i, m)$. Then for an arbitrary $f$ take the maximal index $mf_i$ in its decomposition and write it as $(i, m)$. it maintains the invariant: If a polynomial with signature $(i, m)$ has already been reduced, then any other polynomial whose signature divides $(i, m)$ must reduce to $0$. In this way, it uses a signature as a check before it does a reductive process, especially as you care store each polynomial as a linear combination of the original basis polys. As a result, you avoid a huge fraction of the work.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Table 1:&lt;/strong&gt; Complexity of selected Gröbner-basis algorithms&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Algorithm&lt;/th&gt;
      &lt;th&gt;Worst-Case&lt;/th&gt;
      &lt;th&gt;Practical / Assumptions&lt;/th&gt;
      &lt;th&gt;Remarks&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Buchberger&lt;/td&gt;
      &lt;td&gt;Doubly exponential in $n$&lt;/td&gt;
      &lt;td&gt;General; no assumptions&lt;/td&gt;
      &lt;td&gt;Simple; slow for moderate systems&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;F4&lt;/td&gt;
      &lt;td&gt;Doubly exponential&lt;/td&gt;
      &lt;td&gt;Efficient via matrix reductions&lt;/td&gt;
      &lt;td&gt;Practical speed-up; memory can blow up&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;F5&lt;/td&gt;
      &lt;td&gt;Doubly exponential&lt;/td&gt;
      &lt;td&gt;Semi-regular / generic sequences&lt;/td&gt;
      &lt;td&gt;Avoids useless reductions; much faster than Buchberger&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;However, what about the amount of working space? One would expect that you always need an exponential amount. But really, you can show that the ideal membership problem only needs exponential working space, given to us by Mayr. Working space here is not the same as output space.&lt;/p&gt;

&lt;p&gt;Finally, note that checking if $1$ is inside of an ideal is the same as checking if the vanishing set of a set of polynomials is empty, and Hilbert’s Nullstellensatz says that if I have an ideal $I$ such that $V(I)$ is empty, then $\sqrt{I}$ must contain $1$, thus $I$ must contain $1$, and so the membership problem allows us to check this. We have the somewhat surprising result from Koiran.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Theorem&lt;/strong&gt; (Koiran ‘96). Under the assumption of the Generalized Riemann Hypothesis we have that the membership problem of $1$ in a given polynomial ideal $I$ over $\mathbb{Z}[X]$ lies in the polynomial hierarchy, specifically the Arthur-Merlin class.&lt;/p&gt;

&lt;p&gt;This is a randomized algorithm that checks sufficiently many primes, which is why it requires the GRH assumption.&lt;/p&gt;

&lt;p&gt;Finally, we will end with a nice theorem.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Theorem&lt;/strong&gt; (Krick-Logar ‘91). If $I$ is an ideal of $k[X_1, \ldots, X_n]$ and has dimension $\leq 1$, then a Gröbner basis can be calculated in time $2^{O(n)}$, assuming unit costs of arithmetic in $k$.&lt;/p&gt;

&lt;p&gt;This means that for large enough ideals $I$, you don’t actually need to do that much work.&lt;/p&gt;

&lt;h2 id=&quot;openfuture-questions&quot;&gt;Open/Future Questions&lt;/h2&gt;

&lt;p&gt;What are open questions with regards to Buchberger’s algorithm? Well, since it is an algorithm, we have some natural questions:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Can we characterize classes of ideals where Buchberger runs in singly-exponential time? Does the Krick-Logar theorem have a converse?&lt;/li&gt;
  &lt;li&gt;What is the algorithm’s complexity under probabilistic models of random polynomial systems?&lt;/li&gt;
  &lt;li&gt;We are currently using the $S$-polynomial criterion from Buchberger. He also has other criterion’s called the product and chain criterion, and the F4/F5 algorithms show that the selection order of $S$-polys affects runtime. Is there a provably optimal $S$-pair selection strategy given any term ordering?&lt;/li&gt;
  &lt;li&gt;In the F4/F5 algorithms, we are solving matrices, which can be made parallel. Where else is it possible to utilize a parallel algorithm? What is the parallel complexity of basis computation? Does Buchberger’s algorithm admit polylogarithmic depth?&lt;/li&gt;
  &lt;li&gt;We are currently working over $k$ field. What happens when you change this to just a Euclidean Domain? A DVR? A tropical semiring? How does the complexity change?&lt;/li&gt;
  &lt;li&gt;The $S$ in $S$-polynomials stands for syzygy, which can be understood geometrically, but so far we have derived the algorithm as purely algebraic. However, we are working in algebraic geometry, and so we care about the geometry. Does Buchberger’s algorithm say anything geometric?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;

&lt;h2 id=&quot;references&quot;&gt;References&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Schenck, H.&lt;/strong&gt; (2003). &lt;em&gt;Computational Algebraic Geometry&lt;/em&gt;. London Mathematical Society Student Texts, 58. Cambridge University Press, Cambridge UK; New York NY. ISBN: 978-0-521-82964-9. &lt;a href=&quot;https://sites.math.washington.edu/~billey/classes/applied.algebraic.geometry/references/schenck.pdf&quot;&gt;Draft lecture notes, “FINAL FINAL” version&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lauritzen, N.&lt;/strong&gt; (2003). &lt;em&gt;Concrete Abstract Algebra: From Numbers to Gröbner Bases&lt;/em&gt;. Cambridge University Press, Cambridge UK; New York NY. Pages: xiv, 240. ISBN: 978-0-521-53410-6. &lt;a href=&quot;https://archive.org/details/concreteabstract0000laur&quot;&gt;Archive.org&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Abramson, M. P.&lt;/strong&gt; (2009). Historical background to Gröbner’s paper. &lt;em&gt;ACM Communications in Computer Algebra&lt;/em&gt;, 43(1/2), 22–23. DOI: &lt;a href=&quot;https://dl.acm.org/doi/10.1145/1610296.1610301&quot;&gt;10.1145/1610296.1610301&lt;/a&gt;&lt;/p&gt;
</description>
        <pubDate>Mon, 12 Jan 2026 00:00:00 +0000</pubDate>
        <link>https://old.agniv.me/blog/undergrad-alggeo/</link>
        <guid isPermaLink="true">https://old.agniv.me/blog/undergrad-alggeo/</guid>
        
        <category>math</category>
        
        
      </item>
    
      <item>
        <title>Favorite Youtubers</title>
        <description>&lt;p&gt;I was scrolling through my subscriptions list because I was talking to a creator and got reminded about a lot of different content I consume. This is me after scrolling through my youtube subscriptions and choosing the nonmusical/ones that I click on and watch in the corner when I see them on youtube. I subscribe to more but I think this is a solid list to represent myself. This is me fleshing out why I think you might enjoy them too! This is in alphabetical order so I didn’t confuse myself.&lt;/p&gt;

&lt;h3 id=&quot;2swap&quot;&gt;2swap&lt;/h3&gt;

&lt;p&gt;His video on the lambda calculus with his own visualizer is insane! I would go as far to say that his visualizers are a bit of the reason that I wanted to get more into programming language theory!&lt;/p&gt;

&lt;h3 id=&quot;3blue1brown&quot;&gt;3blue1brown&lt;/h3&gt;

&lt;p&gt;He has a ton of math videos that explain math relatively intuitively. He’s the guy that made Manim, which is nuts!&lt;/p&gt;

&lt;h3 id=&quot;acerola&quot;&gt;acerola&lt;/h3&gt;

&lt;p&gt;Ton of videos on graphics programming and inspired me to make a CTF based on the Kuwahara Filter.&lt;/p&gt;

&lt;h3 id=&quot;adam-mcdaniel&quot;&gt;adam mcdaniel&lt;/h3&gt;

&lt;p&gt;New Zealander who has a good intro piece on compilers.&lt;/p&gt;

&lt;h3 id=&quot;aidin-robbins&quot;&gt;aidin robbins&lt;/h3&gt;

&lt;p&gt;I honestly don’t particularly care if you are skimming this.&lt;/p&gt;

&lt;p&gt;But stop for this guy.&lt;/p&gt;

&lt;p&gt;His documentaries are INSANE. I genuinely love his content so freaking much.&lt;/p&gt;

&lt;h3 id=&quot;adumb&quot;&gt;adumb&lt;/h3&gt;

&lt;p&gt;Does a ton of data analysis/visualization stuff! Most known for his wikipedia visualization project.&lt;/p&gt;

&lt;h3 id=&quot;alex-cisse&quot;&gt;alex cisse&lt;/h3&gt;

&lt;p&gt;His travel vlogs are insanely cinematic. The video “The Beginning of Everything” is still stuck with me.&lt;/p&gt;

&lt;h3 id=&quot;alex-haraus&quot;&gt;alex haraus&lt;/h3&gt;

&lt;p&gt;Has a movie out! Goes into the oldest trees in America. He also lives in his car, and has a sick setup.&lt;/p&gt;

&lt;h3 id=&quot;answer-in-progress&quot;&gt;answer in progress&lt;/h3&gt;

&lt;p&gt;3 people making simple documentaries of the form “i have a ‘simple’ question and i will do all i can to answer it.” Captivating in no other way.&lt;/p&gt;

&lt;h3 id=&quot;bay-area-rising&quot;&gt;bay area rising&lt;/h3&gt;

&lt;p&gt;Really cool to see the music community within the Bay Area! Huge fan of the Band in a Van.&lt;/p&gt;

&lt;h3 id=&quot;bernardo-bacalhau&quot;&gt;bernardo bacalhau&lt;/h3&gt;

&lt;p&gt;His bikepacking videos are insane! He has travelled in so many weird ways to so many cool places.&lt;/p&gt;

&lt;h3 id=&quot;byran&quot;&gt;byran&lt;/h3&gt;

&lt;p&gt;Made a laptop from scratch.&lt;/p&gt;

&lt;h3 id=&quot;calebwielhouwer&quot;&gt;calebwielhouwer&lt;/h3&gt;

&lt;p&gt;Aura farming in literally every sense of the word?&lt;/p&gt;

&lt;h3 id=&quot;ccarretti&quot;&gt;ccarretti&lt;/h3&gt;

&lt;p&gt;His artstyle is soft in all the right ways, particularly love the main theme of TOTK.&lt;/p&gt;

&lt;h3 id=&quot;cody-gindy&quot;&gt;cody gindy&lt;/h3&gt;

&lt;p&gt;I saw his video on turning 3D scenes painterly, and his most recent video takes the blender monkey and creates a scene only using that as a primitive…&lt;/p&gt;

&lt;h3 id=&quot;crow&quot;&gt;crow&lt;/h3&gt;

&lt;p&gt;Crow goes into bits of malware!&lt;/p&gt;

&lt;h3 id=&quot;curious-archive&quot;&gt;curious archive&lt;/h3&gt;

&lt;p&gt;In high school I did some speculative biology worlds for fun. This was a huge inspiration and help for developing those!&lt;/p&gt;

&lt;h3 id=&quot;david-rule&quot;&gt;david rule&lt;/h3&gt;

&lt;p&gt;Dad jokes for days while building cool things to sleep and move in.&lt;/p&gt;

&lt;h3 id=&quot;dingding-luo&quot;&gt;dingding luo&lt;/h3&gt;

&lt;p&gt;Has an animation piece, with incredibly clean lighting. Would recommend the watch!&lt;/p&gt;

&lt;h3 id=&quot;donald-jewkes&quot;&gt;donald jewkes&lt;/h3&gt;

&lt;p&gt;His video on the MIT integration bee is ridiculously hype.&lt;/p&gt;

&lt;h3 id=&quot;dogfish&quot;&gt;dogfish&lt;/h3&gt;

&lt;p&gt;Crazy BOTW animations to music.&lt;/p&gt;

&lt;h3 id=&quot;doodletmego&quot;&gt;doodletmeGO&lt;/h3&gt;

&lt;p&gt;Distinctive artstyle (see the eyes) with solid colors and animations that play around with scale.&lt;/p&gt;

&lt;h3 id=&quot;ellison-dueck&quot;&gt;ellison dueck&lt;/h3&gt;

&lt;p&gt;This guy is running around the world and living life how it’s meant to be lived.&lt;/p&gt;

&lt;h3 id=&quot;eurothug4000&quot;&gt;eurothug4000&lt;/h3&gt;

&lt;p&gt;Goes into video games, particularly into their styles. Is a fan of SABLE!&lt;/p&gt;

&lt;h3 id=&quot;freedom-alexander-james-travel&quot;&gt;freedom (alexander james travel)&lt;/h3&gt;

&lt;p&gt;Older version of Ellison Dueck.&lt;/p&gt;

&lt;h3 id=&quot;freya-holmer&quot;&gt;freya holmer&lt;/h3&gt;

&lt;p&gt;Has the website &lt;a href=&quot;https://cat.gay&quot;&gt;https://cat.gay&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id=&quot;giant-cheerio&quot;&gt;giant cheerio&lt;/h3&gt;

&lt;p&gt;Bikepacker. She travelled in the Middle East on her bike, which not that many can ever claim to do.&lt;/p&gt;

&lt;h3 id=&quot;good-blood&quot;&gt;good blood&lt;/h3&gt;

&lt;p&gt;Probably some of the best edited video essays online about video games narrative analysis.&lt;/p&gt;

&lt;h3 id=&quot;goth-babe-music&quot;&gt;goth babe music&lt;/h3&gt;

&lt;p&gt;This guy plays in a band, has a a dog, rides motorcycles, lives in Oregon. Man, some people really do have it all.&lt;/p&gt;

&lt;h3 id=&quot;greg-mccahon&quot;&gt;greg mccahon&lt;/h3&gt;

&lt;p&gt;Is doing the top to bottom of the world ride and documenting it. To me, it shows the genorosity of strangers along the way.&lt;/p&gt;

&lt;h3 id=&quot;h-woo&quot;&gt;h woo&lt;/h3&gt;

&lt;p&gt;Really cool to see that many different Asian cooking techniques! The food scene in LA seems more developed than in SF.&lt;/p&gt;

&lt;h3 id=&quot;heechan-lim&quot;&gt;heechan lim&lt;/h3&gt;

&lt;p&gt;Stanford freshman filming his own movies!&lt;/p&gt;

&lt;h3 id=&quot;henna-palosaari&quot;&gt;henna palosaari&lt;/h3&gt;

&lt;p&gt;If it’s outdoors, she does it, strongly recommend her Japan Journals.&lt;/p&gt;

&lt;h3 id=&quot;henry-kidman&quot;&gt;henry kidman&lt;/h3&gt;

&lt;p&gt;Has some insane cinmetographic projects, not in the filming a movie sense, but in the building camera sliders and 3D printing movie cameras.&lt;/p&gt;

&lt;h3 id=&quot;ichika-nito&quot;&gt;ichika nito&lt;/h3&gt;

&lt;p&gt;The song The World Is Still Beautiful makes you feel that the world is still and will always be beautiful.&lt;/p&gt;

&lt;h3 id=&quot;institute-for-advanced-study&quot;&gt;institute for advanced study&lt;/h3&gt;

&lt;p&gt;Sometimes they post videos I understand!&lt;/p&gt;

&lt;h3 id=&quot;introvertedmadness&quot;&gt;introvertedmadness&lt;/h3&gt;

&lt;p&gt;Was a Stanford CS major and described his gripes with that system, and now makes kind of fun updates-in-the-life videos from New York.&lt;/p&gt;

&lt;h3 id=&quot;ivan-miranda&quot;&gt;ivan miranda&lt;/h3&gt;

&lt;p&gt;Built a super cool marble clock, i.e. the display is from sliding marbles. So many weird technical challenges in order to do this.&lt;/p&gt;

&lt;h3 id=&quot;j-square&quot;&gt;j-square&lt;/h3&gt;

&lt;p&gt;He has an amazing video on the Sobel Operator, and developed his own graphics engine.&lt;/p&gt;

&lt;h3 id=&quot;jacob-geller&quot;&gt;jacob geller&lt;/h3&gt;

&lt;p&gt;Some of the best video game narrative analysis online, beat out only by himself on Nebula.&lt;/p&gt;

&lt;h3 id=&quot;jakedontdraw&quot;&gt;jakedontdraw&lt;/h3&gt;

&lt;p&gt;Does fine/traditional oil paintings.&lt;/p&gt;

&lt;h3 id=&quot;jam2go&quot;&gt;jam2go&lt;/h3&gt;

&lt;p&gt;So I find it really hard to predict what he’s going to post, but I never find it hard to predict /how/, since he has the same kind of quirky etheral strange vibe for each video. It’s awesome.&lt;/p&gt;

&lt;h3 id=&quot;jasper-tan&quot;&gt;jasper tan&lt;/h3&gt;

&lt;p&gt;Bikepacking in SE Asia is an insane vibe, especially since the people are super nice and there is always a rice field to ride through.&lt;/p&gt;

&lt;h3 id=&quot;jawpictures&quot;&gt;jawpictures&lt;/h3&gt;

&lt;p&gt;Aesthetic travel videos, insanely cinematic.&lt;/p&gt;

&lt;h3 id=&quot;jdh&quot;&gt;jdh&lt;/h3&gt;

&lt;p&gt;“Yeah so we’re doing this from first principles” kind of guy. Made everything you’d reasonably need to program a first person shooter from scratch. Including a GPU!&lt;/p&gt;

&lt;h3 id=&quot;jeffery-sun&quot;&gt;jeffery sun&lt;/h3&gt;

&lt;p&gt;Self-documentaries that ask good questions. He has a beautiful Taiwan travel film. I want more friends in Taiwan.&lt;/p&gt;

&lt;h3 id=&quot;joonbohobo&quot;&gt;joonbohobo&lt;/h3&gt;

&lt;p&gt;This guy treated Desmos like a. Game Engine. What the. What the-&lt;/p&gt;

&lt;h3 id=&quot;joseph-anderson&quot;&gt;joseph anderson&lt;/h3&gt;

&lt;p&gt;Is a game commentator/critiquer, and is insanely in depth. Like, I have barely seen anyone come near his level of quality for critiques, regardless of the artform.&lt;/p&gt;

&lt;h3 id=&quot;joshs-channel&quot;&gt;josh’s channel&lt;/h3&gt;

&lt;p&gt;His animation style seems so time consuming? But it’s such a gummy delight to watch, and he has beautiful videos on ray tracing and mountain generations.&lt;/p&gt;

&lt;h3 id=&quot;junfero&quot;&gt;junfero&lt;/h3&gt;

&lt;p&gt;Insane computer history videos with dry humor that always lands.&lt;/p&gt;

&lt;h3 id=&quot;kay-lack&quot;&gt;kay lack&lt;/h3&gt;

&lt;p&gt;I haven’t seen that many people attack the primitives of CS as they do, in the sense of discussing regexes and dynamic arrays. Insanely baller.&lt;/p&gt;

&lt;h3 id=&quot;kyle-goes-off&quot;&gt;kyle goes off&lt;/h3&gt;

&lt;p&gt;He’s trying to make a meal in every state while travelling in his van. Gangster!&lt;/p&gt;

&lt;h3 id=&quot;lawrence-carpenter&quot;&gt;lawrence carpenter&lt;/h3&gt;

&lt;p&gt;Doesn’t really post anymore, but wow bikes are insanely cool.&lt;/p&gt;

&lt;h3 id=&quot;lemmino&quot;&gt;lemmino&lt;/h3&gt;

&lt;p&gt;History/speculative videos, particularly loved the video on the Kryptos code.&lt;/p&gt;

&lt;h3 id=&quot;leon-ex-machina&quot;&gt;leon ex machina&lt;/h3&gt;

&lt;p&gt;His interviews with engineers gives me cool context into the world my brother inhabits.&lt;/p&gt;

&lt;h3 id=&quot;lubomyr-melnyk&quot;&gt;lubomyr melnyk&lt;/h3&gt;

&lt;p&gt;I met a student of his in Oxford. Melnyk’s music is extremely quick paced and his story is immense.&lt;/p&gt;

&lt;h3 id=&quot;luke-korns&quot;&gt;luke korns&lt;/h3&gt;

&lt;p&gt;Travel documentaries but either to unexpected places or in nontrivial ways without feeling like a contrived challenge.&lt;/p&gt;

&lt;h3 id=&quot;martsnack&quot;&gt;martsnack&lt;/h3&gt;

&lt;p&gt;So you could in theory beat FireRed while blind/deaf and uh beat every seed of Pokemon Platinum? What the fuck?&lt;/p&gt;

&lt;h3 id=&quot;matt-yuan&quot;&gt;matt yuan&lt;/h3&gt;

&lt;p&gt;I met him in Oxford! He’s doing his PhD in CS there, and he also builds nerf blasters on his channel. Lovely guy.&lt;/p&gt;

&lt;h3 id=&quot;mav&quot;&gt;mav&lt;/h3&gt;

&lt;p&gt;He truck camps and just has fun while doing it.&lt;/p&gt;

&lt;h3 id=&quot;max0r&quot;&gt;max0r&lt;/h3&gt;

&lt;p&gt;God this guy’s timelines must lag his computer so much, video game content.&lt;/p&gt;

&lt;h3 id=&quot;melodysheep&quot;&gt;melodysheep&lt;/h3&gt;

&lt;p&gt;Content wise I’m not actually that in love with the channel but the actual things on display are always immense and cool.&lt;/p&gt;

&lt;h3 id=&quot;mossbag&quot;&gt;mossbag&lt;/h3&gt;

&lt;p&gt;Dad jokes and lore videos for games from Team Cherry.&lt;/p&gt;

&lt;h3 id=&quot;mr-chops&quot;&gt;mr chops&lt;/h3&gt;

&lt;p&gt;Makes interesting lifestyle videos. His videos on spending 0 currency in London, Lisbon, Belgium are always nice to see.&lt;/p&gt;

&lt;h3 id=&quot;natalie-lynn&quot;&gt;natalie lynn&lt;/h3&gt;

&lt;p&gt;Your creator’s favorite creator. “All my dreams became memories.” Embody that.&lt;/p&gt;

&lt;h3 id=&quot;natzgreat&quot;&gt;natzgreat&lt;/h3&gt;

&lt;p&gt;4k miles alone in his drift car and all he got to show for it was a banger video.&lt;/p&gt;

&lt;h3 id=&quot;nemean&quot;&gt;nemean&lt;/h3&gt;

&lt;p&gt;Has nice math videos on some algorithms/algebra.&lt;/p&gt;

&lt;h3 id=&quot;noah-kane&quot;&gt;noah kane&lt;/h3&gt;

&lt;p&gt;Climbing content, particularly the climbing of trees. Scratches that childhood itch.&lt;/p&gt;

&lt;h3 id=&quot;nolen-royalty-eieio-games&quot;&gt;nolen royalty eieio games&lt;/h3&gt;

&lt;p&gt;1000000000 checkboxes, chessboards online should not be technically feasible. It somehow is.&lt;/p&gt;

&lt;h3 id=&quot;nor-gather-into-barns&quot;&gt;nor gather into barns&lt;/h3&gt;

&lt;p&gt;His videos have the same vibe as Taipei Story. Like, when people make their film intentionally dark for cinema effects but it falls flat, but this all avoids that. IDK if it’s because of his camera though. Slice of Life stuff.&lt;/p&gt;

&lt;h3 id=&quot;not-all-wrong&quot;&gt;not all wrong&lt;/h3&gt;

&lt;p&gt;His video on unsolvability of the quintic via commutators is quite, quite good, I believe the first of its kind on Youtube.&lt;/p&gt;

&lt;h3 id=&quot;olisunvia&quot;&gt;oliSUNvia&lt;/h3&gt;

&lt;p&gt;Video essays on internet culture.&lt;/p&gt;

&lt;h3 id=&quot;overly-sarcastic-productions&quot;&gt;overly sarcastic productions&lt;/h3&gt;

&lt;p&gt;I love Red’s videos so much, mostly because I prefer stories to history. Sorry Blue!&lt;/p&gt;

&lt;h3 id=&quot;people-make-games&quot;&gt;people make games&lt;/h3&gt;

&lt;p&gt;Makes critical commentary videos on the video game industry as a whole.&lt;/p&gt;

&lt;h3 id=&quot;peter-sebio&quot;&gt;peter sebio&lt;/h3&gt;

&lt;p&gt;A really, really good climber from the Bay Area.&lt;/p&gt;

&lt;h3 id=&quot;pezzas-work&quot;&gt;pezza’s work&lt;/h3&gt;

&lt;p&gt;Really cool computational projects (cloth sim, ants, ai).&lt;/p&gt;

&lt;h3 id=&quot;physics-for-the-birds&quot;&gt;physics for the birds&lt;/h3&gt;

&lt;p&gt;Cutest animation style, always has engaging titles. If this guy published papers he would get far.&lt;/p&gt;

&lt;h3 id=&quot;polyamath&quot;&gt;polyamath&lt;/h3&gt;

&lt;p&gt;A mathmo at Cambridge, he animates his math with DaVinci Resolve, which is insane.&lt;/p&gt;

&lt;h3 id=&quot;polylog&quot;&gt;polylog&lt;/h3&gt;

&lt;p&gt;Goes into simple algorithms in CS!&lt;/p&gt;

&lt;h3 id=&quot;polyphia&quot;&gt;polyphia&lt;/h3&gt;

&lt;p&gt;Banger music bro ain’t got nothing else to say.&lt;/p&gt;

&lt;h3 id=&quot;praneeth-namburi&quot;&gt;praneeth namburi&lt;/h3&gt;

&lt;p&gt;Researcher working on movement, competitive ballroom dancer. Is the body more efficient while dancing?&lt;/p&gt;

&lt;h3 id=&quot;premature-abstraction&quot;&gt;premature abstraction&lt;/h3&gt;

&lt;p&gt;Funny CS videos that are more from the applied angle!&lt;/p&gt;

&lt;h3 id=&quot;projectmaria&quot;&gt;projectmaria&lt;/h3&gt;

&lt;p&gt;Documenting the programming job market.&lt;/p&gt;

&lt;h3 id=&quot;rainbolt&quot;&gt;RAINBOLT&lt;/h3&gt;

&lt;p&gt;Need I say anything?&lt;/p&gt;

&lt;h3 id=&quot;razbuten&quot;&gt;razbuten&lt;/h3&gt;

&lt;p&gt;Has decent videos and nice takes on video games, it’s always really cute to see him and his wife play games together.&lt;/p&gt;

&lt;h3 id=&quot;reducible&quot;&gt;reducible&lt;/h3&gt;

&lt;p&gt;Discusses popular algorithms, but his videos on JPEG and PNG are both really cool.&lt;/p&gt;

&lt;h3 id=&quot;regionaltantrums&quot;&gt;regionaltantrums&lt;/h3&gt;

&lt;p&gt;Niche channel discussing mostly Rust &amp;amp; GPU programming.&lt;/p&gt;

&lt;h3 id=&quot;rj-palmer&quot;&gt;RJ palmer&lt;/h3&gt;

&lt;p&gt;His ability to draw creatures at any level of detail is insane.&lt;/p&gt;

&lt;h3 id=&quot;runevision&quot;&gt;runevision&lt;/h3&gt;

&lt;p&gt;Shader content. The fractal dithering is really, really cool, and he also made a hair shader!&lt;/p&gt;

&lt;h3 id=&quot;sarv&quot;&gt;sarv&lt;/h3&gt;

&lt;p&gt;I hate my phone so I love him.&lt;/p&gt;

&lt;h3 id=&quot;scott-yu-jan&quot;&gt;scott yu-jan&lt;/h3&gt;

&lt;p&gt;Annoyingly aesthetic. Like, how dare you, where is your mess???&lt;/p&gt;

&lt;h3 id=&quot;sebastion-lague&quot;&gt;sebastion lague&lt;/h3&gt;

&lt;p&gt;Makes incredible videos on rendering! Ray tracing, smoke simulation, fluid simulations, text rendering, etc.&lt;/p&gt;

&lt;h3 id=&quot;shaffer-nickel&quot;&gt;shaffer nickel&lt;/h3&gt;

&lt;p&gt;Dry humor, clean videos, lighting is insane, amazing knowledge about cameras, a reality to experience.&lt;/p&gt;

&lt;h3 id=&quot;shar&quot;&gt;shar&lt;/h3&gt;

&lt;p&gt;INCREDIBLY CUTE ANIMATIONS!!!&lt;/p&gt;

&lt;h3 id=&quot;sheafification-of-g&quot;&gt;sheafification of G&lt;/h3&gt;

&lt;p&gt;GPU Programmer who also does a ton of math readings.&lt;/p&gt;

&lt;h3 id=&quot;shleepy-studio&quot;&gt;shleepy studio&lt;/h3&gt;

&lt;p&gt;Someone in SF just vibing around.&lt;/p&gt;

&lt;h3 id=&quot;simondev&quot;&gt;simondev&lt;/h3&gt;

&lt;p&gt;A lot of game development content, really unique presentation style.&lt;/p&gt;

&lt;h3 id=&quot;sirrandalot&quot;&gt;sirrandalot&lt;/h3&gt;

&lt;p&gt;He made a camera within blender. I. I.&lt;/p&gt;

&lt;h3 id=&quot;sphaerophobia&quot;&gt;sphaerophobia&lt;/h3&gt;

&lt;p&gt;Complete streams of a guy trying to build all the software he can from scratch.&lt;/p&gt;

&lt;h3 id=&quot;stefano-ghisolfi&quot;&gt;stefano ghisolfi&lt;/h3&gt;

&lt;p&gt;His outdoor climbs really mess with me because everything in my head is saying that there is literally nothing to climb.&lt;/p&gt;

&lt;h3 id=&quot;structures-computer-interaction-labratory&quot;&gt;structures-computer interaction labratory&lt;/h3&gt;

&lt;p&gt;Different types of movements in robots!&lt;/p&gt;

&lt;h3 id=&quot;struggling-grad-student&quot;&gt;struggling grad student&lt;/h3&gt;

&lt;p&gt;It’s reallly nice to see a math phd document their life!&lt;/p&gt;

&lt;h3 id=&quot;t3ssel8r&quot;&gt;t3ssel8r&lt;/h3&gt;

&lt;p&gt;Insane artstyle in his games, his video on shading / procedural animations are bangers.&lt;/p&gt;

&lt;h3 id=&quot;tactmp3&quot;&gt;TACT.mp3&lt;/h3&gt;

&lt;p&gt;Insane guitar aura.&lt;/p&gt;

&lt;h3 id=&quot;tanks-for-nothin&quot;&gt;tanks for nothin&lt;/h3&gt;

&lt;p&gt;He makes insane tanks for his fishies!!!!!! OMG!!!!!!&lt;/p&gt;

&lt;h3 id=&quot;tantan&quot;&gt;tantan&lt;/h3&gt;

&lt;p&gt;Rust based game developer. Shoutout Bevy.&lt;/p&gt;

&lt;h3 id=&quot;teo-crawford&quot;&gt;teo crawford&lt;/h3&gt;

&lt;p&gt;Films a ton of content about film.&lt;/p&gt;

&lt;h3 id=&quot;terence-tao&quot;&gt;terence tao&lt;/h3&gt;

&lt;p&gt;Math guy Of All Time. MOAT?&lt;/p&gt;

&lt;h3 id=&quot;the-hyrule-journals&quot;&gt;the hyrule journals&lt;/h3&gt;

&lt;p&gt;Mhm crunchy film grain in my favorite game series ever.&lt;/p&gt;

&lt;h3 id=&quot;the-turtle&quot;&gt;The Turtle&lt;/h3&gt;

&lt;p&gt;Holden Mui is probably one of the best composers of his generation.&lt;/p&gt;

&lt;h3 id=&quot;tibees&quot;&gt;tibees&lt;/h3&gt;

&lt;p&gt;Have you ever heard a calm Australian? That’s talking about math? This is it.&lt;/p&gt;

&lt;h3 id=&quot;tierzoo&quot;&gt;tierzoo&lt;/h3&gt;

&lt;p&gt;Gamer Zoology Content.&lt;/p&gt;

&lt;h3 id=&quot;toemas&quot;&gt;toemas&lt;/h3&gt;

&lt;p&gt;Did SWE in his car for a bit. Transferred to Columbia. Figuring out how to make money online. Cool guy.&lt;/p&gt;

&lt;h3 id=&quot;tradprincess&quot;&gt;tradprincess&lt;/h3&gt;

&lt;p&gt;For how insanely strong she is she has barely any subscribers?&lt;/p&gt;

&lt;h3 id=&quot;tristan-ridley&quot;&gt;tristan ridley&lt;/h3&gt;

&lt;p&gt;Bike Go Brr. Recently did a long ride for cheap. Recently did a bike ride through Iceland!&lt;/p&gt;

&lt;h3 id=&quot;useless-game-dev&quot;&gt;useless game dev&lt;/h3&gt;

&lt;p&gt;Love his breakdowns of different rendering/gameplay techniques in Unity.&lt;/p&gt;

&lt;h3 id=&quot;vaatividya&quot;&gt;vaatividya&lt;/h3&gt;

&lt;p&gt;Lore videos for the Souls genre.&lt;/p&gt;

&lt;h3 id=&quot;vercidium&quot;&gt;vercidium&lt;/h3&gt;

&lt;p&gt;Optimizing game engines to the max!&lt;/p&gt;

&lt;h3 id=&quot;viene&quot;&gt;viene&lt;/h3&gt;

&lt;p&gt;Insane vibes. Like, wow. If a cafe had those vibes I would show up early and leave late.&lt;/p&gt;

&lt;h3 id=&quot;yenji-jem&quot;&gt;yenji jem&lt;/h3&gt;

&lt;p&gt;Lists, lists, and more lists! Lists of numbers, of history, etc.&lt;/p&gt;

&lt;h3 id=&quot;yosh&quot;&gt;yosh&lt;/h3&gt;

&lt;p&gt;AI in Trackmania. RL.&lt;/p&gt;

&lt;h3 id=&quot;-오댕손과-방울가위&quot;&gt;&amp;amp; 오댕손과 방울가위&lt;/h3&gt;

&lt;p&gt;It’s crazy to me that all of this person’s art is in blender?&lt;/p&gt;

&lt;h2 id=&quot;end&quot;&gt;end&lt;/h2&gt;

&lt;p&gt;A lot of these themes are travel, biking, video games, cs algorithms, blender art, dad jokes, etc.&lt;/p&gt;

&lt;p&gt;If you like any of these youtubers too and I know you, I’d love to talk to you about them!&lt;/p&gt;
</description>
        <pubDate>Wed, 03 Dec 2025 00:00:00 +0000</pubDate>
        <link>https://old.agniv.me/blog/favorite-youtubers/</link>
        <guid isPermaLink="true">https://old.agniv.me/blog/favorite-youtubers/</guid>
        
        <category>self</category>
        
        
      </item>
    
      <item>
        <title>Stuff worth Buying</title>
        <description>
</description>
        <pubDate>Sat, 18 Oct 2025 00:00:00 +0000</pubDate>
        <link>https://old.agniv.me/blog/meaningful-improvements/</link>
        <guid isPermaLink="true">https://old.agniv.me/blog/meaningful-improvements/</guid>
        
        <category>self</category>
        
        
      </item>
    
      <item>
        <title>Talk Notes</title>
        <description>&lt;p&gt;This, this is a story about dorm lectures.&lt;/p&gt;

&lt;p&gt;While in Oxford, I felt extraordinarily restless. I do not know nearly enough mathematics and I do not think this feeling of lacking will ever go away. I imagine adulthood is &lt;a href=&quot;https://www.gleech.org/ignorance&quot;&gt;accepting this&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;But how do you even, you know, convince yourself that you know math? Do you just read a lot?&lt;/p&gt;

&lt;p&gt;The answer is yes. But you also need to communicate it. It is not that hard to read a ton and move on, but to actually sit down and write it into an explainable way for people? That’s the crux. That’s why doing math is “hard.”&lt;/p&gt;

&lt;p&gt;Anyway, I gave a ~2.5-3 hour lecture on Probabilistic Combinatorics. The issue with giving talks on combinatorics is they almost always feel like group problem solving sessions, compared to lectures on set theory being more free to build upwards. Combinatorics is the field of mathematics where techniques are what matter, not the base level objects.&lt;/p&gt;

&lt;p&gt;Studying probabilistic combinatorics is probably the best way to convince yourself that Erdös is underhyped. Almost every single beautiful proof I have seen has been a result of his, or in some way could be traced back to him.&lt;/p&gt;

&lt;p&gt;This is the proof that would make anyone fall in love with the subject. It is on sum-free subsets.&lt;/p&gt;

&lt;p&gt;We say that a set $S$ is sum-free if there are no triples $a, b, c$ in $S$ such that $a+b=c.$ The following proof works for either $S$ consisting of real numbers, or naturals, and is cleaner to do in the naturals.&lt;/p&gt;

&lt;p&gt;A priori, most people should not expect that given a set $S$ of natural numbers, that you can consistently find a “large” subset that is sum-free. Consider the cases where $S = [n]$, or the first $n$ positive numbers. You can take all the odds from $S$ to create a large sum-free set, so you have a density of $1/2$.&lt;/p&gt;

&lt;p&gt;I’m going to actually prove really quickly that this is maximal, though I have forgotten the proof, so I’ll time myself. Since we’re looking at finite sets, this is something that needs the pigeonhole principle. Let $S’$ be our sum-free subset of $S$, and say $m = \max(S’)$.&lt;/p&gt;

&lt;p&gt;Say $m$ is odd. Then consider the pairings $(1, m-1), \ldots, (\lfloor m / 2 \rfloor, \lceil m/2\rceil)$. There are $\lfloor m /2 \rfloor$ many pairs. So if the size of the subset is larger than $m/2,$ it must contain two elements that add to $m$. The case where $m$ is even is near identical, as you do casework on if it contains $m/2$ or not.&lt;/p&gt;

&lt;p&gt;Since we have an upper bound on the size based on the maximal element, and the maximal element is at most $\max(S) = n$, we can have at most $n/2$ elements when $S = [n]$.&lt;/p&gt;

&lt;p&gt;I’m happy, since that only took me a few seconds to think about. However, for the next proof, it took me signifigantly longer to do it, and I knew the end answer beforehand. I also had a “hint.” I mentioned that one way to construct a maximal sum-free subset of $[n]$ was to take all of the odds, but an alternate strategy is to take the “upper half” of the set, as any two sums will always overshoot the maximal element.&lt;/p&gt;

&lt;p&gt;So, here we go. Let $S$ be any set of $n$ integers. For our sake, say $S$ does not contain $0$, as otherwise $0 + 0 = 0$, and it’s just annoying.&lt;/p&gt;

&lt;p&gt;Let $M = \max({\mid s\mid \in S})$. We want to find a prime $p$ such that it is $2 \pmod 3$ and larger than $2M+1$. The first condition is available to us via Dirichlet’s theorem, but is really only a technicality, so I don’t want to expand that out here. But the reason we want $p &amp;gt; 2M+1$ is because we want each element of $S \pmod p$ to be distinct, and smaller primes might not allow it.&lt;/p&gt;

&lt;p&gt;Why did we do this? Well, what are nice sets that are sum-free in $\mathbb{Z}/p\mathbb{Z}$? The all odds does still work, but note that the upper half one might not! Specifically, by adding together a number that is close to $p$ to a number that is close to $p/2$, you will get around $p/2$ in modular arithmatic, which the upper half set has.&lt;/p&gt;

&lt;p&gt;Instead, we look at the middle thirds. This is where knowing the answer that we’re looking for comes in real darn handy, though I’ve hidden it from you for now. Note that we set $p\equiv 2 \pmod{3}$. Write $p = 3k+2$. Consider the intervals $[1, k], [k+1, 2k+1], [2k+2, 3k+1].$ The middle one is of the most interest to us, which we will denote as $I$ as it is an interval, and it will be referred to as the middle third.&lt;/p&gt;

&lt;p&gt;Note that the sum of any two elements in $I$ will always land you outside of $I$! This is not as good as the $n/2$ bound that we had before, and is now instead $k+1 \approx p/3$.&lt;/p&gt;

&lt;p&gt;Now for the probability. Let $r$ be a uniformly random variable over elements in $(\mathbb{Z}/p\mathbb{Z})^\times$, e.g. $r$ is nonzero in the field. Let $rS = {rs \pmod{p} \mid s \in S}$. Note this is also a random variable. We then care about the random variable $X = \mid rS \cap I\mid $.&lt;/p&gt;

&lt;p&gt;Why? If we can get a lower bound on $X$, then we have found a sum-free set in $rS$, as the subset of a sum-free set is sum-free. But note that being sum-free in $rS$ is also equal to being sum-free in general, as $r$ has a multiplicative inverse.&lt;/p&gt;

&lt;p&gt;Specifically, if $a + b = c$, then $a + b = c \pmod{p}$. We would then have $ra + rb = rc \pmod{p}$. Since we’ve found a set such that the last equation does not hold, the first one cannot hold.&lt;/p&gt;

&lt;p&gt;So, we need to find a bound on $X$. And this is where we use the linearity of expectation. Note that $rs$ for any $s \in S$ attains all of the values in $(\mathbb{Z}/p\mathbb{Z})^\times$, as $r$ can attain each of those values, and $s$ is nonzero in this field. So, the probability that $rs \in I$ is $\mid I\mid /(p-1) = (k+1)/(3k+1) \geq 1/3$. You have to get used to these kinds of inequalities in this kind of math, and I feel like I’ve only recently begun to be okay with guessing and going back to check it.&lt;/p&gt;

&lt;p&gt;So, we can do:&lt;/p&gt;

\[\mathbb{E}[X] = \sum_{s \in S}\mathbb{P}(rs \in I) \geq n/3.\]

&lt;p&gt;Based on the former motivation for $X$, we now know that there is a set of size at least $n/3$ inside of $S$ that is sum-free.&lt;/p&gt;

&lt;p&gt;Ultimately, the theorem states that for any set $S$ of $n$ nonnegative integers, you can find a subset that is sum-free and size at least $n/3$.&lt;/p&gt;

&lt;p&gt;It is really, really hard for me to convey how insane I think this is beyond typing it out many times. But I hope it is clear. In some sense this is another example that the human mind is not really used to the linearity of the expectation operator, but I digress.&lt;/p&gt;

&lt;p&gt;Even more insane is the fact that this was improved near the beginning of 2025 to an asymptotic bound of about $n/3 + \log(\log(n))$. This was work done by Bedert and dives way deeper into additive techniques that were first talked about by Bourgain in ‘97. They are sitting on my backlog of papers to read. Obviously the extended question is to find out if these bounds are sharp, e.g. to find sets with certain structures that force this bound. But I do not see a way forward for this, barring checking the Littlewood norm for a bunch of cases.&lt;/p&gt;

&lt;p&gt;This talk was done at a society called &lt;a href=&quot;https://wcr.univ.ox.ac.uk/societies/Pedro&quot;&gt;PedroSoc&lt;/a&gt;, which was run by perhaps one of the best men I will ever get to meet in my life. I have met very few men of such strong conviction as he, and I was happy to talk to him always. He was the one that laughed and said that one should come to Oxford already knowing all the math and to spend the time for love.&lt;/p&gt;

&lt;p&gt;Anyway, oftentimes when I give a talk my rough notes on the subject are much more in depth than what I actually end up talking about. I had extraordinarily messy notes back then, and so I was reading over it after the talk while walking outside. I walked outside at night a lot in Oxford, mostly because it was quiet.&lt;/p&gt;

&lt;p&gt;But I also walked because I could call my friends from back in California, to stay connected with them from afar. I called &lt;a href=&quot;https://logangraves.com/&quot;&gt;Logan&lt;/a&gt; because… it felt right.&lt;/p&gt;

&lt;p&gt;Fast-forward a bit, he takes it upon himself to start dorm lectures at Stanford. He is joined in this effort by two twins, &lt;a href=&quot;https://www.chasingsunsets.dev/&quot;&gt;Peter Bennett&lt;/a&gt; and Ailon Goraly (they are not related, they have their own twins). These lectures are very different and vary in format and are beautiful. I have been to three, all on different things.&lt;/p&gt;

&lt;p&gt;I am not doing a great service to explain how wonderful these are. I truly believe that the fundamental issue of the sciences and art is that of communication. And this is perhaps the culmination of all of that, you know? A bunch of college kids just trying to explain the things that they love.&lt;/p&gt;

&lt;p&gt;So I recently gave one of the lectures there. It was short, 15 minutes long. I’ve given short lectures on math before, but I knew that the audience was going to be a mix of mathematical backgrounds, so I decided against doing something super technical.&lt;/p&gt;

&lt;p&gt;Instead, I talked about ridiculously cool people that I had learned about over the years.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://pbs.twimg.com/media/GzLLwowbkAAs5NQ?format=jpg&amp;amp;name=large&quot; alt=&quot;img&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The talk sequence was messy and abrupt and I really should have played some music in the background. Much of it was off of information that I found online, not all off wikipedia, but some of it from there.&lt;/p&gt;

&lt;p&gt;I wrote down a lot of notes on the preliminaries to the work that Gill had done, as he was mostly in the field of continued fractions. Specifically, I wrote down the rough structure of Cohn’s argument for the ctfrac expansion of $e$, as the talk before me was on how $e$ showed up naturally in computer science optimization problems (roughly think about optimizing the quantity $(c/x)^x$ with respect to $x$).&lt;/p&gt;

&lt;p&gt;But to keep on the combinatorics theme, I wanted to mention Folkman, especially his combinatorics theorem.&lt;/p&gt;

&lt;p&gt;The setup is as follows. We say that a graph $G$ is $H$-Ramsey if any 2-coloring of $G$ contains a monochromatic copy of $H$. Ramsey’s theorem then states simply that for any $n$, there exists some $G=K_N$ that is $K_n$-Ramsey.&lt;/p&gt;

&lt;p&gt;I actually find that this is pretty intuitive. The proof itself kind of gives way to how it works inductively. I also think there’s probably a proceedure to take some $K_n$ and run casework on it in the same way that you can run casework on $K_3$ in $K_6$, but proofs of this type are most likely machine-checkable instead of human-readable.&lt;/p&gt;

&lt;p&gt;But what breaks my brain for me is the following result of Folkman. Let $n \geq 2$. Then there is always some graph $G$ that is $K_n$-Ramsey, but it does not contain a $K_{n+1}$.&lt;/p&gt;

&lt;p&gt;The notation that Folkman uses originally in &lt;a href=&quot;https://www.cs.umd.edu/~gasarch/TOPICS/grt/Folkman.pdf&quot;&gt;his amazing paper&lt;/a&gt; is slightly different, but it is a short paper that I read while sitting on a couch in Utah. It took me a very long time to read.&lt;/p&gt;

&lt;p&gt;I feel this weird sense that unless I have memorized a proof verbatim or have let it marinate within me for a long time, I cannot write the proof down without it looking like a direct copy, unless I personally find issue with the way the proof is formatted. When you read this, you will probably look at Folkman’s paper and go “huh, man, he really just copy pasted this stuff,” and to you I say, well, sort of. Typing it out word for word and deleting and resorting and reorganizing is the POINT of reading mathematics. A computer scientist that I really look up to &lt;a href=&quot;https://slim.computer/blug/chaotic-learning.html&quot;&gt;has more on her blog&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Anyway, the proof is very, very similar to the proof of Ramsey’s theorem. Ramsey’s theorem is usually proven using off-diagonal Ramsey numbers, taking a “sum” of two graphs of smaller Ramsey number, and then arguing via size.&lt;/p&gt;

&lt;p&gt;Instead of taking the sum of two complete graphs, instead he takes two graphs that have the Folkman property for off-diagonals and combining them in a way that avoids the larger graphs, and then showing that it has the Ramsey property via a size argument.&lt;/p&gt;

&lt;p&gt;I’ll flesh out this sketch. First, we’re going to adopt his notation. We let $\delta(G)$ be the size of the largest complete subgraph of $G$. He calls this dimension for a discrete topological reason that to me always feels a bit extra. Like I get these are all simplicies at the end of the day, but within the context of these problems, I haven’t seen that much use of topology yet. We let $f(k_1, k_2)$ be the min. dimension of graphs inside of $\Gamma(k_1, k_2)$, where $\Gamma(k_1, k_2)$ is all graphs that when two colored contain a red $K_{k_1}$ or a blue $K_{k_2}$. This is nonempty by Ramsey’s theorem.&lt;/p&gt;

&lt;p&gt;You want equality, so you want to show that $f(k_1, k_2)$ is lower bounded by $\max(k_1, k_2)$. But this is immediate by definition Ramsey property.&lt;/p&gt;

&lt;p&gt;As this is an induction, you need a base case, which is when either $k_i$ is equal to $2$. Since this is just an edge, we have $K_{k_j} \in \Gamma(k_i, k_j)$ where $j$ is the other index, so we have $f(k_i, k_j) = \max(k_i, k_j)$.&lt;/p&gt;

&lt;p&gt;The induction is on the sum of elements $k_1+k_2$ with $k_1, k_2 \geq 2$. We’ve just shown for when either one is equal to $2$, it’s done, so we start out with the following assumptions.&lt;/p&gt;

&lt;p&gt;Suppose $k_1 + k_2 \geq 6$, and that when $k_1’, k_2’ \geq$ and $k_1’ + k_2’ &amp;lt; k_1+k_2$ we have $f(k_1’, k_2’) = \max(k_1’, k_2’)$. We further assume that $k_1, k_2 \geq 3$. For ease of notation let $m = \max(k_1, k_2)$.&lt;/p&gt;

&lt;p&gt;By the IH, we have graphs $G_1 \in \Gamma(k_1-1, k_2)$, $G_2 \in \Gamma(k_1, k_2 - 1)$, and $G_3 \in \Gamma(k_1-1, k_2-1)$, such that each one has minimal dimension. This $G_3$ will be secret tool to help us later, as we’re going to glue together $G_1, G_2$ in a clever way, as each of their dimensions is upper bounded by $m$.&lt;/p&gt;

&lt;p&gt;Label $G_1, G_2$ such that each vertex is distinct. Then we can define their disjoint union, which has the same upper bound on the dimension $m$. We let $M$ be the number of $m-1$ element subsets of the vertices of these two graphs. Note that we don’t immediately know what $M$ is! I don’t believe Folkman did much work on asymptotics for this graph.&lt;/p&gt;

&lt;p&gt;Let $N$ be the number of ways that the edges of a new graph $H_2 = H((m-1)^2M^2, G_3)$ can be partitioned intwo two classes. Folkman doesn’t specify here if “partition” is ordered, but it is implied later. This is not a part of the proof that I am willing to explain, mostly as it is the “hidden technical lemma that is secretly really fucking hard.” Explicitly, this graph $H$ has the same dimension as $G_3,$ so $m-1$, and if you partition the vertices into $(m-1)^2M^2$ classes, then for some class $C_i$, there exists a subset $S \subseteq C_i$ such that the subgraph induced by $S$ in $H$ is isomorphic to $G_3$.&lt;/p&gt;

&lt;p&gt;We need this tool once more. Let $V_1$ be the set of vertices in $H_1 = H(N, G_1 \sqcup G_2)$, which is the same as before, just swapping out the constants. This should seem weird. Let $V_2$ be the set of vertices of the original $H$. Finally, let $X$ be set containing all $m-1$ subsets of $V_1$.&lt;/p&gt;

&lt;p&gt;This is where the construction actually is, and is where I would benefit from drawing a good picture. Our vertex set of choice is $V = (V_1 \times V_2) \cup X$. So now we need to figure out our edge set via casework.&lt;/p&gt;

&lt;p&gt;If we have $(v_1, v_2), (w_1, w_2) \in V$, we connect these two if $v_1 = w_1$ and $v_2, w_2$ are adjacent in $H_2$, that weird graph from before, or alternatively, if $v_2 = w_2$ and $v_1$ is adjacent to $w_1$ in $H_1.$&lt;/p&gt;

&lt;p&gt;If we have $(v_1, v_2) \in V$ and $S \in X$, we draw an edge iff $v_1 \in S$. Note this means that there are a good number of edges, except I don’t really know the size asymptotics of these $H$-graphs, but this definetly fills up the number of edges.&lt;/p&gt;

&lt;p&gt;We don’t connect any elements in $X$ with each other. So this graph looks kind of funny so far. Let $G$ be the resulting graph.&lt;/p&gt;

&lt;p&gt;Now you want to show that $G$ is $(k_1, k_2)$-Ramsey and also that $\delta(G) \leq \max(k_1, k_2)$. It is much harder to prove the first. The second is a more standard argument.&lt;/p&gt;

&lt;p&gt;Let $A$ be some maximal complete subgraph contained in $G$, e.g. $A$ is isomorphic to $K_{\delta(G)}$. If $A$ contains an element from $X$, call it $S$, note it must only contain one element, so the vertices are $S, (v_1, w_1), \ldots, (v_{\delta-1}, w_{\delta-1})$. Note that each $v_i \in S$. If each is distinct, then clearly there are at most $m-1$, so we get the upper bound $\mid A \mid \leq m$. So, say they are not distinct, and reorder it so $v_1 = v_2$. Then we have that $(w_1, w_2)$ is an edge in $H_2$, so they are distinct. Note that for the rest of the vertices, $w_i$ can be at most one of $w_1, w_2$, meaning that to be connected in $A$ it must be that $v_i$ is equal to $v_1$ or $v_2$. Since $v_1 = v_2$, all of the first coordinates are the same, and all $w_i$s must be distinct adjacent vertices in $H_2$. Note that the dimension of $H_2$ was forced to me $m-1$, so $\delta(A) \leq (m-1)+1$.&lt;/p&gt;

&lt;p&gt;In all honesty, reread that. I personally think that’s a very clean proof, though it only really uses the property of $H_2$ having a certain dimension. It also immediately makes it clear how to proceed.&lt;/p&gt;

&lt;p&gt;Instead, if $A$ has no elements of $X$, then its only vertex pairs. Using the same exact argument, you get that the dimension is at most $m-1$ if all of the first coordinates are the same (as $\delta(H_2) = m-1$), or instead we have that the dimension is at most $m$ (as $\delta(H_1) = \delta(G_1 \sqcup G_2) = m$).&lt;/p&gt;

&lt;p&gt;So that’s how you can construct this graph that avoids containing a larger complete subgraph using the parts from $G_1, G_2$. It isn’t as clean as the Ramsey proof, as the sum requires this new external graph with a weird property, which are needed for the final half of the proof.&lt;/p&gt;

&lt;p&gt;Let $(C_1, C_2)$ be a partition of the edges of $G$ into two classes. Let $u$ be a vertex from $H_1$. Then we have an edge between $(u, w_1)$ and $(u, w_2)$ if $(w_1, w_2)$ is an edge in $H_2$. Then define $D_i(u)$ as the set of edges $(w_1, w_2)$ of $H_2$ such that the edge between $(u, v_1), (u, v_2)$ is in $C_i$. Think of this as an intersection operation.&lt;/p&gt;

&lt;p&gt;Note that $(D_1(u), D_2(u))$ partitions the edges of $H_2$. Note again that by definition there are exactly $N$ such partitions. So now we’re going to partition $H_1$ into $N$ classes, by putting $v_1, v_2 \in V_1$ in the same class if they induce the same partition, e.g. $(D_1(v_1), D_2(v_2))$. One of these classes contains a subset $U$ which induces a subgraph isomorphic to $G_1 \sqcup G_2$ with the additional structure from before. Let $U$ be this subset, let $(D_1, D_2)$ be the partition of the edges of $H_2$ that the vertices are labelled with.&lt;/p&gt;

&lt;p&gt;Let $w \in V_2$. Then $U \times {w}$ induces a subgraph of $G$ that is isomorphic to $G_1 \sqcup G_2$ as all the vertices in $U$ are connected in the same way that $G_1 \sqcup G_2$ are. THIS IS THE RAMSEY TYPE SUM ADDITION THAT IS USED BY THE WAY. ALL CAPS FOR IMPORTANCE.&lt;/p&gt;

&lt;p&gt;If there is some $w \in V_2$ that contains some $K_{k_i}$ in this subgraph with all edges in the same class $C_i$, then we are done, as this is the Ramsey property. Otherwise, for all $w \in V_2$, neither $C_1$ or $C_2$ intersected with $G_1 \sqcup G_2$ contain their respective complete graph. Womp womp.&lt;/p&gt;

&lt;p&gt;But now we use the property of $G_1, G_2$. Define $S_1(w), S_2(w)$ for $w \in V_2$ by the set of vertices in $U$ such that $\mid S_i(w)\mid = k_i-1$ and the graph induced by vertex set $S_i(w) \times {w}$ is isomorphic to $K_{k_i}.$ This must happen in the failure case, because $G_1, G_2$ are both Ramsey type, just with minus ones. Note they both must fail at the same time as well.&lt;/p&gt;

&lt;p&gt;Because $k_1, k_2$ might be different, we’re going to instead work with $T_i(w)$, which are the exact same functions, just that they choose a larger subset, e.g. $S_i(w) \subseteq T_i(w) \subseteq U$ and $T_i(w)$ contains $m-1$ elements. This only adds to one of them.&lt;/p&gt;

&lt;p&gt;Note that $T_i(w) \in X$, the subsets of size $m-1$. So now this is actually a vertex inside of the big $G$! Furthermore, note it is adjacent to each of the vertices $T_i(v) \times {w}$ where $w\in V_2$, by definition of edges in $G$ (first element must live inside of the subset).&lt;/p&gt;

&lt;p&gt;If all of these are in the same class $C_i$ for some $w$, then note ${T_i(w)} \cup (S_i(w) \times {w})$ is a $K_{k_i}$, as the second product by definition is a $K_{k_i-1}$ in $C_i$ and all we’ve done is add the necessary edges to bump it up.&lt;/p&gt;

&lt;p&gt;So obviously assume we don’t have that anymore, womp womp. Then for each $w \in V_2$ we have edges of the form ${T_1(w), (u_1(w), v)} \in C_2$ and ${T_2(w), (u_2(w), w)} \in C_1$, where $u_i(w) \in T_i(w)$. Effectively we know that one of the edges is bad, so it’s just in the other class, this is just explicitly writing out that edge.&lt;/p&gt;

&lt;p&gt;Home stretch now kiddos. Note $U$ has the same number of vertices as $G_1 \sqcup G_2$, by definition $M$ is the number of $m-1$ subsets of the vertices, so you can also partition $U$. Note then theere are $(m-1)^2M^2$ ordered quadruples $(u_1, u_2, T_1, T_2)$ where $u_i \in T_i \subset U$ and both $T_1$ and $T_2$ have $m-1$ elements.&lt;/p&gt;

&lt;p&gt;The neat way of labelling here is by partitioning the vertices of $H_2$ by saying $v, w$ are the same iff $(u_1(v), u_2(v), T_1(v), T_2(v))$ are the same for both $v, w$. Using the property of $H_2$, there is some subset $V \subset V_2$ that induces a subgraph isomorphic to $G_3 \in \Gamma(k_1-1, k_2-1)$, and by our labelling, each of them have the same quadruple, say $(u_1, u_2, T_1, T_2)$. I personally feel like this is the most trickery part, as there is so much structure that is kind of ignored (e.g. the $u_i$ here are just elements! such that the edge is there. there might be multiple choices), but that’s kind of why it is nice.&lt;/p&gt;

&lt;p&gt;Note further that $u_1, u_2 \in U$ by construction, so $(D_1(u_i), D_2(u_i))$ are the same as $(D_1, D_2)$. This is a partition of the edges of $G_3$, since its a partition of $H_2$ and induces one onto the subgraph. Note that $G_3$ is $(k_1-1, k_2-1)$-Ramsey, so it contains some subset $W \subseteq V$ such that $W$ is isomorphic to some $K_{k_i-1}$ and contained in $D_i$, note this means it is also contained in $C_i$ as $D_i$ was simply a type of “intersection.”&lt;/p&gt;

&lt;p&gt;Note that ${u_j} \times W$ is isomorphic to some $K_{k_i-1}$ inside of $G$, where $i \neq j$. By definition, the edges from $u_j$ connected to $W$ are in $C_i$. So, now, all that we need to do? Note that $({u_j} \times W) \cup {T_j}$ is isomorphic to a $K_{k_i}$, and all possible edges are inside of $C_i$.&lt;/p&gt;

&lt;p&gt;Because it is almost midnight and I have work in the morning, I will not add pictures to this currently. But by god I’m happy I read this again. I had maybe ~50% of this memorized, and only the big picture parts. I do not yet understand the technical lemma, and would not be able to give a talk on it yet.&lt;/p&gt;

&lt;p&gt;I mentioned him in the talk both for this theorems beauty and to show the sides of mathematicians that aren’t talked about much. Folkman got brain cancer. Erdös and others would visit him in the hospital and give him math problems to boost his spirits. But he felt as though the cancer ate away at his ability to solve the problems. He later committed suicide.&lt;/p&gt;

&lt;p&gt;So if you’re a theoretician, please play. The past 2 years have been full of people who seem so… traumatized by the academic landscape? I do think back to Freedman. Michael Freedman, on his way to his PhD, decided to buy himself a Linear Algebra textbook. He taped it to the wheel as he began the long drive from California to New Jersey, as he had not yet read all of it during his short time at UC Berkeley. The source of this was a topologist I met in Utah. Freedman was also a Topologist, so I’m inclined to believe the source.&lt;/p&gt;

&lt;p&gt;Jupyter Notebooks and the compute they offer are perhaps one of the best gifts to have gotten in the past couple of years.&lt;/p&gt;

&lt;p&gt;If you want to read more, these &lt;a href=&quot;https://www.ias.edu/sites/default/files/Notes12.pdf&quot;&gt;lecture notes from Wigderson&lt;/a&gt; are extraordinarily well done.&lt;/p&gt;

&lt;p&gt;So I really do feel as though I need to give more proper talks, or I need to write a lot more math to feel whole.&lt;/p&gt;

&lt;p&gt;PS - Thank you to Vivian Loh, Yuval Widgerson, Pedro de Oliveira Lengruber Lack, Logan Graves, Peter Bennett, Ailon Goraly. Thank you to Folkman and Erdös.&lt;/p&gt;
</description>
        <pubDate>Mon, 01 Sep 2025 00:00:00 +0000</pubDate>
        <link>https://old.agniv.me/blog/dorm-lectures/</link>
        <guid isPermaLink="true">https://old.agniv.me/blog/dorm-lectures/</guid>
        
        <category>self</category>
        
        <category>math</category>
        
        
      </item>
    
      <item>
        <title>self help jank</title>
        <description>&lt;p&gt;I wrote this while in Utah and revised it while in Utah.&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;h2 id=&quot;a-precursor&quot;&gt;a precursor&lt;/h2&gt;

&lt;p&gt;This is a draft piece that I do not really know what to do with. I wrote it in a day while sitting in Utah because I was tired and wanted to get into the writing flow state.&lt;/p&gt;

&lt;p&gt;If you read this, you will learn little bits and pieces of things I have seen. Much of this feels more descriptive than focused on a singular idea. Specifically the section on Byung-Chul Han feels weak. My selection of bits and pieces reads more like a reading journal rather than deep analysis as of now.&lt;/p&gt;

&lt;p&gt;I know roughly why I’m writing this: it’s to think about what Marvit’s &lt;a href=&quot;https://lachlanm.me/writing&quot;&gt;perception of my style&lt;/a&gt; means for myself.&lt;/p&gt;

&lt;p&gt;Also, some part of me might want to understand analytical philosophy, and how much effort I should be putting into it on a weekly basis.&lt;/p&gt;

&lt;p&gt;Anyway, to start, what is the point of all the maxims?&lt;/p&gt;

&lt;p&gt;Worthwhile to read Bukowski’s &lt;a href=&quot;https://www.goodreads.com/quotes/266525-the-genius-of-the-crowd-there-is-enough-treachery-hatred&quot;&gt;Genius Of The Crowd&lt;/a&gt; and the following quote first:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Beware of thinkers whose minds function only when fuelled by a quotation.
Emil Cioran&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/birb.png&quot; alt=&quot;lowres&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;a-simple-short-argument&quot;&gt;a simple short argument&lt;/h2&gt;

&lt;p&gt;I’m explicitly skipping over the obviously religious ones, because, well, those are loaded with a lot more information and would require its own time and thought.&lt;/p&gt;

&lt;p&gt;There are many accounts on social media platform A that simply take screenshots of other social media platforms B, C, D, X, and crosspost them on A. This practice is usually harmless and funny (I met someone at Oxford who did this), though if it’s art, you definitely should reference the artist.&lt;/p&gt;

&lt;p&gt;However, there are also examples where people take specific highlighted portions of classical literature, poetry, clips from shows, etc. Which seems just as innocuous at first glance.&lt;/p&gt;

&lt;p&gt;But, like, would you crop the Mona Lisa to only her eyes (yeah, probably, it would be kind of cool). There are obvious differences between the mediums (textual/visual), but this question then deals with the basic problem of medium-specific context.&lt;/p&gt;

&lt;p&gt;So, when we take excerpts from texts, we are boiling down life philosophies into their marketable slogans [1]. Existentialism is now existence precedes essence [2], Buddhism is now to lose all worldly desire. These are what are cited in proper academic papers with abandon [3]…&lt;/p&gt;

&lt;p&gt;But… that loses context!&lt;/p&gt;

&lt;p&gt;It would be akin to me telling you a math result being true, smiling, and walking away. You can choose to shrug, continue eating your falafel wrap. But this usually hides all the difficulties under the rug, like tricky equality cases, etc.&lt;/p&gt;

&lt;p&gt;In my opinion, this motivates the existence of proverbs a lot. The sentence itself is the context! You shouldn’t need a 10 page essay to get out of bed in the morning. 10 words is enough.&lt;/p&gt;

&lt;h2 id=&quot;byung-chul-han&quot;&gt;byung-chul han&lt;/h2&gt;

&lt;p&gt;Wait, did I just write in a way to force something to be clearly true? Was I… declarative? Was I leading you somewhere?&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/image0(6).jpg&quot; alt=&quot;attractions&quot; /&gt;&lt;/p&gt;

&lt;p&gt;I’ve known about &lt;a href=&quot;https://aeon.co/essays/thought-tinkering-the-korean-german-philosopher-byung-chul-han&quot;&gt;Byung Chul-Han&lt;/a&gt; for a time. A friend of mine (who is linked in this article), said that he became much more okay with his writings after he acknowledged him as a “poet rather than a philosopher.” There is probably ~some wordcel-ing going on between the two practices, but &lt;a href=&quot;https://allpoetry.com/poem/13343400-Byung-Chul-Han-Statement-by-Ed-Escalante&quot;&gt;a good number of others have a similar take&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Anyway, he’s able to depict modern day feelings in simple words, which is somewhat &lt;a href=&quot;https://global.oup.com/academic/product/the-body-in-pain-9780195049961&quot;&gt;nontrivial&lt;/a&gt;. I would guess it’s because he doesn’t feel the need to write for any specific (academic) audience, to overload phrases with longer and longer words made up in the past few decades. I believe there’s also a quote wherein he calls poems “magic ceremonies of language” where “the poetic does not produce, in poems we enjoy language itself.”⁠&lt;/p&gt;

&lt;p&gt;The quote that has stayed memorized in my mind for a few years now was from an interview:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Why do you write a 1,000-page book if you can enlighten the world in a few words? A 1,000-page book, which has to explain what the world is about, perhaps cannot express as much as a single haiku can.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Small tangent, but it’s incredible that so much of South/East/South-East Asia have their own “short” poetic forms. Haiku, Gushi, Lục bát, Sijo, Dwipadika to list very few. Continuing.&lt;/p&gt;

&lt;p&gt;He explicitly writes in a “this-is-so” way, which simultaneously makes it easier to argue for and against him. I dunno. Literature is hard and you must keep track of the author’s axioms, so it is nice that he writes them on full display.&lt;/p&gt;

&lt;p&gt;I would write a critique of him here, but that is not the main focus of this piece. Rather, the most clear-cut critique of Hans online is probably Wark’s &lt;a href=&quot;https://www.versobooks.com/blogs/news/4283-byung-chul-han-shanzhai-theory&quot;&gt;Shanzai Theory&lt;/a&gt;. TL;DR if you simplify things down too much into binaries it kinda sucks [4], and you should challenge some norms from time to time. I am simplifying here. I do not feel like a challenger in this essay.&lt;/p&gt;

&lt;p&gt;So, is simplicity good?&lt;/p&gt;

&lt;h2 id=&quot;is-it-all-just-pretty-words&quot;&gt;is it all just pretty words&lt;/h2&gt;

&lt;p&gt;Did you know that the name of someone who studies proverbs is a paremiologist?&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/IMG_1357.PNG&quot; alt=&quot;nerds&quot; /&gt;&lt;/p&gt;

&lt;p&gt;I have no idea who chose that name. But it’s surely what Mieder is, after writing the &lt;a href=&quot;https://virtualmmx.ddns.net/gbooks/ProverbsAHandbook.pdf&quot;&gt;Proverb Handbook&lt;/a&gt;. One of the (soft) definitions of a proverb he brings up is:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;[a proverb] expresses what is apparently a fundamental truth-that is, a truism,-in homely language, often adorned, however, with alliteration and rhyme.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We are getting to Lachlan’s agniv-core writing style here!&lt;/p&gt;

&lt;p&gt;I’m brought back to early primary school where you memorized things with mnemonics, and it’s exactly the same. These themselves are not usually seen as proverbs, but Mieder is of the type to say ‘well, definitions are hard, and you have a good vibe sense after reading this far, hopefully’ (don’t worry, he actually goes through many, many definitions used in practice).&lt;/p&gt;

&lt;p&gt;So far, I don’t think I’ve made meaningful progress on the question of “why proverbs?”&lt;/p&gt;

&lt;p&gt;Thankfully, Mieder explains the &lt;em&gt;effect&lt;/em&gt; of a proverb: they “can at times hit people like a hard brick with their continuous claim of moral authority and didactic intent.”&lt;/p&gt;

&lt;p&gt;We’re getting back to that Hans style of writing, the ‘this-is-so’. Proverbs are nice because they summon this rough amount of moral authority with very little effort.&lt;/p&gt;

&lt;p&gt;How does one quantify the effort? I’m not totally sure, but a nice path would be to look at the reference to Norrick’s &lt;a href=&quot;https://www.jstor.org/stable/4167959&quot;&gt;How Proverbs Mean&lt;/a&gt;, which explains the notion of the ‘kernel’ of a proverb being something like the ‘minimum text needed to reconstruct it.’ Think about modern day meme formats such as “AAA on my BBB till I CCC” and “I’m the XXX alive, YYY, you’re clearly XXX-er.” Those are proverbic kernels [5]!&lt;/p&gt;

&lt;p&gt;One could in fact argue that these madlib-esque kernels are the proverbs themselves, with the more (funny) memes being kernels with nonsensical madlibs.&lt;/p&gt;

&lt;p&gt;Ultimately, we like them!&lt;/p&gt;

&lt;h2 id=&quot;quick-recap&quot;&gt;quick recap&lt;/h2&gt;

&lt;p&gt;So, we like simple short excerpts because of their ease of remembrance (mnemonic structure), being self-reliant (no external context needed), and their moral authority.&lt;/p&gt;

&lt;p&gt;Some people write their own new ones. The one that I stumbled upon while writing this was Geary’s &lt;a href=&quot;https://jamesgeary.com/aphorisms/&quot;&gt;own list&lt;/a&gt;, with my favorites being:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Young people should picnic in active volcanoes.&lt;br /&gt;
You must understand a thing completely before you can safely ignore it.&lt;br /&gt;
To get your foot in the door, first get it out of your mouth.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;img src=&quot;https://i.imgflip.com/1a0zur.jpg&quot; alt=&quot;laval&quot; /&gt;&lt;/p&gt;

&lt;p&gt;I do think this makes it very clear that not all proverbs are going to stick with people. And that’s fine! The language I know and love is not the language you know and love.&lt;/p&gt;

&lt;p&gt;Is “I love you” a proverb?&lt;/p&gt;

&lt;h2 id=&quot;self-help&quot;&gt;self help?&lt;/h2&gt;

&lt;p&gt;The title of this is about self-help books. What were the maxims for?&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://sive.rs/images/treetroll.jpg&quot; alt=&quot;sivers&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Ultimately, this was just a long-winded way for me to get at my thoughts on Siver’s &lt;a href=&quot;https://sive.rs/h&quot;&gt;How To Live&lt;/a&gt;. I like his essays a lot and his life story [6]. He also writes in the Hans ‘this-is-so’ style, and also considers himself a slow thinker, but is much more a blogger than an essayist in my mind (ah! another word-cel that I will not think about).&lt;/p&gt;

&lt;p&gt;I texted some friends that I wanted to sit down and read and maybe memorize some bits and pieces. They then sent the chapter titles back and asked if it truly said anything.&lt;/p&gt;

&lt;p&gt;This is why I started with an explanation of proverbs. See the list below:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Be independent, Commit, Fill your senses, Do nothing, Think super-long-term, Intertwine with the world, Make memories, Master something, Let randomness rule, Pursue pain, Do whatever you want now, Be a famous pioneer, Chase the future, Value only what has endured, Learn, Follow the great book, Laugh at life, Prepare for the worst, Live for others, Get rich, Reinvent yourself regularly, Love, Create, Don’t die, Make a million mistakes, Make change, Balance everything, Conclusion&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Are these proverbs? Well, probably.&lt;/p&gt;

&lt;p&gt;Imagine each tagline as being the axiom, some of those 10 words you whisper to yourself as you get out of bed in the morning.&lt;/p&gt;

&lt;h2 id=&quot;now-wait-a-second-what-are-the&quot;&gt;now wait a second what are the&lt;/h2&gt;

&lt;p&gt;Yeah, there’s a lot of different life philosophies he’s pointing out here.&lt;/p&gt;

&lt;p&gt;Most reviews on the main page are of the format “well, none of these are wrong, and that makes me… wistfully happy for the future.” [7]&lt;/p&gt;

&lt;p&gt;You can pair a lot of these taglines and get an inherent contradiction. This is inherently the strength of Siver’s piece, that he is giving you 25+ polemics that are all somewhat true in a vague sense and asking you to pick and choose the truest bits, allowing you to choose contradictory ones if needed.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;The test of a first-rate intelligence is the ability to hold two opposed ideas in mind at the same time and still retain the ability to function.&lt;br /&gt;
F. Scott Fitzgerald&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;But also, with a surprising throwback to Ellison’s Invisible Man, see the &lt;a href=&quot;https://books.google.com.gt/books?id=40ySAgAAQBAJ&amp;amp;pg=PA121&amp;amp;lpg=PA121&amp;amp;dq=first+rate+intelligence+fitzgerald+orwell&amp;amp;source=bl&amp;amp;ots=e5jW3K0S3g&amp;amp;sig=ACfU3U01ot5ROHTualKZkfEfimIQyNpHZg&amp;amp;hl=en&amp;amp;sa=X&amp;amp;ved=2ahUKEwjThMSbhPHpAhWJZd8KHSz3D7wQ6AEwA3oECGMQAQ#v=onepage&amp;amp;q=first%20rate%20intelligence%20fitzgerald%20orwell&amp;amp;f=false&quot;&gt;following excerpt&lt;/a&gt;. A first-rate test of intelligence is that of hope in spite of it all, perhaps.&lt;/p&gt;

&lt;p&gt;Contradictions give way to balance.&lt;/p&gt;

&lt;p&gt;Granted, I will focus on the ‘obvious’ painful section. Do nothing.&lt;/p&gt;

&lt;h2 id=&quot;doing-something-about-doing-nothing&quot;&gt;doing something about doing nothing&lt;/h2&gt;

&lt;p&gt;It starts out calm, stating that most commandments and laws are about what &lt;em&gt;not&lt;/em&gt; to do, and goes into examples of what happens if you try.&lt;/p&gt;

&lt;p&gt;It’s somewhat related to the Buddhist tagline from before about losing worldly desires. He writes to “change your need to change things.”&lt;/p&gt;

&lt;p&gt;But the argument for me falls short when he says not to hope. Then it picks back up when he states that silence adds to the importance of your own speech.&lt;/p&gt;

&lt;p&gt;By the end of reading it, it’s significantly easier to like it. “Marriage doesn’t make you secure,” “You don’t need a beach to feel tranquility.”&lt;/p&gt;

&lt;p&gt;This feeling that parts of it are off and some of them are on are captured by the last line.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Doing nothing is how to live and how to die.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2 id=&quot;all-the-maxims&quot;&gt;all the maxims&lt;/h2&gt;

&lt;p&gt;Other than that section, I find it kind of hard to write a book review for it. Not because my analysis itself is orc-ish (see &lt;a href=&quot;https://old.agniv.me/blog/poems-hilary-25/&quot;&gt;excerpts&lt;/a&gt;), but because of the ‘this-is-so’ style. You simply agree with it or don’t, and which way you land depends on the life that you have lived. Some bits for me are… wow, super bad. It’s very clearly a polemic. But others are incredibly good.&lt;/p&gt;

&lt;p&gt;Instead, I think I’ll pick out the excerpts that I liked. If you want to know why I liked them, email me, though I’ll put some bits and pieces there.&lt;/p&gt;

&lt;h3 id=&quot;time-related&quot;&gt;Time Related&lt;/h3&gt;

&lt;p&gt;Life is full of time. How should you spend it?&lt;/p&gt;

&lt;div class=&quot;language-md highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Quit a harmless habit for a month, just to prove you can. 
(Be Independent. Reminded me of Erdős)

If you knew you’d go blind tomorrow, 
how intensely would you look at the world today? 
(Fill your senses)

Greenland used to have grass, 
but early settlers let their sheep graze, 
and it never grew back. 
A few short-term decisions can lead to centuries of destruction. 
(Think super-long-term. Greenland is insane topographically)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;So, ultimately, mess around, but think about the future a bit. Further reading from Tang in &lt;a href=&quot;https://leonardgentwintang.medium.com/life-is-gradient-descent-a-plea-against-short-term-overoptimization-671f4147b01f&quot;&gt;Life is Gradient Descent&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id=&quot;personal-related&quot;&gt;Personal Related&lt;/h3&gt;

&lt;p&gt;I have done a few community based endeavours and they were all good. How do you connect with people?&lt;/p&gt;

&lt;div class=&quot;language-md highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;If you sincerely appreciate someone, 
and really engage with their interests, 
you will become friends. (For Others.)

A sincere compliment can put a lot of fuel in someone’s tank. 
(For Others.)

But ideally, when with others, be the same person you’d be when alone. 
(Love.)

But nobody will save you. You have to fill those gaps yourself. 
(Love.)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Become self assured. Be good vibes.&lt;/p&gt;

&lt;h3 id=&quot;locking-in-related&quot;&gt;Locking In Related&lt;/h3&gt;

&lt;p&gt;Self explanatory.&lt;/p&gt;

&lt;div class=&quot;language-md highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;If you haven’t decided what to master, 
pick anything that scares you, fascinates you, or infuriates you. 
(Master something. Combinatorics)

Focus fully on whatever fascinates you now. 
(Do whatever you want now. Combinatorics)

People say they’re not doing the work because it’s hard. 
But it’s hard because they’re not doing the work. 
(Pursue Pain. Seinfeld has a joke about the structure of this.)

Don’t wish for good luck. Good luck makes you complacent. 
(Pursue Pain. Jesus College, the students would say &quot;good skill&quot; before exams.)

Calling yourself creative doesn’t make it true. 
(Create.)

Internalize it. Don’t expect to just look it up when you need it. 
(Learn.)

Win by not losing. (Don&apos;t Die.)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The things that you feel emotions about are probably the things you should put more effort into. Make sure that you know why you have those emotions, even if they’re the ones telling you that it’s hard. See the &lt;a href=&quot;https://www.jean.land/objects/advice.html&quot;&gt;writing advice&lt;/a&gt; from jean.land.&lt;/p&gt;

&lt;h3 id=&quot;emotions-related&quot;&gt;Emotions Related&lt;/h3&gt;

&lt;p&gt;Alexithymia is a neurological condition that makes it hard for people to communicate with their own emotions, occurring at about 10% in the total general population.&lt;/p&gt;

&lt;div class=&quot;language-md highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Practice feeling emotions intentionally, 
instead of using actions to create them. 
(Do Nothing. Many conversations with https://daystareld.com/)

Befriend discomfort so that you’ll never fear it. 
(Prepare for the Worst.)

Humor is the spirit of life — a sign of a healthy, 
vibrant mind and soul. (Laugh at Life.)

Learning is loving. (Love.)

Flirting and romance is like eating dessert first. 
After you come down from the sugar rush, 
you get to the more nourishing part of the meal. (Love.)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Live, laugh, and maybe even love. Never shy away from the bad bits, for you evolved to have negative emotions for certain reasons. Figure them out!&lt;/p&gt;

&lt;h3 id=&quot;world-related&quot;&gt;World Related&lt;/h3&gt;

&lt;p&gt;You are one with a world and that’s crazy. Maybe in our lifetimes we will change this philosophy of being earth-centric to being universe-centric.&lt;/p&gt;

&lt;div class=&quot;language-md highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;In Icelandic, the word for “idiot” means 
“one who has never left home to journey abroad”. 
(Intertwine with the world. Linguistic tidbits!)

Document everything, or you’ll eventually forget it. 
(Make memories. Reminds me of an old essay I wrote.)

Pioneers have a massive impact on the world 
because their stories help people do things 
they wouldn’t have dreamed of otherwise. 
(Be a famous pioneer. Ruriko Yoshida)

Before trying to improve something old, 
find out why it is the way it is. 
Never assume people in the past were ignorant. 
(Value only what has endured.)

When you’re gone, your work shows who you were. 
(Create.)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The world is big. Keep track of it! Be active in it!&lt;/p&gt;

&lt;h3 id=&quot;practical-advice-related&quot;&gt;Practical Advice Related&lt;/h3&gt;

&lt;p&gt;Money.&lt;/p&gt;

&lt;div class=&quot;language-md highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;The world is full of money.
There’s no shortage.
So capture the value you create.
Charge for what you do.
It’s unsustainable to create value 
without asking anything in return.
Remember that many people like to pay. 
(Get Rich. Very American!)

You only need to get rich once. 
(Get Rich.)

Jump into action without hesitation or worry. 
(Make a Million Mistakes.)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It is surprisingly powerful to realize you only need to get rich once.&lt;/p&gt;

&lt;h3 id=&quot;balance-related&quot;&gt;Balance Related&lt;/h3&gt;

&lt;p&gt;This is actually a section within his book by itself, but I thought I would put a few together.&lt;/p&gt;

&lt;div class=&quot;language-md highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;You think you want more choice and more options. 
But when you have unlimited choice, you feel worse. 
(Commit. US College course catalogs are insane!)

Change your preferences, opinions, and usual responses. 
Try the opposite of before. (Reinvent yourself regularly.)

You have different sides to your personality, with conflicting needs.
Instead of ignoring one, make sure you balance them.
Balance time with others and time alone.
Balance your need for stability with your need for surprise.
Balance input and output, 
consumption and creation, 
stability and adventure, 
body and spirit.
Your opposing needs become each other’s remedy. (Balance Everything.)

Balance human nature. (Balance Everything.)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Extremes exist everywhere, even within flexibility. But, you should definitely learn how to do a pistol squat and the crow position. Balance is a secure feeling.&lt;/p&gt;

&lt;h3 id=&quot;miscellaneous-related&quot;&gt;Miscellaneous (Related)&lt;/h3&gt;

&lt;p&gt;These ones I just like.&lt;/p&gt;

&lt;div class=&quot;language-md highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Need destroys love. (Love.)

Be surprised by something every day. (Learn. https://xkcd.com/1053/)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Good advice.&lt;/p&gt;

&lt;h2 id=&quot;shoutouts&quot;&gt;shoutouts&lt;/h2&gt;

&lt;p&gt;A lot of his advice sometimes follows the framework of “Set up an LLC to handle creative/change-making things so that you can profit and stay alive.” A lot of this practical advice is also captured in Graham’s &lt;a href=&quot;https://paulgraham.com/hs.html&quot;&gt;What You’ll Wish You’d Known&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Special shoutouts:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;to most of &lt;a href=&quot;https://sive.rs/htl06&quot;&gt;Intertwine With The World&lt;/a&gt;.
    &lt;ul&gt;
      &lt;li&gt;I have my own thoughts on travel, strangers, etc, but the simple truth is you just. Have to get out there. I will possibly collect these into their own post, but the writings are from a much younger time.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;to some of &lt;a href=&quot;https://sive.rs/htl07&quot;&gt;Make Memories&lt;/a&gt;.
    &lt;ul&gt;
      &lt;li&gt;Annoyingly video is expensive to store data wise.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;to the way that he wrote &lt;a href=&quot;https://sive.rs/htl09&quot;&gt;Let Randomness Rule&lt;/a&gt; + &lt;a href=&quot;https://sive.rs/htl13&quot;&gt;Chase The Future&lt;/a&gt;
    &lt;ul&gt;
      &lt;li&gt;I like it, but I wouldn’t have written it that way.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;to &lt;a href=&quot;https://sive.rs/htl17&quot;&gt;Laugh at Life&lt;/a&gt;.&lt;/li&gt;
  &lt;li&gt;to all of &lt;a href=&quot;https://sive.rs/htl19&quot;&gt;For Others&lt;/a&gt;.&lt;/li&gt;
  &lt;li&gt;to all of &lt;a href=&quot;https://sive.rs/htl22&quot;&gt;Love&lt;/a&gt;.&lt;/li&gt;
  &lt;li&gt;to all of &lt;a href=&quot;https://sive.rs/htl23&quot;&gt;Create&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In my mind, I spent the past year properly becoming an adult (at time of writing I am a few months away from 19). Some of this advice feels like the transition into adulthood, especially choosing to Master Something.&lt;/p&gt;

&lt;h2 id=&quot;is-love-a-proverb&quot;&gt;is love a proverb?&lt;/h2&gt;

&lt;p&gt;When I write letters for other people, I usually struggle, because no one wants to write just the conventional proverbs. Have a great time, you made it better, etc.&lt;/p&gt;

&lt;p&gt;Proverbs, when overused, lose their meaning, in the same way that saying the same word many times degrades it into noise.&lt;/p&gt;

&lt;p&gt;So I would give words and phrases that reminded me of them. Epithets I saw them in. Lerp. Blinking. Petrichor. Separatrix.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/sepera.png&quot; alt=&quot;sep&quot; /&gt;&lt;/p&gt;

&lt;p&gt;I wrote love letters for my friends, and some wrote them back. I do not have them on me (memorized/some are paper), so it does not feel fair to put quotes from the ones I do have on hand. However, I will put one:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Despite always being on a Quest, Agniv is incredibly good at making his loved ones feel loved.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And so I have won, if only a little.&lt;/p&gt;

&lt;p&gt;So make your own proverbs. Your own aphorisms. Acknowledge when you invoke a polemic by smiling like crazy. And live.&lt;/p&gt;

&lt;h2 id=&quot;how-to-live&quot;&gt;how to live&lt;/h2&gt;

&lt;p&gt;Get rich once. Love and Create for Yourself and Others. Travel, to Intertwine with the World. Do not accumulate Ego, but Make Memories. Make sure to Laugh at Life.&lt;/p&gt;

&lt;p&gt;It’s a little more than 10 words. But it gets the job done.&lt;/p&gt;

&lt;h2 id=&quot;conclusion&quot;&gt;conclusion&lt;/h2&gt;

&lt;p&gt;I don’t think language is that deep unless you make it so. The things we choose to say can say a lot. Concision is good.&lt;/p&gt;

&lt;h2 id=&quot;footnotes&quot;&gt;footnotes&lt;/h2&gt;

&lt;p&gt;Imagine ending this by saying concision is good and then having. A yap session in the footnotes. Yikes. I do not currently have good footnote integration on my blog, so I apologize!&lt;/p&gt;

&lt;p&gt;[1] - Looking back at this, I wonder if it’s just the axioms that are paraded, but not inherently the results. I don’t think anyone goes around calmly saying V=L, or EATS (every Aronszajin tree is special). Barring maybe the logicians.&lt;/p&gt;

&lt;p&gt;[2] - One of the first philosophy essays I read and loved was Barad’s &lt;a href=&quot;https://philosophy.as.uky.edu/sites/default/files/Blade%20Runner%20and%20Sartre%20-%20The%20Boundaries%20of%20Humanity%20-%20Judith%20Barad.pdf&quot;&gt;Blade Runner and Sartre&lt;/a&gt;, because it proved to me that art was not dead. It’s a nice blend of analytical philosophy (Sartre’s view on Descarte), a slight touch of computation (Turing), and literary analysis (the VK test, visually human, etc.). A recent essay that came out on my birthday from Shanahan, called &lt;a href=&quot;https://link.springer.com/rwe/10.1007/978-3-319-97134-6_43-3&quot;&gt;What does it mean to be Human?&lt;/a&gt;, does mention BR’s director distancing “himself from the idea that the film was ever intended to have any philosophical significance whatsoever,” lol.&lt;/p&gt;

&lt;p&gt;[3] - Though, you, as the reader, should critically engage with it, and therefore should probably go into the text! I somewhat disagree with &lt;a href=&quot;https://www.gleech.org/ignorance&quot;&gt;Gavin’s take on ignorance&lt;/a&gt; as advice for people who have the time/funding to be able to look at it all (usually young people!). For people in grad school… well, I’m simulating that right now, but that’s another story.&lt;/p&gt;

&lt;p&gt;[4] - This made me think about the &lt;a href=&quot;https://www.arvindguptatoys.com/arvindgupta/hedgehog-berlin.pdf&quot;&gt;The Hedgehog and the Fox&lt;/a&gt; essay by Berlin, specifically the line “Of course, like all over-simple classifications of this type, the dichotomy becomes, if pressed, artificial, scholastic, and ultimately absurd.” We say this so many times in life because… simple!&lt;/p&gt;

&lt;p&gt;[5] - The mathbrain and csbrain in my head kind of dislikes this utilization of kernel, but I digress. Also, any modern day meme-researcher would probably benefit from reading more about paremiology because it seems like the same pattern, and vice versa.&lt;/p&gt;

&lt;p&gt;[6] - A friend of mine &lt;a href=&quot;https://mishra.farm/&quot;&gt;really likes rats&lt;/a&gt;. So does &lt;a href=&quot;https://sive.rs/rats&quot;&gt;Sivers now&lt;/a&gt;. He also was a California native before moving to New Zealand, and I love islands.&lt;/p&gt;

&lt;p&gt;[7] - Not all of them, see Zachar’s “Mr. Sivers always has interesting points to make. His observations are always uplifting.”&lt;/p&gt;

&lt;p&gt;PS - Most of the links here are formatted with respect to &lt;a href=&quot;https://www.w3.org/QA/Tips/noClickHere&quot;&gt;Swartz’s advice&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;PSS - You should try and memorize your favorite poems. Does wonders for the brain. The longer the harder sometimes the better. Do it for yourself! You can do it for others too, and even win money (I have never been to &lt;a href=&quot;https://thestarryplough.com/wednesday-berkeley-poetry-slam/&quot;&gt;Berkeley’s Poetry Slam&lt;/a&gt; but it looks so cool).&lt;/p&gt;

&lt;h2 id=&quot;revisions&quot;&gt;revisions&lt;/h2&gt;

&lt;p&gt;As I said, this was in a draft format. This means it is subject to change, and if you have things to point out about the analysis (where I am wrong, how to improve it, etc) or you have questions, you can simply email me. Thanks!&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/image.png&quot; alt=&quot;birb&quot; /&gt;&lt;/p&gt;
</description>
        <pubDate>Wed, 09 Jul 2025 00:00:00 +0000</pubDate>
        <link>https://old.agniv.me/blog/self-help/</link>
        <guid isPermaLink="true">https://old.agniv.me/blog/self-help/</guid>
        
        <category>self</category>
        
        <category>draft</category>
        
        
      </item>
    
      <item>
        <title>Excerpts from Hilary 25</title>
        <description>&lt;p&gt;See &lt;a href=&quot;https://old.agniv.me/assets/pdfs/25_hilary.pdf&quot; target=&quot;_blank&quot;&gt;this pdf&lt;/a&gt;. I ended the last &lt;a href=&quot;https://orchard.day&quot;&gt;orchard&lt;/a&gt; session in Hilary ‘25 by reading this.&lt;/p&gt;

&lt;p&gt;This has Michelle Cliff’s “Spirit of a Place,” Rilke’s “Letters to a Young Poet,” Danez Smith’s “I’m going back to Minnesota where Sadness Makes Sense,” Mary Oliver’s “Wild Geese,” Rilke’s letter to Lou Andreas-Salomé, Rilke’s “Turning,” a 1950s essay from Beauvoir, Elizabeth Bishop’s draft of “One Art,” Ken Liu’s “The Paper Menagerie,” Denise Levertov’s “February Evening in New York,” and Mary Oliver’s “How I go into the Woods.”&lt;/p&gt;

&lt;p&gt;A poem that is criminally not in this PDF is Mary Oliver’s “The Sun.”&lt;/p&gt;

&lt;p&gt;I’m not putting my analysis of these poems here, since my analysis feels &lt;a href=&quot;https://64.media.tumblr.com/e8d43c6a4789a7ddc7b4acf593cf2f63/fd050981384d5faa-6a/s1280x1920/2ba5ae02eb188f67c0cdacae10e5c03ab2e5605a.png&quot;&gt;ogre-ish&lt;/a&gt; and personal. I liked these, and felt as though some of the pictures resonated with the excerpts. There is a mix of winter and warmth, of forcing and unforcing, of seeing and percieving, of loss and life.&lt;/p&gt;

&lt;p&gt;I notice the consumption of art more while I am in Oxford because it is distinctively not my subject (math/cs) and it makes it feel more intentional.&lt;/p&gt;
</description>
        <pubDate>Thu, 05 Jun 2025 00:00:00 +0000</pubDate>
        <link>https://old.agniv.me/blog/poems-hilary-25/</link>
        <guid isPermaLink="true">https://old.agniv.me/blog/poems-hilary-25/</guid>
        
        <category>poetry</category>
        
        
      </item>
    
      <item>
        <title>Mar-Apr 25 Journal Entries</title>
        <description>&lt;p&gt;A friend of mine (&lt;a href=&quot;https://www.linkedin.com/in/jacob-meyer-cohen&quot;&gt;Jacob&lt;/a&gt;) wrote an essay on &lt;a href=&quot;https://fitzcarraldoeditions.com/books/alphabetical-diaries/&quot;&gt;Alphabetical Diaries&lt;/a&gt;, which is an interesting book because the author was able to craft a coherent story by shuffling around her writing in her journal.&lt;/p&gt;

&lt;p&gt;I also recently read &lt;a href=&quot;https://en.wikipedia.org/wiki/Chemistry_(novel)&quot;&gt;Chemistry&lt;/a&gt; because another friend had mentioned it to me (almost in passing) and it is another book that is structured like a journal that I found quite moving. I agree mostly with my friend’s (&lt;a href=&quot;https://www.goodreads.com/review/show/5675600947&quot;&gt;Gavin&lt;/a&gt;) review, where his 3/5 translates to “good, won’t reread.” I wrote down the words:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;It is a mass of text. I didn’t realize it was fiction until I read more about the author on the side.&lt;/p&gt;

  &lt;p&gt;I say mass because you hold the book and it weighs you and asks you: do you really want to go to grad school, do you really want to fall in love, do you really want to understand it all?&lt;/p&gt;

  &lt;p&gt;Above all else? Have a dog.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I don’t use goodreads because I would embarrass myself. But on this site I’m okay with a little bit of &lt;a href=&quot;https://mishra.farm/posts/silly&quot;&gt;silliness&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;But anyway, I thought I would do something similar. I wrote a journal from March 15th to April 11th of 2025, or the vacation days between Hilary and Trinity term of Oxford in 2025. Originally, I wanted to put it in here in it’s entirety, but I realized that it had become too personal and long to do that well.&lt;/p&gt;

&lt;p&gt;So I’m picking a few sentences from each day instead. Here it is.&lt;/p&gt;

&lt;h2 id=&quot;precursor-to-the-journal&quot;&gt;Precursor to the Journal&lt;/h2&gt;

&lt;p&gt;I shared this journal with others, so I felt the need to have a precursor.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;I’m not actually putting most of my academic stuff here, as that is seperate to this journal. Also, this is kinda ugly! That’s all right! And finally, I’m lucky I get to feel like I’m living at the right place, in the right time, with the right people.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2 id=&quot;journal-start&quot;&gt;Journal Start&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;March 15th:&lt;/em&gt; Flew back with &lt;a href=&quot;https://www.linkedin.com/in/xi-da/?originalSubdomain=uk&quot;&gt;Xi&lt;/a&gt;, and it was really, really fun, and I would definitely want to travel more with friends.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;March 16th:&lt;/em&gt; We (&lt;a href=&quot;https://www.jinglinl.com/home&quot;&gt;Jinglin&lt;/a&gt; and I) ran to Target and bought some stuff. I spent 25 USD on &lt;a href=&quot;https://ong.ac/&quot;&gt;Euan’s&lt;/a&gt; birthday, and we got a bunch of stuff! […] I got us Starbucks drinks because I still had free credits though I think both of our stomachs regretted this. […] At &lt;a href=&quot;https://playspace.club/&quot;&gt;Playspace&lt;/a&gt; I met with &lt;a href=&quot;https://substack.com/@shy0&quot;&gt;Sasha&lt;/a&gt; for the first time and also &lt;a href=&quot;https://jzhao.xyz/&quot;&gt;Jacky&lt;/a&gt;, who gave me his guitar to play during the session.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;March 17th:&lt;/em&gt; I went to the hospital to get my arm checked. I thought it was for my right arm, as that’s the arm that feels alien, but it was actually for my left arm, which had been feeling quite normal. Genuinely feels quite full. I don’t think my right arm will ever feel fully normal.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;March 18th:&lt;/em&gt; This was a sidequesting day. I went on a walk after lunch to Gunn. I spent maybe 3 and a half hours there. […] I started to walk back, then I realized I forgot my glasses at Gunn, so I walked back, and saw Josh. He’s probably entering Math+CS at St. Johns and it was nice to see him be happy. […] Then I went to the Stanford Gym. I spent 4 hours at Stanford. […] Jacob kidnapped me, and I had dinner at his place at FloMo. He’s doing good.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;March 19th:&lt;/em&gt; I drove over to &lt;a href=&quot;https://www.benjaminvakil.com/&quot;&gt;Ben’s&lt;/a&gt; house and we talked about math, […] Then I used my bike from elementary school to bike to Stanford Gym. It was kind of silly to bike on it since it’s so freaking small!!! Like, what the hell!!! It’s honestly a harder workout, lol.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;March 20th:&lt;/em&gt; I worked on a hard bonus problem and felt satisfied. Texted a &lt;a href=&quot;https://picogilman.github.io/&quot;&gt;friend&lt;/a&gt; who said “trivial by complex analysis,” but I didn’t feel satisfied by the answer he had in his notes, since it skipped over a lot of the small tidbits (why does it converge? etc). Like, yes, it’s obvious, that’s the whole point. (Update: Never mind it is trivial by complex analysis.)&lt;/p&gt;

&lt;p&gt;&lt;em&gt;March 21st:&lt;/em&gt; Biked to the Caltrain station, which was crazy, because, like, whoa! I could’ve done that all of high school! […] Went and got lunch with &lt;a href=&quot;https://mishra.farm/&quot;&gt;Ritik&lt;/a&gt;. It had been 3 years since &lt;a href=&quot;https://www.linkedin.com/in/ajitbanerjee/&quot;&gt;Ajit&lt;/a&gt; emailed us together. I think I’ve changed a startling amount in those three years […] I wanted to get dinner with another friend (maybe this is hypersocial), but had to postpone that since I needed to drive my dad to the airport.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;March 22nd:&lt;/em&gt; My brother drove us to an Indian Restaurant. I’ve never actually really loved idli. You always need to eat it with sambar, but sometimes the sambar is too chunky, or the idli is not spongy, and it feels like there’s too much going on. But I’ve always liked medu vada, whoops.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;March 23rd:&lt;/em&gt; Stumbled on to &lt;a href=&quot;https://gamedevmap.com/&quot;&gt;gamedevmap.com/&lt;/a&gt; which was such an insane find! Like, whoa! […] We (Spencer and I) went on a walk immediately after dinner and walked to Stanford. It was a long walk. A lot of talking. About people, college, mathematics. Some philosophy here and there. It had good vibes.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;March 24th:&lt;/em&gt; Slow, calm day. Genuine love for &lt;a href=&quot;https://www.cs.ox.ac.uk/teaching/courses/2024-2025/ContMath/&quot;&gt;continuous mathematics&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;March 25th:&lt;/em&gt; I had to speedbike to the dentist’s office. He flamed me for not regularly flossing then admitted he only really started after he graduated college.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;March 26th:&lt;/em&gt; Finished a problem and then biked over to the gym EARLY. […] Started to Bike back and saw &lt;a href=&quot;https://physics.stanford.edu/people/emmanuel-zheng&quot;&gt;Emmanuel&lt;/a&gt;. Said hi! He went to swim. It was a really nice day to swim. Stopped by &lt;a href=&quot;https://www.cohostanford.com/&quot;&gt;CoHo&lt;/a&gt;. Got myself a Horchata though it was aggressively mid. Saw &lt;a href=&quot;https://www.linkedin.com/in/sasha-luchyn-7133482a0/&quot;&gt;Sasha&lt;/a&gt;! He was getting breakfast… at 2 pm. Both of these small interactions put dumb smiles on my face. I love the college environment for that vibe.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;March 27th:&lt;/em&gt; It was raining, so &lt;a href=&quot;https://fencingtracker.com/p/100258903/Nathan-Ming&quot;&gt;Nathan&lt;/a&gt; picked me up and we drove. […] We got lunch at a dorm.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;March 28th:&lt;/em&gt; I took Caltrain up to SF and then called &lt;a href=&quot;https://vvvincent.me/&quot;&gt;Vincent Cheng&lt;/a&gt;. […] I used a BayWheels to get to the meeting. On the way I passed by a playground I had visited in middle school. It brought back a surprising amount of feelings and memories and I am grown.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;March 29th:&lt;/em&gt; Not much I can say about the day.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;March 30th:&lt;/em&gt; I got back on the route that I used to walk to school every day. It felt strange doing it in reverse, since I usually did a different route on the way back, but it was nice. I saw the big, big wall of art. And I love it.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;March 31st:&lt;/em&gt; I watched an &lt;a href=&quot;https://www.youtube.com/@Acerola_t&quot;&gt;Acerola&lt;/a&gt; video on a topic that I already knew and it was cool to see.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;April 1st:&lt;/em&gt; My mom joked I had a huge bug on my back, so I slowly rammed myself into the wall. She laughed. […] I went climbing. I think I was angry at my shoulder, but it handled fine. It was April Fools, so everything was labeled a V4. […] I showered and got back to work. April 1st was a soft day of self.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;April 2nd:&lt;/em&gt; It was another day of sidequesting, though not as complete? I worked on my notebooks (mathematical ones) and they feel fleshed out. […] I also saw someone that at first I wasn’t sure where I recognized from, but then I remembered that they were someone I had seen at Oxford! […] On the way back, I saw &lt;a href=&quot;https://www.linkedin.com/in/michelle-meishan-to/&quot;&gt;Michelle To&lt;/a&gt;! […] I definitely need better time management with going to the gym. Currently I just throw my body at things and I’m happy that it responds well.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;April 3rd:&lt;/em&gt; I got through more of the technical stuff and began listing down important stuff I had skipped. […] I got lemonade at CoHo. Super tasty.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;April 4th:&lt;/em&gt; Cooked for my mom. Biked to the gym. […] I biked to CoHo and waited for Jacob. I got a strawberry matcha since I was wearing red &amp;amp; green as well. […] I biked back, but went through the park on the way back, since there were no cars. I saw Michael Wang (I’ve known him for 7 years) and Riley (his dog!)! […] I showered when I got back and finished the proof. It feels like things click once you get them done, you know? You kind of understand the importance even more, even if no one has told you explicitly.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;April 5th:&lt;/em&gt; I played a little more Balatro. It is addictive. Shyuab and Charles texted me about this because Discord exposed me. […] I drove my family to the gym and I swam. It was my first time swimming in forever (possibly since going diving?). I just did breaststroke because I still don’t trust my shoulder. It felt good.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;April 6th:&lt;/em&gt; I spent most of this day hunched at my chair, finishing up the exposition and spotting spots for my mistakes and worries.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;April 7th:&lt;/em&gt; I spent an awkward amount of time messing with the latex in markdown. I use Jekyll, which is really only great if you want to put markdown documents that have basic text. This is pretty fine for me, but for latex, it’s really annoying at times. […] Ultimately I got it to work, and it taught me a bit about how to deal with it. The commit messages do get unhinged though, so I definitely couldn’t ever make the repository public. […] &lt;a href=&quot;https://cs.nyu.edu/~anupamg/&quot;&gt;Prof. Gupta&lt;/a&gt; emailed me back and asked why you couldn’t just use &lt;a href=&quot;https://en.wikipedia.org/wiki/Horner%27s_method&quot;&gt;Horner’s Rule&lt;/a&gt;, which is a very reasonable question! However, this would require computing the polynomial symbolically from the Circuit to convert it to sparse representation, and would be just as inefficient. So I sent an email, and he understood, and I was happy. […] I helped my brother debug his GPU problems. I do find it really interesting that CUDA errors just make the GPU just screw up terribly instead of gracefully failing. I don’t get why, and that I think shows some limitedness to my thinking.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;April 8th:&lt;/em&gt;  I fried up some food and had lunch with my mom. I biked to the gym early, though I ended up stopping by &lt;a href=&quot;https://scibowl.stanford.edu/people/peter-bennett&quot;&gt;Peter’s&lt;/a&gt; location. It was an International Relations event, with free &lt;a href=&quot;https://saltandstraw.com/&quot;&gt;Salt &amp;amp; Straw&lt;/a&gt; ice cream, which was huge! […] I finished some studying for the night. I feel okay preparing for collections.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;April 9th:&lt;/em&gt; I kind of didn’t want to Journal today. I spent most of today studying. I cooked kimchi pancakes. […] I biked back slowly. My body is so tired. I am not tracking how much sleep I’m getting. During both bike rides I was thinking about the asymptotics of the ‘distinct prime factors’ function. E.g. let dpi(x) give you the number of primes in x’s factorization. How does dpi grow asymptotically? Obviously dpi(x) &amp;lt;= log_2(x), since the smallest a prime can be is 2, and so you maximize the number of primes by setting them all to 2. But this is clearly quite bad! I would be very surprised if this isn’t already somewhere in the literature. In fact, once I got home, I checked OEIS and found: &lt;a href=&quot;https://oeis.org/A001221&quot;&gt;oeis.org/A001221&lt;/a&gt;. It gives you the average order is significantly slower than just logarithmic: The average order of dpi(n) is asymptotic to log(log), more specifically, Sum_{k=1..n} dpi(k) ~ Sum_{k=1..n} log log k. What surprises me is that this is from 2015. It’s a very natural question that I’m surprised the reference came out so late, since it feels like a result you can try and attack using standard techniques. I’m further confused, because this &lt;a href=&quot;https://www.imsc.res.in/~rao/ramanujan/CamUnivCpapers/Cpaper35/page1.htm&quot;&gt;reference from Hardy &amp;amp; Ramanujan&lt;/a&gt; gives it? This might just be one of those things with OEIS where the documentation always leaves a little something to be desired. I also find it both reasonable and quite beautiful that both the distinct prime factor counting and the overall prime factor counting have the same overall order. The generating function is quite immediate as well. I studied and showered at home.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;April 10th:&lt;/em&gt; More studying. It’s fun! […] I got home and reviewed my brother’s work and studied.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;April 11th:&lt;/em&gt; This is my last journal entry. […] I biked back to say hi to Jacob. We went to a talk from &lt;a href=&quot;https://en.wikipedia.org/wiki/Tadashi_Tokieda&quot;&gt;Tadashi Tokieda&lt;/a&gt; on &lt;a href=&quot;https://en.wikipedia.org/wiki/Emmy_Noether&quot;&gt;Emmy Noether&lt;/a&gt;. Amazing talk! […] I hung out with &lt;a href=&quot;https://www.linkedin.com/in/agastya-goel-ca/&quot;&gt;Agastya&lt;/a&gt;. We worked on SMT puzzles together. […] &lt;a href=&quot;https://allielmno.com/&quot;&gt;Allie&lt;/a&gt; let me know my site was down. I panickingly fixed it, but it left me with a lot of last-minute packing to do in the morning with my technology. Good night.&lt;/p&gt;

&lt;h2 id=&quot;thoughts&quot;&gt;Thoughts&lt;/h2&gt;

&lt;p&gt;Right after the journal, I went and biked the east coast of Taiwan with my brother. I will put some of those notes on this website in some time.&lt;/p&gt;

&lt;p&gt;I liked journalling in this new format a lot. It didn’t take as much time as I expected, and because it was just in a google doc I was able to make it clean. I also liked taking a break from it, weirdly enough?&lt;/p&gt;

&lt;p&gt;I’m not sure if this reduction based approach was best. April 7th is confusing if you haven’t tried to read a little bit of my previous post on &lt;a href=&quot;https://old.agniv.me/blog/alg-circuit/&quot;&gt;Algebraic Circuits&lt;/a&gt;, though it’s also confusing because it is not clear what I mean by “gracefully failing.” I believe I meant “why doesn’t it have more readable error messages?” I am not sure.&lt;/p&gt;

&lt;p&gt;Because I wasn’t tracking all of my academic studying and stuff, I’m worried that it looks like I was unstudious. Maybe I was, as I had just returned from college and it was break.&lt;/p&gt;

&lt;p&gt;I haven’t properly journalled since April 11th, mostly because I spent most of my time studying instead. I have notes here and there, but I will most likely centralize it somewhere soon. I’ve always tried to use &lt;a href=&quot;https://obsidian.md/&quot;&gt;Obsidian&lt;/a&gt; for technical notes but always defaulted to something that can better handle LaTex. I think now I know that I really enjoy a mono-journal (e.g. my journal is a single document instead of one a day), which contrasted with the satisfying graphs that Obsidian can offer. But writing is what matters, not necessarily maximizing the &lt;a href=&quot;https://en.wikipedia.org/wiki/Connectivity_(graph_theory)&quot;&gt;connectivity&lt;/a&gt; of the note graph. So, maybe!&lt;/p&gt;

&lt;p&gt;I do not know if I’m baller enough to &lt;a href=&quot;https://amberwilliams.io/blogs/building-my-own-pkms&quot;&gt;make my own&lt;/a&gt;, though I do know some features I’d like to have, most notably an easy way to upload photos from my phone on the go and toggle them on and off on the sides while viewing.&lt;/p&gt;

&lt;p&gt;I imagine right after Prelims I’ll properly start redocumenting some of my life. I remember reading that one of &lt;a href=&quot;https://blog.tanyakhovanova.com/&quot;&gt;Tanya’s&lt;/a&gt; pieces of advice for young mathematical researchers was to write everything down. I do this in my math journals, though you can see when I was thinking about dpi(x) that I was doing this just a little bit, though informally.&lt;/p&gt;

&lt;p&gt;And, I’ll end with the precursor:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;And finally, I’m lucky I get to feel like I’m living at the right place, in the right time, with the right people.&lt;/p&gt;
&lt;/blockquote&gt;
</description>
        <pubDate>Sun, 25 May 2025 00:00:00 +0000</pubDate>
        <link>https://old.agniv.me/blog/journal-entries/</link>
        <guid isPermaLink="true">https://old.agniv.me/blog/journal-entries/</guid>
        
        <category>self</category>
        
        
      </item>
    
  </channel>
</rss> 