2026 Sept/Oct Mindbenders
Mindbenders
October
It has been too long since my last post, so let’s get back into it with some easy. Given two random balls that intersect in \(\mathbb{R}^d\); what is the expected volume of their intersection?
Of course, the above is actually underspecified (see Bertrands paradox). More precisely, we specify that we have a ball at the origin, and a second ball sampled uniformly with center inside the ball of radius \(2\).
Initial attempts
Somehow, I managed to overcomplicate this quite a bit. So first, consider \(d=1\). By symmetry, we can assume WLOG that the random ball always has positive center. Thus, an integral obtains the answer
\[ \int_{0}^1 (0.5) (2-x) \text{d}x + \int_1^2 (0.5) (x - 1) \text{d}x = 1 \]
where \((2-x)\) and \((x-1)\) are the lengths of intersection between two intervals of length \(2\), for \(x\) center less than 1 or between 1 and 2 respectively, and \(0.5\) is the probability density at any point.
A slightly nicer, but equivalent integral, is to consider the left endpoint from \(-1\) to \(1\), so that the area of intersection is always \(1-x\):
\[ \int_{-1}^1 (0.5) (1-x) \text{d}x = 1 \]
This approach does not extend to 2D easily (lots of gross algebra). Somehow, I thought there were a few things that should make this nice:
- we have two objects that are the same shape
- the particular object is a sphere, which is nicely symmetric
I wanted to use both of these properties, and so what I thought was to consider a random process with both of these intervals. Originally, I wanted them to have centers anywhere in the plane, but then the density functions are hard to define. Thus, I tried having them be contained in some region \(A(r)\), where \(r\) is some scaling factor that I will have limit towards \(\infty\).
I remembered that the expected distance between two points in a rectangle in \(\mathbb{R}^d\) can be calculated (which is relevant in k-nearest neighbors, with the curse of dimensionality)> Thus, intuitively, I thought that this meant we can calculate the probability of them intersecting, and use the decomposition
\[ \begin{align} \textbf{Ev}(\text{area of union}) & = \textbf{Ev}(\text{area of union} \mid \text{intersect}) \textbf{P}(\text{intersect}) \\ & + \textbf{Ev}(\text{area of union} \mid \text{not intersect}) \textbf{P}(\text{not intersect}) \end{align} \]
Now, given that two balls don’t intersect, the area of union is easy (just the sum). The area of union given they intersect is what we want to find. So, what remains is to find the probability of not intersecting (which is perhaps a simpler integral, of which I doing in the past), and also the area of the union. Then, this area of union can be calculated using linearity of expectation; as each ball is placed independently, if \(p\) is the probability that a point is not covered by one ball, then \(p^2\) is the probability that it is not covered by both.
Doing this calculation… is messy and I started realizing there is probably some better way. Indeed, because I am already using linearity of expectation, looking at the probability of each point, it is actually easy to calculate it directly!
The Solution
Consider again the process where we place a unit disk with center uniformly chosen from the disk of radius \(2\). We know any point \(p\) in the intersection (with this random disk, and the disk at the origin) is within the disk of radius \(1\) from the origin. Then, for this point, we can consider the probability that its in the intersection, and then sum up over all points in the unit ball.
Now, consider where must the second ball be in order for \(p\) to be in the intersection – the center must be in the unit ball centered at \(p\)! The probability that this is the case is exactly \(2^{-d}\), as this is the ratio of the volume of a unit ball (the success space) over the volume of a ball of radius \(2\) (the sample space). Putting this together, we obtain an answer of
\[ \frac{\pi^{d/2}}{\Gamma(d/2 + 1) \cdot 2^d} \]
which comes from the volume of a unit ball embedded in \(\mathbb{R}^d\).
I tried to exploit too much structure in the problem, before trying more straightforward methods. Think about what is relevant; work out some examples!
September
Given a 10-digit number, ending in an odd number excluding \(5\), show that there is a multiple that consists only of ones.
I have no idea what p-adic numbers are, but I’ve seen visuals that remind me of this. In any case, the following documents my stream-of-thoughts for solving this puzzle.
attempts
Taking my lesson from October, I considered some examples. First, I wondered if the \(10\)-digit in the problem was significant, so I tried some fewer-digit numbers. For \(3\), then \(111\) is a multiple.
For \(7\), then it was not obvious how to find a multiple with all ones. Suppose there is a multiple, say \(y\). But we know that the first digit of \(y\) must be a \(3\). Then, \(3 \times 7 = 21\), and we actually know the next digit of \(y\) must be a \(7\) (so that the second digit of \(yx\) is a \(1\)). Then, \(73 \times 7 = 511\), and the next digit must be an \(8\) (so the \(3\)rd digit of \(yx\) is a \(1\)). Repeating this, we find \(15873 \times 7 = 111111\).
Actually, we are building up each digit of \(y\) step by step. And each digit of \(y\) is forced to be what we say it is (note that it is not unique, as this process can be continued step by step). Thus, we have an algorithm for finding it, if it exists, we just have to characterize if it can ever fail, or ever fail to terminate.
Now, to prove an algorithm terminates, usually we can find some sort of potential function that is bounded, and goes down at some rate. Of course, finding these is not typically quite difficult.
So, what could go wrong with the algorithm? Let’s give some more notation here. Let \(z_k\) be the first \(k\) digits of \(z\) (starting from least significant), which we are building up incrementally. If the first non-one digit of \((xy)\) is strictly less than \(k\), then we’re screwed (since adding more digits can never change a digit before \(k\)). We’re safe in this regard; inductively, we start from \(k=0\), and at each step of adding another digit to \(y\), we create at least one more \(1\) of \((xy)_k\).
Thus, we won’t ever get into a failing state. But it is still hard to argue that this process terminates.
One idea I had is to consider the most significant non-one digits (as they’re the only real signal from our process), and argue that number always decreases in some metric. This number definitely does not always decrease (e.g. for \(x = 7\), then we go from \(2\) to \(5\) to \(6\) to \(4\) to \(1\), after which we terminate). It seems to have the never increase the number of digits, and this is actually easy to show: if \(z\) is this number, then \(cz\) for \(c < 10\) has at most one more digit than \(z\), and since the last digit is trimmed off in the process, we found a non-increasing. We have the first thing we need: something that is bounded.
All that’s left is to argue that we can never visit the same number twice, and we win. Suppose we do visit the same number twice, then let \(y_1\) be when we first visit it, and \(y_2 \circ y_1\) the second time (where \(\circ\) denotes string concat). Writing this equationally, we have \((y_2 \circ y_1) \times x = (y_1 \times x) \circ (1 \circ \ldots \circ 1)\), but this actually means that \(y_2\) is all ones. Moreover, as its a circle, adding another repetition of \(y_2\) would also return back to the same potential. This means that our greedy algorithm will continually pick \(1\), which is absurd.
We are done! We have constructed a greedy algorithm that for any positive odd number \(x\) not divisible by \(5\), will find a multiple that is all ones. To do this, it incrementally builds the factor digit by digit. At each step of the algorithm, the number of non-one digits never increases, and also the number formed by the non-one digits is always distinct, and so this process terminates.