<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Blog</title>
    <link>/</link>
    <description>Recent content on Blog</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Sat, 14 Mar 2026 00:00:00 +0000</lastBuildDate>
    <atom:link href="/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>“Right Ho, Jeeves” after Saki</title>
      <link>/post/saki-and-right-ho-jeeves/</link>
      <pubDate>Sat, 14 Mar 2026 00:00:00 +0000</pubDate>
      <guid>/post/saki-and-right-ho-jeeves/</guid>
      <description>&lt;p&gt;Saki (&lt;a href=&#34;https://greencardamom.github.io/BooksAndWriters/saki.htm&#34;&gt;1&lt;/a&gt;, &lt;a href=&#34;https://www.theguardian.com/books/booksblog/2009/sep/14/short-story-saki-hh-munro&#34;&gt;2&lt;/a&gt;, &lt;a href=&#34;https://archive.org/search?tab=fulltext&amp;amp;query=%22Saki+writes+like+an+enemy%22&#34;&gt;3&lt;/a&gt;)—pen name of Hecto Hugh Munro (1870–1916)—was a writer, known for his short stories that are often biting satires sometimes veering to the macabre. P. G. Wodehouse (1881–1975) needs no introduction. Some people find it obvious to &lt;a href=&#34;https://www.google.com/search?q=%22saki+and+wodehouse%22&#34;&gt;mention them together&lt;/a&gt;, and list Saki as one of the obvious influences on Wodehouse, e.g. the lede of &lt;a href=&#34;https://en.wikipedia.org/w/index.php?title=Saki&amp;amp;oldid=1340631510&#34;&gt;the Wikipedia article on Saki&lt;/a&gt; says, citing Saki&amp;rsquo;s entry in the Oxford Dictionary of National Biography (to which I don&amp;rsquo;t have access):&lt;/p&gt;</description>
    </item>
    <item>
      <title>Tilings with Tetris pieces, and squared Fibonacci numbers</title>
      <link>/post/tetris-tilings-fibonacci/</link>
      <pubDate>Sun, 08 Mar 2026 00:00:00 +0000</pubDate>
      <guid>/post/tetris-tilings-fibonacci/</guid>
      <description>&lt;p&gt;Saw &lt;a href=&#34;https://hachyderm.io/@ruuddotorg/116150427971106885&#34;&gt;this great observation by Ruud de Rooij&lt;/a&gt; (via &lt;a href=&#34;https://mathstodon.xyz/@robinhouston/116150609892837920&#34;&gt;Robin Houston&lt;/a&gt;):&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Combinatorics can be a bit weird sometimes: the number of ways to arrange N Tetris pieces into a 2-by-2N rectangle is the Nth Fibonacci number squared.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;&lt;img src=&#34;/post/images/Pasted%20image%2020260228220716.png&#34; alt=&#34;&#34;&gt;&#xA;&lt;/p&gt;&#xA;&lt;!-- &lt;link rel=&#34;stylesheet&#34; href=&#34;https://cdn.jsdelivr.net/npm/katex@0.16.35/dist/katex.min.css&#34; crossorigin=&#34;anonymous&#34;&gt; &lt;script defer src=&#34;https://cdn.jsdelivr.net/npm/katex@0.16.35/dist/katex.min.js&#34; crossorigin=&#34;anonymous&#34;&gt;&lt;/script&gt; &lt;script defer src=&#34;https://cdn.jsdelivr.net/npm/katex@0.16.35/dist/contrib/auto-render.min.js&#34; crossorigin=&#34;anonymous&#34; onload=&#34;renderMathInElement(document.body, { delimiters: [ {left: &#39;$$&#39;, right: &#39;$$&#39;, display: true}, {left: &#39;$&#39;, right: &#39;$&#39;, display: false} ] });&#34;&gt;&lt;/script&gt; --&gt;&#xA;&lt;p&gt;First to understand the statement: the picture shows tilings of $2 \times 2N$ rectangles by tetris pieces for $N = 1, 2, 3, 4, 5$, and the number of such tilings (shown) happens to be $1, 2^2, 3^2, 5^2, 8^2$ respectively.&lt;/p&gt;</description>
    </item>
    <item>
      <title>“tāta” in the Rāmāyaṇa</title>
      <link>/post/taata-ramayana/</link>
      <pubDate>Sun, 08 Feb 2026 00:00:00 +0000</pubDate>
      <guid>/post/taata-ramayana/</guid>
      <description>&lt;p&gt;The Sanskrit word tāta (“father”) is sometimes used affectionately for a younger person. (Similar to “appa” in Kannada etc.)&lt;/p&gt;&#xA;&lt;p&gt;This usage occurs widely in Sanskrit literature, but we can look at the Rāmāyaṇa as an example.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://www.sanskrit-linguistics.org/dcs/index.php?contents=fundstellen&amp;amp;IDWord=97019&amp;amp;IDText=143&#34;&gt;Here&lt;/a&gt; are all the occurrences of the word tāta in the Rāmāyaṇa, thanks to Dr. Oliver Hellwig&amp;rsquo;s &lt;a href=&#34;http://www.sanskrit-linguistics.org/dcs/&#34;&gt;Digital Corpus of Sanskrit&lt;/a&gt;. There are 117 occurrences, some with the meaning of “father” and some not.&lt;/p&gt;&#xA;&lt;p&gt;I asked Codex CLI to use this list, and the data from &lt;a href=&#34;https://sanskritsahitya.org/ramayanam&#34;&gt;sanskritsahitya.org&lt;/a&gt;, to classify them. It churned away for a while (sometimes in wrong directions and I had to restrain/redirect it), and eventually I was able to obtain the following. It needs verification (I&amp;rsquo;ve only done a few spot checks), but if this is all correct, it says that 27 of the occurrences have “tāta” in the sense of “father”, and 90 in the affectionate sense. (The translations come from the &amp;ldquo;Summary&amp;rdquo; field on sanskritsahitya.org, which are from &lt;a href=&#34;http://valmiki.iitk.ac.in&#34;&gt;http://valmiki.iitk.ac.in&lt;/a&gt; apparently.)&lt;/p&gt;</description>
    </item>
    <item>
      <title>Mahabharata text and English translations</title>
      <link>/post/mahabharata-texts-and-translations/</link>
      <pubDate>Sun, 18 Jan 2026 00:00:00 +0000</pubDate>
      <guid>/post/mahabharata-texts-and-translations/</guid>
      <description>&lt;p&gt;Just writing down what I know, for future reference.&lt;/p&gt;&#xA;&lt;h2 id=&#34;sanskrit-text-manuscript-traditions&#34;&gt;Sanskrit text: manuscript traditions&lt;/h2&gt;&#xA;&lt;p&gt;Loosely speaking, the available manuscripts of the Mahābhārata fall into three categories, called recensions:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Southern (longest/most elaborate)&lt;/li&gt;&#xA;&lt;li&gt;Northern (≈“Vulgate”)&lt;/li&gt;&#xA;&lt;li&gt;Kaśmīrī (even shorter)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;The &lt;strong&gt;critical edition&lt;/strong&gt; of BORI (Sukthankar et al) is (again, loosely speaking) the intersection of these.&lt;/p&gt;&#xA;&lt;p&gt;(To be more precise, in Sukthankar&amp;rsquo;s terminology there are two recensions, Northern and Southern, with the former divided into two “sub-recensions” or “groups”. I just looked at some examples and found it more convenient to simply think of them as three.)&lt;/p&gt;</description>
    </item>
    <item>
      <title>Douglas Adams on the English–American cultural divide over “heroes”</title>
      <link>/post/douglas-adams-cultural-divide/</link>
      <pubDate>Wed, 14 Jan 2026 00:00:00 +0000</pubDate>
      <guid>/post/douglas-adams-cultural-divide/</guid>
      <description>&lt;p&gt;In 2000, Douglas Adams made an interesting observation that I keep returning to.&lt;/p&gt;&#xA;&lt;p&gt;A user on Slashdot named “FascDot Killed My Pr” had asked the following question (where HGttG = Hitchhiker’s Guide to the Galaxy):&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;em&gt;Comedy&amp;hellip;.or Tragedy?&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;First, a big thank-you. You&amp;rsquo;ve made a lasting contribution to &amp;ldquo;our&amp;rdquo; culture (or should that be &amp;ldquo;culture&amp;rdquo;?)&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;I first read HGttG in my early teens. I doubled over laughing the whole time. I read and reread the entire series, bought both Dirk Gently books AND Last Chance to See. Loved them all and wouldn&amp;rsquo;t trade having read them for anything. (btw, the first mental ward scene in Long Dark Teatime is a no-foolin&amp;rsquo;, all-time classic.)&lt;/em&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Editing a Google Sheet via an app (AppSheet)</title>
      <link>/post/google-sheets-app/</link>
      <pubDate>Sun, 04 Jan 2026 00:00:00 +0000</pubDate>
      <guid>/post/google-sheets-app/</guid>
      <description>&lt;p&gt;&lt;em&gt;TLDR: I hesitate to recommend this to anyone as it&amp;rsquo;s finicky to set up and may go away, but just in case: Google Sheets has an &amp;ldquo;Extensions -&amp;gt; AppSheet -&amp;gt; Create an app&amp;rdquo; that gives an easier interface for editing a sheet from phone (stuff like updating a daily habit tracker or whatever).&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Last year, I made a &amp;ldquo;2025 daily tracker&amp;rdquo; in Google Sheets, where I updated some data every day (like a daily habit tracker). It is not very convenient to edit Google Sheets using a phone, but it turns out Google Sheets comes with something called &amp;ldquo;AppSheet&amp;rdquo; that can make this slightly easier. This being a feature that is apparently not very well known (and therefore not much used), I expect it to go away at some point, but for now, the following is how it works.&lt;/p&gt;</description>
    </item>
    <item>
      <title>More on shuffles</title>
      <link>/post/more-on-shuffles/</link>
      <pubDate>Sat, 27 Dec 2025 00:00:00 +0000</pubDate>
      <guid>/post/more-on-shuffles/</guid>
      <description>&lt;p&gt;Yesterday I read &lt;a href=&#34;https://dotat.at/@/2025-12-25-shuffle.html&#34;&gt;a nice post called “doubly dual shuffles”&lt;/a&gt;, which&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt; pointed out something about the classic algorithm for shuffling an array (i.e. sampling a uniformly random permutation of it).&lt;/p&gt;&#xA;&lt;p&gt;It&amp;rsquo;s a concise and (his word!) “pearlescent” post and you should &lt;a href=&#34;https://dotat.at/@/2025-12-25-shuffle.html&#34;&gt;read it&lt;/a&gt;, but in short, even modulo a simple and uninteresting &amp;ldquo;mirroring&amp;rdquo; (where you can move left-to-right or right-to-left), there are actually two distinct algorithms:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;in one of them, at each step you “sample” from the “rest” of the array,&lt;/li&gt;&#xA;&lt;li&gt;in the other one, at each step you “permute” the elements seen so far.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;This was really surprising to me, because I must have coded a shuffle like this dozens of times, but I had never thought of the latter variant. And the difference between the two shows up even more starkly when we try to analyze the corresponding algorithms for generating random &lt;em&gt;cyclic&lt;/em&gt; permutations, as we&amp;rsquo;ll see below.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Repeated verses in the Rāmāyaṇa and Mahābhārata</title>
      <link>/post/repeated-verses-ramayana-mahabharata/</link>
      <pubDate>Sun, 14 Dec 2025 00:00:00 +0000</pubDate>
      <guid>/post/repeated-verses-ramayana-mahabharata/</guid>
      <description>&lt;h2 id=&#34;the-question&#34;&gt;The question&lt;/h2&gt;&#xA;&lt;p&gt;The following verse occurs twice in the (critical edition of the) Rāmāyaṇa, and four times in the Mahābhārata:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;सर्वे क्षयान्ता निचयाः पतनान्ताः समुच्छ्रयाः ।&lt;br&gt;&#xA;संयोगा विप्रयोगान्ता मरणान्तं हि जीवितम् ॥&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;As translated by &lt;a href=&#34;https://shreevatsa.net/ryder/verses/verses.html&#34;&gt;A. W. Ryder&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;All gathering ends in dissipation;&lt;br&gt;&#xA;    All heaps, at last, must fall;&lt;br&gt;&#xA;All friendships melt in separation;&lt;br&gt;&#xA;    And death at last ends all.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;(More details about its occurrences below.)&lt;/p&gt;&#xA;&lt;p&gt;A question that may arise out of curiosity is: are there other such verses, occurring in both the works? It turns out there are some others (although none that occurs six times in total like this one.)&lt;/p&gt;</description>
    </item>
    <item>
      <title>Dr. Shankar&#39;s next-consonant chitrakavya</title>
      <link>/post/shankar-next-consonant-chitrakavya/</link>
      <pubDate>Sat, 06 Dec 2025 00:00:00 +0000</pubDate>
      <guid>/post/shankar-next-consonant-chitrakavya/</guid>
      <description>&lt;p&gt;Sanskrit has a rich tradition of Chitrakavya (roughly, &lt;a href=&#34;https://en.wikipedia.org/wiki/Constrained_writing&#34;&gt;constrained writing&lt;/a&gt;).&lt;/p&gt;&#xA;&lt;p&gt;Just came to know that Dr. Shankar has composed Sanskrit verses that satisfy a certain constraint (he has named it “anantarākṣarī”): the second half is precisely the first half with each consonant changed to its successor in the alphabet (while vowels are kept untouched).&lt;/p&gt;&#xA;&lt;p&gt;As example, he gives this verse he composed as a praise of Sarasvatī:&lt;/p&gt;&#xA;&lt;p&gt;dayābhārālasābhedā   maṇivīṇākarā parā /&lt;br&gt;&#xA;dharā mālāvahā medhā   yatiśītā khalāphalā //&lt;/p&gt;</description>
    </item>
    <item>
      <title>Tom Lehrer&#39;s poem: Dissertation on Education</title>
      <link>/post/lehrer-dissertation-on-education/</link>
      <pubDate>Sun, 27 Jul 2025 00:00:00 +0000</pubDate>
      <guid>/post/lehrer-dissertation-on-education/</guid>
      <description>&lt;p&gt;Tom Lehrer got into Harvard in 1943 at age 15, and it is said that the following poem he wrote (at that age or even earlier) was his admission “essay”. The &lt;em&gt;Loomis Alumni Bulletin&lt;/em&gt; issue of autumn 1943 (Loomis was the prep school he went to) said of the poem:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;The headmaster of Exeter, it is said, carries it in his wallet; it was read aloud to the entering class at Harvard last June; and the graduating class of a New England school sang it at commencement exercises.&lt;/p&gt;</description>
    </item>
    <item>
      <title>AI for writing: unexpected utility</title>
      <link>/post/ai-for-writing-unexpected/</link>
      <pubDate>Sat, 17 May 2025 00:00:00 +0000</pubDate>
      <guid>/post/ai-for-writing-unexpected/</guid>
      <description>&lt;p&gt;I know that some/many people use LLMs (ChatGPT etc) for writing (emails, docs, etc), but I&amp;rsquo;ve never found it worthwhile myself, for at least two reasons.&lt;/p&gt;&#xA;&lt;p&gt;One, the results always look unnatural and “AI-written” (even with system prompts to make it more casual or concise etc—&lt;a href=&#34;https://koomen.dev/essays/horseless-carriages/#ai-slop&#34;&gt;this post is worth reading though&lt;/a&gt;). My writing style may be nothing to be proud of, but it is mine, and I do want anything that comes from me to look like I wrote it.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Two ways to crack a walnut, per Grothendieck</title>
      <link>/post/grothendieck-approaches/</link>
      <pubDate>Wed, 30 Apr 2025 00:00:00 +0000</pubDate>
      <guid>/post/grothendieck-approaches/</guid>
      <description>&lt;p&gt;The mathematician Alexander Grothendieck was “considered by many to be the greatest mathematician of the twentieth century”. Somewhere in his 1000+-page autobiographical work &lt;em&gt;Récoltes et Semailles&lt;/em&gt; (&amp;ldquo;Harvests and Sowings&amp;rdquo;), he describes two styles in mathematics:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Take for example the task of proving a theorem that remains hypothetical (to which, for some, mathematical&#xA;work seems to be reduced). I see two extreme approaches to doing this.&lt;/p&gt;&#xA;&lt;p&gt;One is that of the &lt;strong&gt;hammer and chisel&lt;/strong&gt;, when the problem posed is seen as a large nut, hard and smooth, whose interior must be reached, the nourishing flesh protected by the shell. The principle is simple: you put the cutting edge of the chisel against the shell, and hit it hard. If necessary, you repeat the process in several different places, until the shell cracks—and you are satisfied.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Certifying that M_127 is prime</title>
      <link>/post/m127-certificate/</link>
      <pubDate>Mon, 24 Jun 2024 00:00:00 +0000</pubDate>
      <guid>/post/m127-certificate/</guid>
      <description>&lt;p&gt;Let $M_p = 2^p - 1$, so that:&lt;/p&gt;&#xA;&lt;p&gt;$$\begin{align}&#xA;M_2 &amp;amp;= 2^2 - 1 = 4 - 1 = 3 \cr&#xA;M_3 &amp;amp;= 2^3 - 1 = 8 - 1 = 7 \cr&#xA;M_7 &amp;amp;= 2^7 - 1 = 128 - 1 = 127 \cr&#xA;M_{127} &amp;amp;= 2^{127} - 1&#xA;\end{align}$$&lt;/p&gt;&#xA;&lt;p&gt;Is $M_{127}$ prime? This is a large number with 39 digits, specifically it is  170141183460469231731687303715884105727.&lt;/p&gt;&#xA;&lt;p&gt;We can just look up what is known: the Wikipedia article on &lt;a href=&#34;https://en.wikipedia.org/wiki/Mersenne_prime&#34;&gt;Mersenne prime&lt;/a&gt; links to &lt;a href=&#34;https://oeis.org/A000043&#34;&gt;OEIS A000043&lt;/a&gt;, &amp;ldquo;primes p such that 2^p - 1 is prime&amp;rdquo;, a list which contains $127$.&#xA;In fact, &lt;a href=&#34;https://www.mersenne.org/primes/&#34;&gt;the &amp;ldquo;List of Known Mersenne Prime Numbers&amp;rdquo; on mersenne.org&lt;/a&gt; says that $M{_1}{_2}{_7}$ was declared prime by Édouard Lucas a long time ago, in January 1876.&#xA;The page does not mention it, but he came to this conclusion after hundreds of hours spent doing binary arithmetic by placing pawns on a very large chessboard (of size $127 \times 127$);&#xA;there&amp;rsquo;s a demonstration of his &amp;ldquo;game&amp;rdquo; in &lt;a href=&#34;http://cs.ucmo.edu/~cnc8851/talks/mersennegimps/mersennegimps.pdf&#34;&gt;these slides&lt;/a&gt;,&#xA;and a fuller account in &lt;em&gt;Factoring Integers Before Computers&lt;/em&gt; (1994) by H. C. Williams and J. O. Shallit,&#xA;in &lt;em&gt;Mathematics of Computation, 1943–1993: A Half-century of Computational Mathematics&lt;/em&gt; (which is Proceedings of Symposia in Applied Math., Vol 48, ed. Walter Gautschi, publ. AMS).&#xA;(Williams also has a book/monograph about Lucas that goes into some detail.)&lt;/p&gt;</description>
    </item>
    <item>
      <title>The sorry state of terminal support for Indic scripts (on macOS)</title>
      <link>/post/terminal-indic/</link>
      <pubDate>Fri, 21 Jun 2024 00:00:00 +0000</pubDate>
      <guid>/post/terminal-indic/</guid>
      <description>&lt;p&gt;This will be a quick post to collect some screenshots.&lt;/p&gt;&#xA;&lt;p&gt;I ran &lt;code&gt;diff&lt;/code&gt; in the terminal (the macOS default Terminal) on a couple of files containing text in Kannada script, and the output was unreadable. So I tried installing a bunch of other terminals: turns out they&amp;rsquo;re all even worse.&lt;/p&gt;&#xA;&lt;p&gt;Here&amp;rsquo;s the test case (just picking the real-world text I was trying to diff; it may contain OCR errors but is well-formed): the string &amp;ldquo;ತನ್ನ ಒಂದು ಸತ್ಯಸಂಕಲ್ಪದಂತೆ ಸೃಷ್ಟಿಯಲ್ಲಿ ವ್ಯವಸ್ಥೆಯಿಲ್ಲದೆ ತನ್ನ&amp;rdquo;. In plain text:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Knuth&#39;s program PERFECT-PARTITION-SQUARE</title>
      <link>/post/dek-partition-square/</link>
      <pubDate>Mon, 03 Jun 2024 00:00:00 +0000</pubDate>
      <guid>/post/dek-partition-square/</guid>
      <description>&lt;script&gt;&#xA;MathJax = {&#xA;  AuthorInit: function() { MathJax.Hub.processSectionDelay = 0; },&#xA;  tex: {&#xA;    inlineMath: [[&#39;$&#39;, &#39;$&#39;], [&#39;\\(&#39;, &#39;\\)&#39;]]&#xA;  },&#xA;  svg: {&#xA;    fontCache: &#39;global&#39;&#xA;  }&#xA;};&#xA;&lt;/script&gt;&#xA;&lt;script id=&#34;MathJax-script&#34; async src=&#34;https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js&#34;&gt;&lt;/script&gt;&#xA;&lt;p&gt;Donald Knuth has &lt;a href=&#34;https://cs.stanford.edu/~knuth/programs.html&#34;&gt;a page&lt;/a&gt; on &lt;a href=&#34;https://cs.stanford.edu/~knuth/&#34;&gt;his website&lt;/a&gt; where he sometimes posts programs he has written. (He says he writes several programs a week, mostly in CWEB and mostly for his own interest, but occasionally posts some of them online.)&lt;/p&gt;&#xA;&lt;p&gt;A couple of days ago, on 2024-06-01, Knuth posted a program, with the description “An amusing recreation”, that solves the following problem:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Checking in with P. G. Wodehouse</title>
      <link>/post/wodehouse-clarke/</link>
      <pubDate>Fri, 23 Feb 2024 00:00:00 +0000</pubDate>
      <guid>/post/wodehouse-clarke/</guid>
      <description>&lt;p&gt;P. G. Wodehouse turned 90 in October 1971, was (finally!) awarded a knighthood in January 1975, and died in February 1975. One of the couple of people who managed to interview him shortly before his death was Gerald Clarke, who published the interview in &lt;em&gt;The Paris Review&lt;/em&gt; (Winter 1975): &lt;a href=&#34;https://web.archive.org/web/20100927115549/https://www.theparisreview.org/interviews/3773/the-art-of-fiction-no-60-p-g-wodehouse&#34;&gt;P. G. Wodehouse, The Art of Fiction No. 60&lt;/a&gt; — it&amp;rsquo;s a lovely interview, that I have read often.&lt;/p&gt;&#xA;&lt;p&gt;I posted this on G+ in 2015 when I first read it:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Notes on a translation choice</title>
      <link>/post/translation-choice/</link>
      <pubDate>Sun, 11 Feb 2024 00:00:00 +0000</pubDate>
      <guid>/post/translation-choice/</guid>
      <description>&lt;p&gt;My friends Suhas and Anusha have a book of excellent poems on love, translated into English from the Indian literary tradition (Sanskrit/Prakrit) across the centuries, coming out in a couple of days.&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt; The book itself is a delight (I&amp;rsquo;ve read a draft) and I hope literally everyone reads it. I&amp;rsquo;ll say more about it when I&amp;rsquo;ve read it again, but in the meantime here just wanted to focus on one poem from their book, as an example of good translation choices.&lt;sup id=&#34;fnref:2&#34;&gt;&lt;a href=&#34;#fn:2&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>A first-class recitation of the Rāmāyaṇa</title>
      <link>/post/recitation-ramayana/</link>
      <pubDate>Wed, 31 Jan 2024 00:00:00 +0000</pubDate>
      <guid>/post/recitation-ramayana/</guid>
      <description>&lt;h1 id=&#34;the-story&#34;&gt;The story&lt;/h1&gt;&#xA;&lt;p&gt;Like every student of Sanskrit, I had always wanted to read the Vālmīki Rāmāyaṇa,&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt; but in the face of several distractions, this had always been a &amp;ldquo;To-do someday&amp;rdquo; item: I think I had not even fully read the mere 100 shlokas of the first sarga (Sankshepa Ramayana), despite there being useful &lt;a href=&#34;https://sanskrit.uohyd.ac.in/scl/e-readers/sankshepa_ramayanam/ramayana-interface/index.html&#34;&gt;resources&lt;/a&gt; to do so.&lt;/p&gt;&#xA;&lt;p&gt;Then on 2017-Oct-31, a mailing list &lt;a href=&#34;https://groups.google.com/g/bvparishat/c/q5bwpD8vsnI/m/OkWE0EnmCAAJ&#34;&gt;post by Suhas Mahesh&lt;/a&gt; mentioned something:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;The full Ramayana recitation  by Sri Sriram Ghanapathi on pravachanam.com is a treat to the ears. Finally a good recitation that is also recorded well! Unfortunately, a file has to be downloaded separately for each Sarga. Does anyone have a workaround for this? I also fear that the website will go down and all will be lost.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Understanding xii.tex</title>
      <link>/post/xii/</link>
      <pubDate>Sat, 23 Dec 2023 00:00:00 +0000</pubDate>
      <guid>/post/xii/</guid>
      <description>&lt;p&gt;In December 1998, David Carlisle posted the following to &lt;code&gt;comp.text.tex&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;\let~\catcode~`76~`A13~`F1~`j00~`P2jdefA71F~`7113jdefPALLF&#xA;PA&amp;#39;&amp;#39;FwPA;;FPAZZFLaLPA//71F71iPAHHFLPAzzFenPASSFthP;A$$FevP&#xA;A@@FfPARR717273F737271P;ADDFRgniPAWW71FPATTFvePA**FstRsamP&#xA;AGGFRruoPAqq71.72.F717271PAYY7172F727171PA??Fi*LmPA&amp;amp;&amp;amp;71jfi&#xA;Fjfi71PAVVFjbigskipRPWGAUU71727374 75,76Fjpar71727375Djifx&#xA;:76jelse&amp;amp;U76jfiPLAKK7172F71l7271PAXX71FVLnOSeL71SLRyadR@oL&#xA;RrhC?yLRurtKFeLPFovPgaTLtReRomL;PABB71 72,73:Fjif.73.jelse&#xA;B73:jfiXF71PU71 72,73:PWs;AMM71F71diPAJJFRdriPAQQFRsreLPAI&#xA;I71Fo71dPA!!FRgiePBt&amp;#39;el@ lTLqdrYmu.Q.,Ke;vz vzLqpip.Q.,tz;&#xA;;Lql.IrsZ.eap,qn.i. i.eLlMaesLdRcna,;!;h htLqm.MRasZ.ilk,%&#xA;s$;z zLqs&amp;#39;.ansZ.Ymi,/sx ;LYegseZRyal,@i;@ TLRlogdLrDsW,@;G&#xA;LcYlaDLbJsW,SWXJW ree @rzchLhzsW,;WERcesInW qt.&amp;#39;oL.Rtrul;e&#xA;doTsW,Wk;Rri@stW aHAHHFndZPpqar.tridgeLinZpe.LtYer.W,:jbye&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;It was also published in TUGboat as &lt;a href=&#34;https://tug.org/TUGboat/tb19-4/tb61carl.pdf&#34;&gt;A Seasonal Puzzle&lt;/a&gt;, and is also available on CTAN as &lt;a href=&#34;https://ctan.org/pkg/xii&#34;&gt;&lt;code&gt;xii&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Put this code in a file called &lt;a href=&#34;/post/2023-xii/xii.tex&#34;&gt;&lt;code&gt;xii.tex&lt;/code&gt;&lt;/a&gt; and run&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;pdftex xii.tex&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;to get &lt;a href=&#34;/post/2023-xii/xii.pdf&#34;&gt;&lt;code&gt;xii.pdf&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;embed src=&#34;/post/2023-xii/xii.pdf&#34; width=&#34;100%&#34; height=&#34;500&#34; type=&#34;application/pdf&#34;&gt;&#xA;&lt;p&gt;How is it doing this; what&amp;rsquo;s going on here?&lt;/p&gt;</description>
    </item>
    <item>
      <title>Using pkfix to fix (some) old TeX-generated PDF (PS) files</title>
      <link>/post/pkfix/</link>
      <pubDate>Sun, 17 Dec 2023 00:00:00 +0000</pubDate>
      <guid>/post/pkfix/</guid>
      <description>&lt;p&gt;Here&amp;rsquo;s an arcane bit of knowledge that may be applicable sometimes: there is a tool called &lt;code&gt;pkfix&lt;/code&gt; that can be used to improve the rendering of certain old PostScript files.&lt;/p&gt;&#xA;&lt;p&gt;(Will add more details later.)&lt;/p&gt;&#xA;&lt;h3 id=&#34;example-1&#34;&gt;Example 1&lt;/h3&gt;&#xA;&lt;p&gt;Original: &lt;a href=&#34;https://cs.uwaterloo.ca/~shallit/Papers/change2.pdf&#34;&gt;https://cs.uwaterloo.ca/~shallit/Papers/change2.pdf&lt;/a&gt; = &lt;a href=&#34;https://shreevatsa.net/post/2023-pkfix/change2.pdf&#34;&gt;https://shreevatsa.net/post/2023-pkfix/change2.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Fix:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;wget &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;https://cs.uwaterloo.ca/~shallit/Papers/change2.ps&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;pkfix change2.ps change2-fixed.ps&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ps2pdf change2-fixed.ps&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Result: &lt;a href=&#34;https://shreevatsa.net/post/2023-pkfix/change2-fixed.pdf&#34;&gt;https://shreevatsa.net/post/2023-pkfix/change2-fixed.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Side-by-side, it looks like (open image in new tab and see at 100%):&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://shreevatsa.net/post/2023-pkfix/screenshot.png&#34; alt=&#34;diff&#34;&gt;&#xA;&lt;/p&gt;&#xA;&lt;h3 id=&#34;example-2&#34;&gt;Example 2&lt;/h3&gt;&#xA;&lt;p&gt;Compare &lt;a href=&#34;https://courses.cs.duke.edu/spring02/cps296.1/papers/H-SIGMOD1999.pdf&#34;&gt;https://courses.cs.duke.edu/spring02/cps296.1/papers/H-SIGMOD1999.pdf&lt;/a&gt; and &lt;a href=&#34;https://shreevatsa.net/post/2022-pkfix-etc/tr-98-033_pkfix-helper_pkfix_pstopdf.pdf&#34;&gt;https://shreevatsa.net/post/2022-pkfix-etc/tr-98-033_pkfix-helper_pkfix_pstopdf.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;example-3&#34;&gt;Example 3&lt;/h3&gt;&#xA;&lt;p&gt;Compare &lt;a href=&#34;https://web.archive.org/web/20160418212350/https://www.cs.uml.edu/ecg/pub/uploads/OPLspr09/genesis-of-lisp-jmc.pdf&#34;&gt;https://web.archive.org/web/20160418212350/https://www.cs.uml.edu/ecg/pub/uploads/OPLspr09/genesis-of-lisp-jmc.pdf&lt;/a&gt; and &lt;a href=&#34;http://slackwise.net/files/docs/The%20Roots%20of%20Lisp.pdf&#34;&gt;http://slackwise.net/files/docs/The%20Roots%20of%20Lisp.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;more-details&#34;&gt;More details&lt;/h3&gt;&#xA;&lt;p&gt;(WIP)&lt;/p&gt;</description>
    </item>
    <item>
      <title>Mathematical trolling: the Willans prime formula</title>
      <link>/post/willans-prime-formula/</link>
      <pubDate>Sat, 16 Dec 2023 00:00:00 +0000</pubDate>
      <guid>/post/willans-prime-formula/</guid>
      <description>&lt;script&gt;&#xA;MathJax = {&#xA;  AuthorInit: function() { MathJax.Hub.processSectionDelay = 0; },&#xA;  tex: {&#xA;    inlineMath: [[&#39;$&#39;, &#39;$&#39;], [&#39;\\(&#39;, &#39;\\)&#39;]]&#xA;  },&#xA;  svg: {&#xA;    fontCache: &#39;global&#39;&#xA;  }&#xA;};&#xA;&lt;/script&gt;&#xA;&lt;script id=&#34;MathJax-script&#34; async src=&#34;https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js&#34;&gt;&lt;/script&gt;&#xA;&lt;p&gt;It has long been of interest to study any regularity in the prime numbers, a question which can be phrased as: “Is there a formula for the $n$th prime number?” While there has been a fair bit of progress and understanding (e.g. the work of Riemann, the prime-number theorem), in 1964 someone named(?) C. P. Willans from the University of Birmingham gave the following “troll” answer, answering the question literally while flagrantly violating its spirit.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Improving on Percy Ludgate&#39;s &#34;Irish logarithm&#34;</title>
      <link>/post/optimizing-irish-logarithm/</link>
      <pubDate>Tue, 03 Oct 2023 00:00:00 +0000</pubDate>
      <guid>/post/optimizing-irish-logarithm/</guid>
      <description>&lt;script&gt;&#xA;MathJax = {&#xA;  AuthorInit: function() { MathJax.Hub.processSectionDelay = 0; },&#xA;  tex: {&#xA;    inlineMath: [[&#39;$&#39;, &#39;$&#39;], [&#39;\\(&#39;, &#39;\\)&#39;]]&#xA;  },&#xA;  svg: {&#xA;    fontCache: &#39;global&#39;&#xA;  }&#xA;};&#xA;&lt;/script&gt;&#xA;&lt;script id=&#34;MathJax-script&#34; async src=&#34;https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js&#34;&gt;&lt;/script&gt;&#xA;&lt;p&gt;A quick follow-up to &lt;a href=&#34;https://shreevatsa.net/post/irish-logarithm/&#34;&gt;yesterday&amp;rsquo;s post&lt;/a&gt; on the &amp;ldquo;Irish logarithm&amp;rdquo; of Percy Ludgate.&lt;/p&gt;&#xA;&lt;p&gt;To recap, the idea is to pick four numbers $f(2)$, $f(3)$, $f(5)$, $f(7)$, and then for all products of nonzero one-digit numbers, define the values of $f$ with $f(ab) = f(a) + f(b)$. For example, this rule defines $f(6)$ as $2f(3)$, and $f(28)$ as $2f(2) + f(7)$. We can write the following Python code to enumerate all these consequences (using &lt;code&gt;array&lt;/code&gt; from &lt;code&gt;numpy&lt;/code&gt; just for the convenience of &lt;a href=&#34;https://stackoverflow.com/a/36314643&#34;&gt;adding tuples element-wise&lt;/a&gt; with &lt;code&gt;+&lt;/code&gt;):&lt;/p&gt;</description>
    </item>
    <item>
      <title>Reverse-engineering the &#34;Irish logarithm&#34;</title>
      <link>/post/irish-logarithm/</link>
      <pubDate>Mon, 02 Oct 2023 00:00:00 +0000</pubDate>
      <guid>/post/irish-logarithm/</guid>
      <description>&lt;script&gt;&#xA;MathJax = {&#xA;  AuthorInit: function() { MathJax.Hub.processSectionDelay = 0; },&#xA;  tex: {&#xA;    inlineMath: [[&#39;$&#39;, &#39;$&#39;], [&#39;\\(&#39;, &#39;\\)&#39;]]&#xA;  },&#xA;  svg: {&#xA;    fontCache: &#39;global&#39;&#xA;  }&#xA;};&#xA;&lt;/script&gt;&#xA;&lt;script id=&#34;MathJax-script&#34; async src=&#34;https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js&#34;&gt;&lt;/script&gt;&#xA;&lt;p&gt;Source: &lt;a href=&#34;https://blog.plover.com/math/irish-logarithm.html&#34;&gt;MJD&amp;rsquo;s blog post on &amp;ldquo;The Irish logarithm&amp;rdquo;&lt;/a&gt; (cites &lt;a href=&#34;https://en.wikipedia.org/w/index.php?title=Irish_logarithm&amp;amp;oldid=1178155281&#34;&gt;Wikipedia: Irish logarithm&lt;/a&gt;).&lt;/p&gt;&#xA;&lt;p&gt;Apparently, Percy Ludgate (1883–1922) was an Irish amateur (was &amp;ldquo;Boy Copyist&amp;rdquo; in 1901, and &amp;ldquo;Commercial Clerk (Corn Merchant)&amp;rdquo; in 1911, later accountant), who in 1909—unaware of the work of Charles Babbage (1791–1871) and his analytical engine—designed a similar general-purpose (Turing-complete) computing machine.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Derangements, Dobiński&#39;s formula, and their combination</title>
      <link>/post/permutations-dobinski/</link>
      <pubDate>Mon, 16 Jan 2023 00:00:00 +0000</pubDate>
      <guid>/post/permutations-dobinski/</guid>
      <description>&lt;script&gt;&#xA;MathJax = {&#xA;  AuthorInit: function() { MathJax.Hub.processSectionDelay = 0; },&#xA;  tex: {&#xA;    inlineMath: [[&#39;$&#39;, &#39;$&#39;], [&#39;\\(&#39;, &#39;\\)&#39;]]&#xA;  },&#xA;  svg: {&#xA;    fontCache: &#39;global&#39;&#xA;  }&#xA;};&#xA;&lt;/script&gt;&#xA;&lt;script id=&#34;MathJax-script&#34; async src=&#34;https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js&#34;&gt;&lt;/script&gt;&#xA;&lt;p&gt;A couple of years ago, someone on a mailing list asked for a proof for their observation that&lt;/p&gt;&#xA;&lt;div&gt;&#xA;$$B_n = \sum_{k=1}^{n} \frac{k^n}{k!}\cdot\frac{!(n-k)}{(n-k)!}$$&#xA;&lt;/div&gt;&#xA;&lt;p&gt;where $B_n$ denotes the &lt;a href=&#34;https://en.wikipedia.org/wiki/Bell_number&#34;&gt;Bell numbers&lt;/a&gt; (the number of set partitions of $n$ items), and \( !(n-k) \) aka $D_{n-k}$ denotes the number of &lt;a href=&#34;https://en.wikipedia.org/w/index.php?title=Derangement&amp;amp;oldid=1122558919&#34;&gt;derangements&lt;/a&gt; of $n-k$ items.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Methods for factoring numbers, in the Gaṇita-kaumudī of Nārāyaṇa Paṇḍita</title>
      <link>/post/narayana-factoring/</link>
      <pubDate>Mon, 16 Jan 2023 00:00:00 +0000</pubDate>
      <guid>/post/narayana-factoring/</guid>
      <description>&lt;link rel=&#34;stylesheet&#34; href=&#34;https://cdn.jsdelivr.net/npm/katex@0.15.6/dist/katex.css&#34; integrity=&#34;sha384-jJFDzw6Rh7jzIumRp31oSKurBXlvFPBHbzi9KbVukp6ZNECGD4UKyhO5tJaJ1uHA&#34; crossorigin=&#34;anonymous&#34;&gt;&lt;script&gt;&#xA;MathJax = {&#xA;  AuthorInit: function() { MathJax.Hub.processSectionDelay = 0; },&#xA;  tex: {&#xA;    inlineMath: [[&#39;$&#39;, &#39;$&#39;], [&#39;\\(&#39;, &#39;\\)&#39;]]&#xA;  },&#xA;  svg: {&#xA;    fontCache: &#39;global&#39;&#xA;  }&#xA;};&#xA;&lt;/script&gt;&#xA;&lt;script id=&#34;MathJax-script&#34; async src=&#34;https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js&#34;&gt;&lt;/script&gt;&#xA;&lt;p&gt;The Gaṇita-kaumudī (गणितकौमुदी) is a work on mathematics written by Nārāyaṇa Paṇḍita in 1356 CE. Also known as the Gaṇita-pāṭī-kaumudī, it contains 14 chapters (see &lt;a href=&#34;https://en.wikipedia.org/wiki/Ganita_Kaumudi&#34;&gt;Wikipedia article&lt;/a&gt;), of which chapters 13 (on combinatorics) and 14 (on magic squares) are especially advanced/notable.&lt;/p&gt;&#xA;&lt;p&gt;Recently I took a close look at Chapter 11, which is about factoring numbers. (I had taken a quick look &lt;a href=&#34;https://shreevatsa.github.io/site/fermat-narayana.html&#34;&gt;earlier&lt;/a&gt;, as among other things, it contains a description of what is now called &lt;a href=&#34;https://en.wikipedia.org/wiki/Fermat%27s_factorization_method&#34;&gt;&amp;ldquo;Fermat&amp;rsquo;s factorization method&amp;rdquo;&lt;/a&gt;, named after Pierre de Fermat who independently rediscovered the method about 300 years later, in the 17th century.) I wanted to take a look at the Sanskrit text myself, and try my hand at understanding/translating each verse, before turning to the published commentary and translation when necessary. It is a short chapter, of 19 verses in the āryā metre.&lt;/p&gt;</description>
    </item>
    <item>
      <title>  The harmonic series, the &#34;prime harmonic series&#34;, and their difference
  </title>
      <link>/post/harmonic-series/</link>
      <pubDate>Tue, 24 May 2022 00:00:00 +0000</pubDate>
      <guid>/post/harmonic-series/</guid>
      <description>&lt;link rel=&#34;stylesheet&#34; href=&#34;https://cdn.jsdelivr.net/npm/katex@0.15.6/dist/katex.css&#34; integrity=&#34;sha384-jJFDzw6Rh7jzIumRp31oSKurBXlvFPBHbzi9KbVukp6ZNECGD4UKyhO5tJaJ1uHA&#34; crossorigin=&#34;anonymous&#34;&gt;&#xA;&lt;h2 id=&#34;harmonic-series&#34;&gt;Harmonic series&lt;/h2&gt;&#xA;&lt;p&gt;Consider the &lt;a href=&#34;https://en.wikipedia.org/w/index.php?title=Harmonic_series_(mathematics)&amp;amp;oldid=1084636242&#34;&gt;harmonic series&lt;/a&gt; &lt;span class=&#34;katex&#34;&gt;&lt;span class=&#34;katex-mathml&#34;&gt;&lt;math xmlns=&#34;http://www.w3.org/1998/Math/MathML&#34;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mfrac&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/mfrac&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mfrac&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/mfrac&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mo&gt;…&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&#34;application/x-tex&#34;&gt;1 + \frac12 + \frac13 + \dots&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&#34;katex-html&#34; aria-hidden=&#34;true&#34;&gt;&lt;span class=&#34;base&#34;&gt;&lt;span class=&#34;strut&#34; style=&#34;height:0.7278em;vertical-align:-0.0833em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mord&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;mspace&#34; style=&#34;margin-right:0.2222em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mbin&#34;&gt;+&lt;/span&gt;&lt;span class=&#34;mspace&#34; style=&#34;margin-right:0.2222em;&#34;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;base&#34;&gt;&lt;span class=&#34;strut&#34; style=&#34;height:1.1901em;vertical-align:-0.345em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mord&#34;&gt;&lt;span class=&#34;mopen nulldelimiter&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mfrac&#34;&gt;&lt;span class=&#34;vlist-t vlist-t2&#34;&gt;&lt;span class=&#34;vlist-r&#34;&gt;&lt;span class=&#34;vlist&#34; style=&#34;height:0.8451em;&#34;&gt;&lt;span style=&#34;top:-2.655em;&#34;&gt;&lt;span class=&#34;pstrut&#34; style=&#34;height:3em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;sizing reset-size6 size3 mtight&#34;&gt;&lt;span class=&#34;mord mtight&#34;&gt;&lt;span class=&#34;mord mtight&#34;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;top:-3.23em;&#34;&gt;&lt;span class=&#34;pstrut&#34; style=&#34;height:3em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;frac-line&#34; style=&#34;border-bottom-width:0.04em;&#34;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;top:-3.394em;&#34;&gt;&lt;span class=&#34;pstrut&#34; style=&#34;height:3em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;sizing reset-size6 size3 mtight&#34;&gt;&lt;span class=&#34;mord mtight&#34;&gt;&lt;span class=&#34;mord mtight&#34;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;vlist-s&#34;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;vlist-r&#34;&gt;&lt;span class=&#34;vlist&#34; style=&#34;height:0.345em;&#34;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;mclose nulldelimiter&#34;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;mspace&#34; style=&#34;margin-right:0.2222em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mbin&#34;&gt;+&lt;/span&gt;&lt;span class=&#34;mspace&#34; style=&#34;margin-right:0.2222em;&#34;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;base&#34;&gt;&lt;span class=&#34;strut&#34; style=&#34;height:1.1901em;vertical-align:-0.345em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mord&#34;&gt;&lt;span class=&#34;mopen nulldelimiter&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mfrac&#34;&gt;&lt;span class=&#34;vlist-t vlist-t2&#34;&gt;&lt;span class=&#34;vlist-r&#34;&gt;&lt;span class=&#34;vlist&#34; style=&#34;height:0.8451em;&#34;&gt;&lt;span style=&#34;top:-2.655em;&#34;&gt;&lt;span class=&#34;pstrut&#34; style=&#34;height:3em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;sizing reset-size6 size3 mtight&#34;&gt;&lt;span class=&#34;mord mtight&#34;&gt;&lt;span class=&#34;mord mtight&#34;&gt;3&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;top:-3.23em;&#34;&gt;&lt;span class=&#34;pstrut&#34; style=&#34;height:3em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;frac-line&#34; style=&#34;border-bottom-width:0.04em;&#34;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;top:-3.394em;&#34;&gt;&lt;span class=&#34;pstrut&#34; style=&#34;height:3em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;sizing reset-size6 size3 mtight&#34;&gt;&lt;span class=&#34;mord mtight&#34;&gt;&lt;span class=&#34;mord mtight&#34;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;vlist-s&#34;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;vlist-r&#34;&gt;&lt;span class=&#34;vlist&#34; style=&#34;height:0.345em;&#34;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;mclose nulldelimiter&#34;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;mspace&#34; style=&#34;margin-right:0.2222em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mbin&#34;&gt;+&lt;/span&gt;&lt;span class=&#34;mspace&#34; style=&#34;margin-right:0.2222em;&#34;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;base&#34;&gt;&lt;span class=&#34;strut&#34; style=&#34;height:0.123em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;minner&#34;&gt;…&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&#xA;. Apparently, it was Donald Knuth who in 1968 (vol 1 of TAOCP, section 1.2.7 &amp;ldquo;Harmonic numbers&amp;rdquo;) gave the name &amp;ldquo;harmonic number&amp;rdquo; and the notation &lt;span class=&#34;katex&#34;&gt;&lt;span class=&#34;katex-mathml&#34;&gt;&lt;math xmlns=&#34;http://www.w3.org/1998/Math/MathML&#34;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;H&lt;/mi&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;annotation encoding=&#34;application/x-tex&#34;&gt;H_n &lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&#34;katex-html&#34; aria-hidden=&#34;true&#34;&gt;&lt;span class=&#34;base&#34;&gt;&lt;span class=&#34;strut&#34; style=&#34;height:0.8333em;vertical-align:-0.15em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mord&#34;&gt;&lt;span class=&#34;mord mathnormal&#34; style=&#34;margin-right:0.08125em;&#34;&gt;H&lt;/span&gt;&lt;span class=&#34;msupsub&#34;&gt;&lt;span class=&#34;vlist-t vlist-t2&#34;&gt;&lt;span class=&#34;vlist-r&#34;&gt;&lt;span class=&#34;vlist&#34; style=&#34;height:0.1514em;&#34;&gt;&lt;span style=&#34;top:-2.55em;margin-left:-0.0813em;margin-right:0.05em;&#34;&gt;&lt;span class=&#34;pstrut&#34; style=&#34;height:2.7em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;sizing reset-size6 size3 mtight&#34;&gt;&lt;span class=&#34;mord mathnormal mtight&#34;&gt;n&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;vlist-s&#34;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;vlist-r&#34;&gt;&lt;span class=&#34;vlist&#34; style=&#34;height:0.15em;&#34;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&#xA;to the partial sums of this series: &lt;span class=&#34;katex-display&#34;&gt;&lt;span class=&#34;katex&#34;&gt;&lt;span class=&#34;katex-mathml&#34;&gt;&lt;math xmlns=&#34;http://www.w3.org/1998/Math/MathML&#34; display=&#34;block&#34;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;H&lt;/mi&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mfrac&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/mfrac&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mfrac&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/mfrac&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mo&gt;⋯&lt;/mo&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mfrac&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;/mfrac&gt;&lt;/mrow&gt;&lt;annotation encoding=&#34;application/x-tex&#34;&gt;H_n = 1 + \frac12 + \frac13 + \dots + \frac1n&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&#34;katex-html&#34; aria-hidden=&#34;true&#34;&gt;&lt;span class=&#34;base&#34;&gt;&lt;span class=&#34;strut&#34; style=&#34;height:0.8333em;vertical-align:-0.15em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mord&#34;&gt;&lt;span class=&#34;mord mathnormal&#34; style=&#34;margin-right:0.08125em;&#34;&gt;H&lt;/span&gt;&lt;span class=&#34;msupsub&#34;&gt;&lt;span class=&#34;vlist-t vlist-t2&#34;&gt;&lt;span class=&#34;vlist-r&#34;&gt;&lt;span class=&#34;vlist&#34; style=&#34;height:0.1514em;&#34;&gt;&lt;span style=&#34;top:-2.55em;margin-left:-0.0813em;margin-right:0.05em;&#34;&gt;&lt;span class=&#34;pstrut&#34; style=&#34;height:2.7em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;sizing reset-size6 size3 mtight&#34;&gt;&lt;span class=&#34;mord mathnormal mtight&#34;&gt;n&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;vlist-s&#34;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;vlist-r&#34;&gt;&lt;span class=&#34;vlist&#34; style=&#34;height:0.15em;&#34;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;mspace&#34; style=&#34;margin-right:0.2778em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mrel&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;mspace&#34; style=&#34;margin-right:0.2778em;&#34;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;base&#34;&gt;&lt;span class=&#34;strut&#34; style=&#34;height:0.7278em;vertical-align:-0.0833em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mord&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;mspace&#34; style=&#34;margin-right:0.2222em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mbin&#34;&gt;+&lt;/span&gt;&lt;span class=&#34;mspace&#34; style=&#34;margin-right:0.2222em;&#34;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;base&#34;&gt;&lt;span class=&#34;strut&#34; style=&#34;height:2.0074em;vertical-align:-0.686em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mord&#34;&gt;&lt;span class=&#34;mopen nulldelimiter&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mfrac&#34;&gt;&lt;span class=&#34;vlist-t vlist-t2&#34;&gt;&lt;span class=&#34;vlist-r&#34;&gt;&lt;span class=&#34;vlist&#34; style=&#34;height:1.3214em;&#34;&gt;&lt;span style=&#34;top:-2.314em;&#34;&gt;&lt;span class=&#34;pstrut&#34; style=&#34;height:3em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mord&#34;&gt;&lt;span class=&#34;mord&#34;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;top:-3.23em;&#34;&gt;&lt;span class=&#34;pstrut&#34; style=&#34;height:3em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;frac-line&#34; style=&#34;border-bottom-width:0.04em;&#34;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;top:-3.677em;&#34;&gt;&lt;span class=&#34;pstrut&#34; style=&#34;height:3em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mord&#34;&gt;&lt;span class=&#34;mord&#34;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;vlist-s&#34;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;vlist-r&#34;&gt;&lt;span class=&#34;vlist&#34; style=&#34;height:0.686em;&#34;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;mclose nulldelimiter&#34;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;mspace&#34; style=&#34;margin-right:0.2222em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mbin&#34;&gt;+&lt;/span&gt;&lt;span class=&#34;mspace&#34; style=&#34;margin-right:0.2222em;&#34;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;base&#34;&gt;&lt;span class=&#34;strut&#34; style=&#34;height:2.0074em;vertical-align:-0.686em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mord&#34;&gt;&lt;span class=&#34;mopen nulldelimiter&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mfrac&#34;&gt;&lt;span class=&#34;vlist-t vlist-t2&#34;&gt;&lt;span class=&#34;vlist-r&#34;&gt;&lt;span class=&#34;vlist&#34; style=&#34;height:1.3214em;&#34;&gt;&lt;span style=&#34;top:-2.314em;&#34;&gt;&lt;span class=&#34;pstrut&#34; style=&#34;height:3em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mord&#34;&gt;&lt;span class=&#34;mord&#34;&gt;3&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;top:-3.23em;&#34;&gt;&lt;span class=&#34;pstrut&#34; style=&#34;height:3em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;frac-line&#34; style=&#34;border-bottom-width:0.04em;&#34;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;top:-3.677em;&#34;&gt;&lt;span class=&#34;pstrut&#34; style=&#34;height:3em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mord&#34;&gt;&lt;span class=&#34;mord&#34;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;vlist-s&#34;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;vlist-r&#34;&gt;&lt;span class=&#34;vlist&#34; style=&#34;height:0.686em;&#34;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;mclose nulldelimiter&#34;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;mspace&#34; style=&#34;margin-right:0.2222em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mbin&#34;&gt;+&lt;/span&gt;&lt;span class=&#34;mspace&#34; style=&#34;margin-right:0.2222em;&#34;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;base&#34;&gt;&lt;span class=&#34;strut&#34; style=&#34;height:0.6667em;vertical-align:-0.0833em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;minner&#34;&gt;⋯&lt;/span&gt;&lt;span class=&#34;mspace&#34; style=&#34;margin-right:0.2222em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mbin&#34;&gt;+&lt;/span&gt;&lt;span class=&#34;mspace&#34; style=&#34;margin-right:0.2222em;&#34;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;base&#34;&gt;&lt;span class=&#34;strut&#34; style=&#34;height:2.0074em;vertical-align:-0.686em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mord&#34;&gt;&lt;span class=&#34;mopen nulldelimiter&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mfrac&#34;&gt;&lt;span class=&#34;vlist-t vlist-t2&#34;&gt;&lt;span class=&#34;vlist-r&#34;&gt;&lt;span class=&#34;vlist&#34; style=&#34;height:1.3214em;&#34;&gt;&lt;span style=&#34;top:-2.314em;&#34;&gt;&lt;span class=&#34;pstrut&#34; style=&#34;height:3em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mord&#34;&gt;&lt;span class=&#34;mord mathnormal&#34;&gt;n&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;top:-3.23em;&#34;&gt;&lt;span class=&#34;pstrut&#34; style=&#34;height:3em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;frac-line&#34; style=&#34;border-bottom-width:0.04em;&#34;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;top:-3.677em;&#34;&gt;&lt;span class=&#34;pstrut&#34; style=&#34;height:3em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mord&#34;&gt;&lt;span class=&#34;mord&#34;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;vlist-s&#34;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;vlist-r&#34;&gt;&lt;span class=&#34;vlist&#34; style=&#34;height:0.686em;&#34;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;mclose nulldelimiter&#34;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Huffman versus top-down coding</title>
      <link>/post/huffman-versus-top-down/</link>
      <pubDate>Sat, 20 Feb 2021 18:40:22 -0800</pubDate>
      <guid>/post/huffman-versus-top-down/</guid>
      <description>&lt;p&gt;&lt;em&gt;(Apologies for the rather incoherent nature of this post — I&amp;rsquo;m trying, as an experiment to push myself to post more, to &amp;ldquo;write more quickly&amp;rdquo;, so a lot of things here are not explained in a way that makes sense and some of it is even nonsensical: forget &amp;ldquo;polishing&amp;rdquo; for precision or clarity; I haven&amp;rsquo;t even written it down reasonably the first time. But whatever…)&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Since last week I&amp;rsquo;ve been attending a weekly &lt;a href=&#34;https://www.meetup.com/theartofcomputerprogramming/&#34;&gt;&amp;ldquo;meetup&amp;rdquo;&lt;/a&gt; (book club / study group) for studying TAOCP (&lt;em&gt;The Art of Computer Programming&lt;/em&gt; by Donald Knuth). Today, we were reading about Huffman trees, and &lt;a href=&#34;http://www.club.cc.cmu.edu/~ajo/&#34;&gt;Arthur O&amp;rsquo;Dwyer&lt;/a&gt; (through &lt;a href=&#34;https://quuxplusone.github.io/blog/2020/12/13/bubblesort-rocksort-shakersort/&#34;&gt;whose blog&lt;/a&gt; I learned of this meetup, just before last week&amp;rsquo;s meeting) brought up an interesting question.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Manually adding an OCR layer to scanned PDF</title>
      <link>/post/add-ocr-layer-to-pdf/</link>
      <pubDate>Sat, 12 Sep 2020 15:32:59 -0700</pubDate>
      <guid>/post/add-ocr-layer-to-pdf/</guid>
      <description>&lt;p&gt;(Summary: How to add an invisible text layer to a PDF containing scanned images, using an OCR tool—in this case Google Cloud Vision API—that also gives the position of each recognized word.)&lt;/p&gt;&#xA;&lt;nav id=&#34;TableOfContents&#34;&gt;&#xA;  &lt;ul&gt;&#xA;    &lt;li&gt;&lt;a href=&#34;#background&#34;&gt;Background&lt;/a&gt;&lt;/li&gt;&#xA;    &lt;li&gt;&lt;a href=&#34;#exploration&#34;&gt;Exploration&lt;/a&gt;&#xA;      &lt;ul&gt;&#xA;        &lt;li&gt;&lt;a href=&#34;#json-response&#34;&gt;JSON response&lt;/a&gt;&lt;/li&gt;&#xA;        &lt;li&gt;&lt;a href=&#34;#tex-side-of-things&#34;&gt;TeX side of things&lt;/a&gt;&lt;/li&gt;&#xA;      &lt;/ul&gt;&#xA;    &lt;/li&gt;&#xA;    &lt;li&gt;&lt;a href=&#34;#results&#34;&gt;Results&lt;/a&gt;&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/nav&gt;&#xA;&lt;h2 id=&#34;background&#34;&gt;Background&lt;/h2&gt;&#xA;&lt;p&gt;Situation: A printed book has been scanned into images, possibly assembled into a single PDF. As each page is just a picture, no text has been associated with it, and it is not searchable. To get there, either we need the text to be typed in manually by someone, or we need &lt;a href=&#34;https://en.wikipedia.org/w/index.php?title=Optical_character_recognition&amp;amp;oldid=977535752&#34;&gt;OCR&lt;/a&gt;. Either way, many errors are likely, so when we open the PDF we&amp;rsquo;d still like to see the scanned image, except that it would be nice if the text can be selected and copied (and also searched).&lt;/p&gt;</description>
    </item>
    <item>
      <title>Solving the set cover problem: an example</title>
      <link>/post/set-cover-ip/</link>
      <pubDate>Fri, 14 Aug 2020 11:47:01 -0700</pubDate>
      <guid>/post/set-cover-ip/</guid>
      <description>&lt;p&gt;This blog post is currently &lt;a href=&#34;https://colab.research.google.com/drive/1wbktvb8XWISitThnpRA5_MLZh0JaKcK6&#34;&gt;a notebook on Colab (click)&lt;/a&gt;; eventually I ought to clean it up and move it here.&lt;/p&gt;&#xA;&lt;p&gt;Posting it here in the meantime.&lt;/p&gt;</description>
    </item>
    <item>
      <title>A sequence of integer fractions</title>
      <link>/post/fractions-sequence/</link>
      <pubDate>Sun, 14 Jun 2020 06:47:01 -0700</pubDate>
      <guid>/post/fractions-sequence/</guid>
      <description>&lt;p&gt;This blog post is currently &lt;a href=&#34;https://colab.research.google.com/drive/1vsEE7XooIF1jHZKWZbElm5xUyZewr17Z&#34;&gt;a notebook on Colab (click)&lt;/a&gt;; eventually I ought to clean it up and move it here.&lt;/p&gt;&#xA;&lt;p&gt;Posting it here in the meantime.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Producing a &#34;program trace&#34; using GDB and Python</title>
      <link>/post/gdb-python-trace/</link>
      <pubDate>Fri, 17 Jan 2020 16:30:04 -0800</pubDate>
      <guid>/post/gdb-python-trace/</guid>
      <description>&lt;p&gt;Sometimes, to understand what a program is doing, I&amp;rsquo;m tempted to add a log message at the start and end of every function, something like &lt;code&gt;entering foo()&lt;/code&gt; and &lt;code&gt;returning from foo()&lt;/code&gt;. When there are only a few functions this is easy enough to do manually, but if you want it for &lt;em&gt;every&lt;/em&gt; function, some automation would be welcome. This could be automated using gcc&amp;rsquo;s &lt;code&gt;-finstrument-functions&lt;/code&gt;, but it (see &lt;a href=&#34;https://gcc.gnu.org/onlinedocs/gcc-4.4.7/gcc/Code-Gen-Options.html&#34;&gt;docs&lt;/a&gt;, &lt;a href=&#34;http://hacktalks.blogspot.com/2013/08/gcc-instrument-functions.html&#34;&gt;1&lt;/a&gt;, &lt;a href=&#34;https://stackoverflow.com/questions/6176284/why-doesnt-finstrument-functions-work-for-me&#34;&gt;2&lt;/a&gt;, &lt;a href=&#34;http://ndevilla.free.fr/etrace/&#34;&gt;wrapper&lt;/a&gt;) has some awkwardness, and somehow I never got the hang of it. An alternative is to use &lt;code&gt;gdb&lt;/code&gt;, and here we&amp;rsquo;ll see how. This has the advantage that refining the format of the logging, or the conditions under which it is printed, does not require editing and recompiling the program every time.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Knuth&#39;s programming and problem-solving seminars</title>
      <link>/post/dek-seminar/</link>
      <pubDate>Wed, 15 Jan 2020 14:37:18 -0800</pubDate>
      <guid>/post/dek-seminar/</guid>
      <description>&lt;p&gt;Looks like Knuth (and sometimes others) used to run a &amp;ldquo;Programming and Problem-Solving Seminar&amp;rdquo; at Stanford. Here&amp;rsquo;s a list (from &lt;a href=&#34;https://cs.stanford.edu/~knuth/vita.html&#34;&gt;DEK&amp;rsquo;s CV&lt;/a&gt;), and the reports that are available.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Jon Bentley&#39;s &#34;Programming Pearls&#34; columns, and Van Wyk&#39;s &#34;Literate Programming&#34; columns in the CACM</title>
      <link>/post/programming-pearls/</link>
      <pubDate>Fri, 27 Dec 2019 15:33:32 -0800</pubDate>
      <guid>/post/programming-pearls/</guid>
      <description>&lt;p&gt;Jon Bentley used to write a magazine column for the &lt;em&gt;Communications of the ACM&lt;/em&gt; called &amp;ldquo;Programming Pearls&amp;rdquo; (later collected into two books). A spin-off was a column called &amp;ldquo;Literate Programming&amp;rdquo;, by Christopher J. Van Wyk.&lt;/p&gt;&#xA;&lt;p&gt;It is hard to find a list of all these columns, so I&amp;rsquo;m compiling a list here.&lt;/p&gt;</description>
    </item>
    <item>
      <title>The Letter-Box (La boîte aux lettres) by René Bazin</title>
      <link>/post/bazin-letter-box/</link>
      <pubDate>Sat, 07 Dec 2019 12:50:35 -0800</pubDate>
      <guid>/post/bazin-letter-box/</guid>
      <description>&lt;p&gt;While reading &lt;a href=&#34;https://gowri.me/writing/2019/11/26/why-birds&#34;&gt;a beautiful post&lt;/a&gt; by Gowri Subramanya about birds, I remembered a story from one of our school textbooks, about a priest and his letter-box. Searching for relevant keywords found what appears to be the same story in a newer edition of the textbook &lt;a href=&#34;https://books.google.com/books?id=4EF3W-9cNG0C&amp;amp;pg=PT30&#34;&gt;on Google Books&lt;/a&gt; (or see &lt;a href=&#34;gulmohar.pdf&#34;&gt;as PDF here&lt;/a&gt;). (I vaguely remembered an English priest and the Archbishop of Canterbury, but that may have just been my memory confabulating. But I&amp;rsquo;d probably remember a village named just &amp;ldquo;Santa&amp;rdquo;(!), so this is probably not the exact version my textbook had.) There&amp;rsquo;s an even newer edition/variant of the textbook, with the story and language simplified even further, &lt;a href=&#34;https://books.google.com/books?id=Zs18zzEW2iEC&amp;amp;ppis=_c&amp;amp;pg=PA4-IA2&#34;&gt;here&lt;/a&gt; (&lt;a href=&#34;sangam.pdf&#34;&gt;PDF&lt;/a&gt;).&lt;/p&gt;</description>
    </item>
    <item>
      <title>Another blurry image puzzle</title>
      <link>/post/tablebook/</link>
      <pubDate>Sun, 20 Oct 2019 05:42:18 -0700</pubDate>
      <guid>/post/tablebook/</guid>
      <description>&lt;nav id=&#34;TableOfContents&#34;&gt;&lt;/nav&gt;&#xA;&lt;h1 id=&#34;background&#34;&gt;Background&lt;/h1&gt;&#xA;&lt;p&gt;Following up from &lt;a href=&#34;https://shreevatsa.net/post/megh/&#34;&gt;a previous post&lt;/a&gt;, I got this:&lt;/p&gt;&#xA;&lt;blockquote class=&#34;twitter-tweet&#34; data-conversation=&#34;none&#34; data-dnt=&#34;true&#34;&gt;&lt;p lang=&#34;en&#34; dir=&#34;ltr&#34;&gt;This request looks like an activity that might appeal to you, &lt;a href=&#34;https://twitter.com/svat?ref_src=twsrc%5Etfw&#34;&gt;@svat&lt;/a&gt; ji! 😅&lt;a href=&#34;https://t.co/q4Mr8d3PvR&#34;&gt;https://t.co/q4Mr8d3PvR&lt;/a&gt;&lt;/p&gt;&amp;mdash; Arvind Iyer (@longhandnotes) &lt;a href=&#34;https://twitter.com/longhandnotes/status/1185834128152940544?ref_src=twsrc%5Etfw&#34;&gt;October 20, 2019&lt;/a&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;(Click &lt;a href=&#34;#&#34; id=&#34;loadTwitterSpan&#34;&gt;here&lt;/a&gt; to load the fancier Twitter display for the above tweets—makes a request to Twitter—if you want it for some reason.)&lt;/p&gt;&#xA;&lt;script async id=&#34;mightLoadLater&#34; charset=&#34;utf-8&#34;&gt;&lt;/script&gt;&#xA;&lt;script&gt;&#xA;document.getElementById(&#34;loadTwitterSpan&#34;).addEventListener(&#39;click&#39;, () =&gt; { document.getElementById(&#34;mightLoadLater&#34;).src = &#34;https://platform.twitter.com/widgets.js&#34;; });&#xA;&lt;/script&gt;&#xA;&lt;p&gt;I should really not make a habit of going on random chases like this, but it was fun. Documenting steps taken.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Breaking pills</title>
      <link>/post/breaking-pills/</link>
      <pubDate>Fri, 04 Oct 2019 00:00:00 +0000</pubDate>
      <guid>/post/breaking-pills/</guid>
      <description>&lt;script&gt;&#xA;MathJax = {&#xA;  AuthorInit: function() { MathJax.Hub.processSectionDelay = 0; },&#xA;  tex: {&#xA;    inlineMath: [[&#39;$&#39;, &#39;$&#39;], [&#39;\\(&#39;, &#39;\\)&#39;]]&#xA;  },&#xA;  svg: {&#xA;    fontCache: &#39;global&#39;&#xA;  }&#xA;};&#xA;&lt;/script&gt;&#xA;&lt;script id=&#34;MathJax-script&#34; async src=&#34;https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js&#34;&gt;&lt;/script&gt;&#xA;&lt;p&gt;In a &lt;a href=&#34;https://blog.plover.com/math/breaking-pills.html&#34;&gt;recent post&lt;/a&gt;, Mark Jason Dominus posed the following question:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Suppose you have a bottle that contains \(N\) whole pills. Each day you select a pill at random from the bottle. If it is a whole pill you eat half and put the other half back in the bottle. If it is a half pill, you eat it. How many half-pills can you expect to have in the bottle the day after you break the last whole pill?&lt;/p&gt;</description>
    </item>
    <item>
      <title>History of Indian mathematics: IIT Gandhinagar (2017)</title>
      <link>/post/hist-math-2017/</link>
      <pubDate>Mon, 30 Sep 2019 23:10:38 -0700</pubDate>
      <guid>/post/hist-math-2017/</guid>
      <description>&lt;p&gt;There&amp;rsquo;s a nice series of videos on YouTube, here: &lt;a href=&#34;https://www.youtube.com/playlist?list=PLRfu94TCePTtgPLfyysqQPMqdwyJvy0Vf&#34;&gt;https://www.youtube.com/playlist?list=PLRfu94TCePTtgPLfyysqQPMqdwyJvy0Vf&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;According to the playlist title, it&amp;rsquo;s from “International Conference on Exploring the History of Indian Mathematics | December 4-6, 2017”&lt;/p&gt;&#xA;&lt;p&gt;All the talks are interesting if you are interested in Indian mathematics.&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt; Many are of general interest.&lt;/p&gt;&#xA;&lt;p&gt;Below are just some things I noted down / found worth remarking on. They are not &lt;em&gt;not&lt;/em&gt; summaries of the talks! In fact I was not paying complete attention when watching these videos; some I just listened to while doing other stuff. Also they are notes to myself so may not be very readable to anyone else, sorry.&lt;/p&gt;</description>
    </item>
    <item>
      <title>The poem in the notepaper used for “Here Comes The Sun”</title>
      <link>/post/megh/</link>
      <pubDate>Mon, 30 Sep 2019 19:16:55 -0700</pubDate>
      <guid>/post/megh/</guid>
      <description>&lt;nav id=&#34;TableOfContents&#34;&gt;&lt;/nav&gt;&#xA;&lt;h1 id=&#34;background&#34;&gt;Background&lt;/h1&gt;&#xA;&lt;p&gt;One day, after a few days of managing to avoid Twitter, I logged in and happened to see these:&lt;/p&gt;&#xA;&lt;blockquote class=&#34;twitter-tweet&#34; data-dnt=&#34;true&#34;&gt;&lt;p lang=&#34;en&#34; dir=&#34;ltr&#34;&gt;👆🏾&lt;a href=&#34;https://twitter.com/suhasm?ref_src=twsrc%5Etfw&#34;&gt;@suhasm&lt;/a&gt;, Are you able to discern which verse it is that&amp;#39;s illegibly rendered in the picture?&lt;/p&gt;&amp;mdash; Arvind Iyer (@longhandnotes) &lt;a href=&#34;https://twitter.com/longhandnotes/status/1169498511114670080?ref_src=twsrc%5Etfw&#34;&gt;September 5, 2019&lt;/a&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&lt;blockquote class=&#34;twitter-tweet&#34; data-dnt=&#34;true&#34;&gt;&lt;p lang=&#34;en&#34; dir=&#34;ltr&#34;&gt;Not sure. Don&amp;#39;t think its Sanskrit. Prolly Hindi&lt;/p&gt;&amp;mdash; Suhas Mahesh (@suhasm) &lt;a href=&#34;https://twitter.com/suhasm/status/1169515104997650432?ref_src=twsrc%5Etfw&#34;&gt;September 5, 2019&lt;/a&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;(Click &lt;a href=&#34;#&#34; id=&#34;loadTwitterSpan&#34;&gt;here&lt;/a&gt; to load the fancier Twitter display for the above tweets—makes a request to Twitter—if you want it for some reason.)&lt;/p&gt;</description>
    </item>
    <item>
      <title>Don&#39;t mess with a genius</title>
      <link>/post/dont-mess-with-a-genius/</link>
      <pubDate>Fri, 04 Jun 2010 00:00:00 +0000</pubDate>
      <guid>/post/dont-mess-with-a-genius/</guid>
      <description>&lt;p&gt;&lt;em&gt;(Migrated from &lt;a href=&#34;https://shreevatsa.wordpress.com/2010/06/04/dont-mess-with-a-genius/&#34;&gt;my older blog&lt;/a&gt; without any changes, as free wordpress.com blogs are infested with ads now.)&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Or: What happens when Newton’s laws are violated&lt;/p&gt;&#xA;&lt;p&gt;Recently, I read a book called &lt;em&gt;&lt;strong&gt;Newton and the Counterfeiter&lt;/strong&gt;&lt;/em&gt;, subtitled &lt;em&gt;&lt;strong&gt;The Unknown Detective Career of the World’s Greatest Scientist&lt;/strong&gt;&lt;/em&gt;. It focuses on an awesome phase of Isaac Newton’s later career that, like his pursuits in alchemy, gets little mention in most accounts. The story, of Newton’s job as Warden of the Mint and his efforts bringing criminals to justice, contains many elements of a modern crime thriller: including an ingenious arch-adversary, Newton visiting the gin houses of London in disguise, personally interrogating suspects, playing good cop–bad cop, and using every trick in the book, before the book had been written. The story begins, as many of them do, at the beginning.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
