↓ Skip to main content

Posts

2026
2025
2024
2023
2022
Less More

2024

On tutoring

The current tutoring activity I’m doing is a redemption tour for me. My first attempt at tutoring was a mess. The victim was my daughter and I managed to alienate math material for her so much that she hates it to this day Sorry, baby, if you’re reading this. I’m very, very sorry 😊. . That’s heartbreaking because I achieved the opposite of what I wanted. She is in college now and cautiously and apprehensively approaching the material again (she did statistics last semester).

Tutoring setup

Occasionally I have to help some of my younger relatives that are still in school or college understand some of the material they learn. I can cover programming, math and physics. Since we’re geographically dispersed, the tutoring has to happen virtually. For a programming session this is easy. We have a shared editor and a video session going. I usually use Repl.it. For help on a paper we use Google Docs or Overleaf.

Sequences and Series

Select exercises on sequences and series. open full screen ↗ Your browser can't display this PDF inline. Open it directly.

North Woods

North Woods by Daniel Mason I enjoyed this book a lot. The episodes are interesting, the writing is superb and it reminds me of David Mitchell’s Cloud Atlas. It has a little sad, nostalgic undertone coming from the long window of time spanning the episodes in the book. People come into the scope of the house and then disappear again. The permanence of the location is in sharp contrast to the transient existence of the house inhabitants. Some episodes end so abruptly they leave you yearning for more (probably and cleverly intentional).

James McBride

Deacon King Kong by James McBride Heaven and Earth Grocery Store by James McBride James McBride completely hooked me with Deacon King Kong and he did it again with The Heaven and Earth Grocery Store. His characters are so compelling, they stay with you long after you finish his books. Their stories feel like old family stories. His dialog is superb, and often very funny. And he rips out your heart with some devastatingly beautiful scenes in both books (Dodo and Monkey Pants in The Heaven and Earth Grocery Store, Sportcoat and Hettie in Deacon King Kong). Easily one of my favorite writers.

Knuth-Morris-Pratt Algorithm

In this Haskell cicada we will read the recently published Functional Pearl Knuth-Morris-Pratt illustrated. We will use the same strategy we used in understanding the cycle finding function, namely slowly deconstructing the functions and playing with them in the ghci repl (we use the Haskell setup described here). The first function we dissect is scanl used in the paper in what looks like a convoluted way to get all possible suffixes of a string.

Two algebraic delights

Finding a correspondence between mathematical objects and algebraic expressions. open full screen ↗ Your browser can't display this PDF inline. Open it directly.

File servers

Since the last Haskell cicada: Electromagnet Pulse was so much fun, let’s do another one from the same chapter from “Algorithm Design” by Jon Kleinberg and Éva Tardos. Algorithm design by Jon Kleinberg, Éva Tardos The exercise is Exercise 12 on page 323: Suppose we want to replicate a file over a collection of $n$ servers, labeled $S_1, S_2, \ldots, S_n$. To place a copy of the file at server $S_i$ results in a placement cost of $c_i$, for an integer $c_i > 0$. Now, if a user requests the file from server $S_i$, and no copy of the file is present at $S_i$, then the servers $S_{i+1}, S_{i+2}, S_{i+3} \ldots$ are searched in order until a copy of the file is finally found, say at server $S_j$, where $j > i$. This results in an access cost of $j − i$. (Note that the lower-indexed servers $S_{i−1}, S_{i−2}, \ldots$ are not consulted in this search.) The access cost is $0$ if $S_i$ holds a copy of the file. We will require that a copy of the file be placed at server $S_n$, so that all such searches will terminate, at the latest, at $S_n$. We’d like to place copies of the files at the servers so as to minimize the sum of placement and access costs. Formally, we say that a configuration is a choice, for each server $S_i$ with $i = 1, 2, \ldots, n − 1$, of whether to place a copy of the file at $S_i$ or not. (Recall that a copy is always placed at $S_n$.) The total cost of a configuration is the sum of all placement costs for servers with a copy of the file, plus the sum of all access costs associated with all $n$ servers. Give a polynomial-time algorithm to find a configuration of minimum total cost.

2023

Electromagnetic Pulse

This Haskell cicada came about because sometimes, when I’m bored, I pick a random exercise from a random book and try to solve it. In this case the book was “Algorithm Design” by Jon Kleinberg and Éva Tardos. Algorithm design by Jon Kleinberg, Éva Tardos The exercise I randomly picked from the book is Exercise 8 on page 319: The residents of the underground city of Zion defend themselves through a combination of kung fu, heavy artillery, and efficient algorithms. Recently they have become interested in automated methods that can help fend off attacks by swarms of robots.

LaTeX setup

Intro # As I mentioned in the Intro of the Haskell setup post, tooling changes often and becomes outdated quickly. So why write this post at all? Honestly, it is mostly for me, like much of this blog I don’t think I have (m)any readers 🙂. . My math notes are infrequent enough (my last one was six months ago) that I run the risk of forgetting the details of this Rube Goldberg machine of a workflow and then I won’t be able to maintain or fix it.

Haskell setup revisited

I said in Haskell setup that posts like these don’t age well. And sure enough, here I am with a revision. After dipping my toes in the Haskell testing waters I wanted a project scaffolding that is different from what cabal init generates: I wanted a proper testing setup that allows me to also test module internals. I also wanted to solve having saved snippets of bindings loaded into the repl so I don’t have to repeatedly type the same expressions. After a bunch of trials and errors I settled on the project structure as seen in magicsquare. It breaks out internals into a separate module so it can be tested. It defines an Examples module that imports the other two modules and defines snippets useful in the repl. I invoke the repl like so:

Haskell setup

Intro # Posts like this one don’t age well. Tooling changes all the time. And the other thing is: I do Haskell just for fun, ie silly little exercises with only pure functions. So take this setup with a grain of salt. And if you stumbled on this from the future, there’s probably better options for you. With these disclaimers out of the way, let’s see the setup.

Connected Magic Squares (Part 5)

Imagine a 6 by 6 grid of squares, that can either be black or white. It has to fulfill the following properties: 1. Each row and column needs to have 3 white and 3 black squares. 2. All black squares have to be orthogonally connected. Prove that such a grid cannot exist. part 1: naive brute force exhaustive search part 2: smarter exhaustive search part 3: inductive graphs part 4: connected magic squares part 5: experiments Note: in our digital representation black squares are ones and white squares are zeros.

Connected Magic Squares (Part 4)

Imagine a 6 by 6 grid of squares, that can either be black or white. It has to fulfill the following properties: 1. Each row and column needs to have 3 white and 3 black squares. 2. All black squares have to be orthogonally connected. Prove that such a grid cannot exist. part 1: naive brute force exhaustive search part 2: smarter exhaustive search part 3: inductive graphs part 4: connected magic squares part 5: experiments Note: in our digital representation black squares are ones and white squares are zeros.

Connected Magic Squares (Part 3)

Imagine a 6 by 6 grid of squares, that can either be black or white. It has to fulfill the following properties: 1. Each row and column needs to have 3 white and 3 black squares. 2. All black squares have to be orthogonally connected. Prove that such a grid cannot exist. part 1: naive brute force exhaustive search part 2: smarter exhaustive search part 3: inductive graphs part 4: connected magic squares part 5: experiments Note: in our digital representation black squares are ones and white squares are zeros.

Connected Magic Squares (Part 2)

Imagine a 6 by 6 grid of squares, that can either be black or white. It has to fulfill the following properties: 1. Each row and column needs to have 3 white and 3 black squares. 2. All black squares have to be orthogonally connected. Prove that such a grid cannot exist. part 1: naive brute force exhaustive search part 2: smarter exhaustive search part 3: inductive graphs part 4: connected magic squares part 5: experiments Note: in our digital representation black squares are ones and white squares are zeros.

Connected Magic Squares (Part 1)

part 1: naive brute force exhaustive search part 2: smarter exhaustive search part 3: inductive graphs part 4: connected magic squares part 5: experiments I found this problem on one of my Mastodon feeds: Imagine a 6 by 6 grid of squares, that can either be black or white. It has to fulfill the following properties: 1. Each row and column needs to have 3 white and 3 black squares. 2. All black squares have to be orthogonally connected. Prove that such a grid cannot exist. Note: in our digital representation black squares are ones and white squares are zeros.

Deadloch

I recently needed a distraction for a ten-hour flight. I cannot sleep on flights and I’m also too uncomfortable to do any real work or read. So it has to be binging a show. I chose Deadloch, a murder mystery show with eight one hour episodes, making it the ideal length for a ten hour flight assuming it is compelling enough to stick around.

Transcription

Transcription by Kate Atkinson, Fenella Woolgar Kate Atkinson’s novel Transcription is the answer to the question of what happens if you take the wicked humor of Martin Amis, John Le Carre prose elegance and the emotional honesty of Iris Murdoch and blend them all together. Transcription tells the story of Juliet Armstrong in two periods of her life: during World War II and in the 1950’s. Juliet is a compelling protagonist, winning you over with her witty retorts and hilariously devastating inner monologue while navigating absurd situations caused mostly by often inept men and their spy games. During World War II she has been pulled into the war effort working as a transcriber of audio recordings of British Nazis. In the 1950’s we find her employed as a producer of children radio programs at the BBC. In both settings Atkinson aptly captures the work environments, the camaraderie that forms, the incompetence of superiors with their “my girl” sexism. The BBC producer period is of course lower stakes than the WWII life and death situations but lucky for us readers, wounds from Juliet’s spying past resurface and demand to be resolved. The plot is engaging but not overheated so you can still enjoy the writing which is excellent without fighting the urge to skip ahead just to find out what happened. Atkinson keeps you guessing by alternating between the two periods in Juliet’s life, leaving traces in the earlier period that get explained and resolved in the later period. She also does it with shorter timeframes, first describing a situation and then revealing its meaning. This is done very skillfully, you always feel you’re in good hands.

Keyoxide

Introduction # People are familiar by now with the Mastodon account verification system: if you want to prove that you own both a particular Mastodon account and a particular website By owning I mean you hold the login credentials. , you add a link with the rel="me" attribute to your website pointing back to your Mastodon profile and in the Mastodon profile you add a link to your website page that contains that rel="me" anchor. The Mastodon instance will fetch that page, find the rel="me" anchor and reward you with a green checkmark next to your website link in your Mastodon profile. This is very simple and straightforward but it does imply a certain level of trust in the Mastodon instance doing the verification.