Chapters: Ch 1 · Ch 2 · Ch 3 · Ch 4 · Ch 5
Concurrency: Dining Philosophers (Java, LeetCode)
Dining Philosophers — LeetCode https://leetcode.com/problems/the-dining-philosophers/
The classic concurrency problem formalised as a LeetCode challenge: five philosophers sit around a table, alternately thinking and eating, each needing two forks to eat. The challenge is to implement a deadlock-free, starvation-free solution using Java locks. [→ algorithms-data-structures; scala-functional-programming]
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import java.util.ArrayList;
class DiningPhilosophers {
private final ArrayList<Lock> forks = new ArrayList<Lock>();
public DiningPhilosophers() {
for (int i = 0; i < 5; i++) {
forks.add(new ReentrantLock(false));
}
}
// ... wantsToEat implementation
}
fold / Short-Circuiting
Breaking out of the fold (Ethan Kent’s dev blog) Namely, we sometimes want to break out of the iteration within fold, but it is not easy to do in many languages. https://ethankent.dev/posts/breaking_fold/
A blog post addressing the functional programming problem of early termination inside fold/reduce operations. Since fold is defined to consume the entire structure, breaking out requires encoding the early-exit state in the accumulator or using alternative combinators like find or lazy evaluation. [→ algorithms-data-structures; scala-functional-programming]
Graph Theory
Massimo (@Rainmaker1973): Henri Poincaré proved the non-existence of the uniform first integral of the three-body problem and the sensitive dependence to initial conditions of its trajectories. https://x.com/Rainmaker1973/status/1830309619966554272
A tweet sharing Poincaré’s key result: the three-body gravitational problem has no closed-form analytical solution (no uniform first integral), yet stable quasi-periodic solutions do exist. This was a founding result of chaos theory — deterministic systems can be unpredictable. [→ mathematics-science]
Edward Kmett: Ask yourself why B-trees exist and are provably optimal for so many applications https://x.com/kmett/status/1811904210021286014
A thought-provoking tweet by Haskell celebrity Edward Kmett prompting programmers to think about the mathematical foundations of B-trees — specifically why the I/O-aware model of computation makes B-trees provably optimal for disk-based data access, connecting algorithm analysis to hardware realities. [→ algorithms-data-structures; scala-functional-programming]
Probability
Applied Problems In Probability Theory — E. Wentzel https://archive.org/details/wentzel-ovcharov-applied-problems-in-probability-theory
A classic Soviet-era probability textbook by Elena Wentzel (with Ovcharov) containing hundreds of applied problems across Markov chains, queuing theory, reliability, and statistics. Known for its engineering-oriented approach and available in full on archive.org. [→ mathematics-science; algorithms-data-structures]
Exercises in Probability (Grimmett-Stirzaker, Oxford) https://people.sabanciuniv.edu/atilgan/FE507_Fall2014/ProblemsProblems/Grimmett-Stirzaker_Oxford01_ExercisesInProbability.pdf
The companion exercise book to the famous “Probability and Random Processes” by Grimmett and Stirzaker — one of the standard graduate probability texts. The exercises are rigorous and cover discrete and continuous probability, Markov chains, and stochastic processes. [→ mathematics-science]
Probability Theory — Jaynes http://www.med.mcgill.ca/epidemiology/hanley/bios601/GaussianModel/JaynesProbabilityTheory.pdf
E.T. Jaynes’s monumental “Probability Theory: The Logic of Science” — treats probability as an extension of Aristotelian logic and argues Bayesian inference is the only consistent framework for reasoning under uncertainty. A landmark work freely available as a PDF. [→ mathematics-science]
Birthday problem — Wikipedia https://en.wikipedia.org/wiki/Birthday_problem
The famous birthday problem: in a group of just 23 people, there is a greater than 50% chance that two share a birthday. A counterintuitive result in combinatorial probability that illustrates the power of the complement approach and the non-linearity of collision probability. [→ mathematics-science; algorithms-data-structures]
Coin flip sequences notation:
(HT)HH(HT) => AAA, B
(HT)HT(HT) => A, BB
(HT)TH(HT) => A, BB
(HT)TT(HT) => B
Personal notes developing a compact notation for encoding coin flip subsequence patterns — likely related to exploration of pattern matching or probability of sequence occurrences. [→ algorithms-data-structures; mathematics-science]
Topology / Category Theory
If the Universe Is a Hologram, This Long-Forgotten Math Could Decode It | Quanta Magazine A 1930s-era breakthrough is helping physicists understand holographic space-time. https://www.quantamagazine.org/if-the-universe-is-a-hologram-this-long-forgotten-math-could-decode-it-20240925/
A Quanta Magazine article on how spinors and Clifford algebras — developed in the 1930s — are now central to understanding holographic space-time in quantum gravity. The math connects geometry, quantum mechanics, and information theory in surprising ways. [→ mathematics-science]
“Conceptual Mathematics: A First Introduction to Categories” (Lawvere, Schanuel) https://www.amazon.com/Conceptual-Mathematics-First-Introduction-Categories/dp/052171916X
An accessible introduction to category theory written by two of the field’s founders (Lawvere and Schanuel). More approachable than Mac Lane’s “Categories for the Working Mathematician,” aimed at students and those from non-mathematical backgrounds wanting to understand categorical thinking. [→ mathematics-science; scala-functional-programming]
Category theory without categories (johndcook.com) https://www.johndcook.com/blog/2023/05/22/category-theory-without-categories/
A blog post by John D. Cook explaining the core ideas of category theory (composition, identity, naturality, universality) without the full abstract machinery — making the concepts accessible to programmers and applied mathematicians who find the formal definition off-putting. [→ mathematics-science; scala-functional-programming]