Sunday, February 22, 2026

Replicating Amoebas

 This is a puzzle from Peter Winkler who himself got it from some field medalist apparently.


You have an amoeba at $(0,0)$. An amoeba can replicate by splitting itself,  and placing them one to the right and one above.

So if an amoeba is at $(x,y)$ after the replication of that, there will be no amoeba at $(x,y)$, one at $(x+1, y)$ and one at $(x, y+1)$.

This replication can only happen if the two target spots are empty. Otherwise the amoeba will not replicate. 

For eg starting with $(0,0)$ consider the following.

A split, now we have $(1,0)$ and $(0,1)$. 

The $(0,1)$ splits, now we have $(1,0), (1,1), (0,2)$.

Now if the $(1,0)$ wants to split, it cannot, because one of the targets $(1,1)$ is occupied.

Ok now for the puzzle.

You start with one amoeba at $(0,0)$. 

How many replications do we need to clear the square (including the inside of it) $(0,0), (2,0), (2,2), (0,2)$ of amoebas?


Solution.

.

.

.

.

.


The answer is, it is impossible to clear that grid!


We come up with an invariant. Give weight $1$ to the initial amoeba. If an amoeba of weight $w$ splits, give weights $\frac{w}{2}$ to each of its clones. Thus the total weight of amoebas is preserved.

Now the weights are non-positive powers of $2$ and given the location of the amoeba, you can actually determine its weight.

The weights look something like this ($(0,0)$ is bottom left of matrix)

$$\begin{matrix} \vdots & \vdots & \vdots & \vdots \\ \frac{1}{8} & \frac{1}{16} & \frac{1}{32} & \frac{1}{64} &\dots \\ \frac{1}{4} & \frac{1}{8} & \frac{1}{16} & \frac{1}{32}  & \dots \\ \frac{1}{2} & \frac{1}{4} & \frac{1}{8} & \frac{1}{16} & \dots \\ 1 & \frac{1}{2} & \frac{1}{4} & \frac{1}{8} & \dots \end{matrix}$$


Now the sum of all the weights in the grid of our interest  is $$ 1 + 2 \times \frac{1}{2} + 3 \times \frac{1}{4} + 2 \times \frac{1}{8}  + \frac{1}{16} = 3 \frac{1}{16}$$


The sum of weights of all the possible spaces is $S + \frac{S}{2} + \frac{S}{4} + \dots = S^2 $ where $S$ is the sum of the weights of the bottom row. 

It is easily seen that $S=2$, so the whole infinite grid sum is $4$.

Thus the sum of weights outside our grid of interest is no more than $4 - 3\frac{1}{16} < 1$.

Thus it is impossible to clear that grid, starting with a single amoeba at $(0,0)$, of initial weight $1$: there has to be some amoeba inside the grid to preserve the total weight of $1$.

Friday, February 20, 2026

A generalization of sum of squares

 Let $A_1, A_2 \dots A_n$ be $n$ points in the 2D plane, with centroid $M$.


Show that for any point $P$ in the plane


$$ \sum_{i = 1}^{n} PA_{i}^2 = n PM^2  + \sum_{i=1}^{n} MA_{i}^2$$


Bonus: Given a magic fairy that tells you the sum of squares of distances of any point $P$ to $A_1, A_2, \dots, A_m$ where you don't know $m$ or the $A_i$, show that you can find $m$ in a finite number of queries to the magic fairy.


Solution

.

.

.

.

.


Surprisingly this has an easy proof using complex numbers!


Let $a_1, a_2, \dots, a_n$ be complex numbers that sum to $0$,


Then we have that for any complex number $z$,


$$\sum_{i=1}^{n} |z-a_i|^2 = \sum_{i=1}^{n} (z-a)\overline{(z-a)} = $$

$$ \sum_{i=1}^{n} (z\overline{z} - z\overline{a_i} -\overline{z}a_i + a_i\overline{a_i}) = $$

$$ n z \overline{z} + \sum_{i=1}^{n} a_i\overline{a_i}  = n |z|^2 + \sum_{i=1}^{n} |a_i|^2$$


This gives us the identity we seek. The centroid $M$ corresponds to $0$, the sum of $a_i$.

The bonus puzzle solution follows along the lines of the previous guessing puzzle, and I will leave it to you.


Thursday, February 19, 2026

Guessing the area from sum of squares of distances

 There is an equilateral triangle $ABC$ in the 2D plane. You don't know where it is, but have access to a magical fairy that, given a point $P$ in the same plane, will give you the value of $$f(P) = |PA|^2 + |PB|^2 + |PC|^2$$ i.e. the sum of squares of distances from $P$ to $A,B,C$ (henceforth we will drop the absolute sign)


i) Can you find out the area of triangle $ABC$ using only a finite number of queries to the fairy?

ii) Can you find the minimum number of queries you need to (and are sufficient) to guess the area?

iii) Can you find the locations of the three vertices?


Solution

.

.

.

.

.

Part i)

In a previous post we showed the following:

For any triangle $ABC$ with centroid $M$ and any point $P$ in the same plane


$$ PA^2 + PB^2 + PC^2 = 3 PM^2 + AM^2 + BM^2 + CM^2$$

(Can easily be proven using complex numbers too, if required).

i.e we have $$f(P) = 3 PM^2 + S$$

where $S$ is a constant, independent of $P$ (and is actually a constant times the area of $ABC$, for equilateral $ABC$).

Now pick points $X, Y$ (say $(0,0), (1,0)$) and query the fairy for $X$ and $Y$.

We have that $$f(X) - f(Y) = 3(XM^2 - YM^2)$$

i.e $M$ lies on the locus of points $Q$ such that $$QX^2 - QY^2 = k$$

$k$ is a constant.

By simple co-ordinate geometry, this actually can easily be seen to be a line perpendicular to $XY$ (extended, if needed).

Thus using two points, we narrow down $M$, the centroid of $ABC$ to a straight line. With another point $Z$ (say $(0, 1)$), we get another line, and take the intersection of the two lines.

Once we have the location of $M$, we can compute $XM^2$ directly, and then use the already obtained $f(X)$ to compute the area of the equilateral triangle $ABC$, using

$$ AM^2 + BM^2 + CM^2 = f(X) - 3 XM^2$$


Thus three queries are sufficient. 

Part ii)

Three queries are also necessary.

Suppose two were enough, (say X and Y), then as before $M$ lies on a line perpendicular to $XY$. Now if $M$ were the actual point, then the reflection $M'$ of $M$ on $XY$ gives the same $f(X)$ and $f(Y)$. Thus two queries are not enough.


Part iii)

Pinpointing the vertices is impossible! Any rotation of the $ABC$ around the centroid gives the same $f(P)$ values.


 

Tuesday, January 20, 2026

An unexpected approach to a quadratic system of equations

Positive reals $a,b,c$ satisfy

$$ a^2 + b^2  + ab = 121$$

$$b^2 + c^2 + bc = 169$$

$$ c^2 + a^2 + ca = 400$$


What is the value of $ab + bc + ca$?

.

.

.

.

.

.

This can be solved using geometry!


Consider triangle $OAB$ with $OA = a$ and $OB = b$ and $\angle{AOB} = 120^{\circ}$.

Using cosine rule, $AB^2 = a^2 + b^2 - 2ab \cos(120^{\circ}) = a^2 + b^2 + ab$. Thus $AB = 11$.

Area of triangle $AOB$ = $\frac{1}{2} ab \sin(120^{\circ}) = \frac{\sqrt{3}}{4} ab$

Now add point $C$ such that $OC = c$ and $\angle{AOC} = \angle{COB} = 120^{\circ}$.

We thus have a triangle $ABC$ with sides $AB = 11, BC = 13, AC = 20$ and area  (by adding up areas of $AOB, AOC, BOC$


 $$\frac{\sqrt{3}}{4} (ab + bc + ca)$$


By Heron's formula, since the sides are known, we get area $=66$.

This gives $$ab + bc + ca = 88 \sqrt{3}$$