Saturday, November 27, 2021

4 people in a square with hats

I was given this puzzle by Arvind Hariharan and he has a write up with a different solution approach here: https://www.starvind.com/math/hats-to-leave-you-scratching-your-head/.

The puzzle (apparently from Riddler) is as follows:

Four people are trying to escape from a room. Guards have placed a hat on each person’s head, and each hat is one of three colors: red, yellow or blue. The four people are arranged at the vertices of a square, with an obstacle in the middle. Each person can see the hats on the heads of those on adjacent vertices of the square, but they cannot see the hat of the person diagonally across from them. They also do not know the color of the hat on their own head.

Each person must guess the color of the hat on their own head. If at least one person guesses correctly, they can all escape the room together. No communication is allowed once the hats are placed on their heads, but they can coordinate on a strategy beforehand. They also know how they will be arranged in the square.

How can they be guaranteed to escape the room?


Please stop reading if you wish to solve the puzzle by yourself.


The reason for writing this article is to discuss a strange approach to solving this problem: Giving a proof of existence of a strategy using Linear Algebra!


Since there are $3$ colours, we can work mod $3$, with $0, 1, 2$ being the colours and $x + y = x + y \mod 3$ (This is the field $\mathbb{F}_3$). Note that $2x = -x$ etc.

Let us assume the four people are $A,B,C,D$ and they are given the hat colours $a, b, c, d$, with $A,C$ and $B,D$ being diagonally opposite. Thus $A$ and $C$ only have access to $b,d$ and $B, D$ only have access to $a, c$.

Let us further assume that there is strategy where each person computes some linear combination of the colours they can see and uses it as their guess. 

For eg: $A$ guesses $x_a b + y_a d$ for some $x_a, y_b$ specific to $A$.

Now introduce the offset variable $\delta_a$ which is the amount $A$'s guess is off from their actual value. i.e.

$$ \delta_a = x_a b+ y_a d - a = x_a b + y_a d + 2a$$

Writing this equation for each of $A,B,C,D$ we see that the $\delta$'s can be captured as a matrix equation as follows

$$S \begin{bmatrix}a\\ b \\ c \\ d\end{bmatrix} =  \begin{bmatrix}\delta_a \\ \delta_b \\ \delta_c \\ \delta_d \end{bmatrix} $$

where $S$ (short for strategy) is the 4x4 matrix 

$$   \begin{bmatrix} 2 & x_a & 0 & y_a\\ x_b & 2 & y_b & 0\\ 0 & x_c & 2 & y_c\\x_d & 0 & y_d & 2 \end{bmatrix}$$

$S$ is a viable strategy if for every possible $a,b, c, d$, the atleast one of the $\delta$'s is $0$.

Now comes the key observation:

Lemma 1: For any $x, y$ at least one of $x, y, x + y, x+2y$ is $0$ (note $\mathbb{F}_3$ working mod 3). This is easily proved.

This fact can be stated in linear algebra terms

Lemma 2: Each vector in the space spanned by $u = \begin{bmatrix} 1 & 0 & 1 & 1 \end{bmatrix}$ and $v = \begin{bmatrix}0 & 1 & 1 & 2 \end{bmatrix}$ has at least one co-ordinate which is $0$, i.e. for any $x, y$, the vector $xu + yv$ has at least one co-ordinate which is $0$.

Lemma 3: Now notice that if you now have two arbitrary values $p$ and $q$ and you wanted a 1x4 vector with one of the coordinates as $p$ and other as $q$ (in some given positions), you can find (a unique) vector of the form $w = x u + y v$ which has co-ordinates $p$ and $q$ in the given positions (the other two coordinates are not "free"), as you are essentially solving $x + y = p, x + 2y = q$ or some such pair of equations from Lemma 1.

Now look at the columns of $S$

$$   \begin{bmatrix} 2 & x_a & 0 & y_a\\ x_b & 2 & y_b & 0\\ 0 & x_c & 2 & y_c\\x_d & 0 & y_d & 2 \end{bmatrix}$$

Each column has $0$ and $2$ in some positions, thus by Lemma 3, there is an $S$ where each column of $S$ can be written as a vector of the form $x u + y v$.

Thus we see that for such an $S$, the offset vector $\begin{bmatrix}\delta_a \\ \delta_b \\ \delta_c \\ \delta_d \end{bmatrix}$, which is essentially a linear combination of the columns of $S$ is thus also a linear combination of $u$ and $v$ and by Lemma 2, has to have at least one co-ordinate which is $0$. 

Hence such an $S$ is a strategy which solves the puzzle. This $S$ can actually be computed easily, which we will leave to the reader.

Note that this generalizes, for example you could have a strategy for 6 people with 5 colours where each person could see all but one.

Tuesday, September 7, 2021

Sum of reciprocals of smooth numbers

 Let $a_1, a_2, \dots, a_n$ be $n \ge 1$ distinct odd integers with no prime factors $\gt 5$.


Show that


$$ \sum_{i=1}^{n} \dfrac{1}{a_n} \lt \frac{15}{8}$$


[Solution]

Wednesday, August 18, 2021

A point and a parallelogram

 Suppose $ABCD$ is a parallelogram and $P$ is a point on the same plane as $ABCD$.


Show that the locus of points $P$ such that


$$|PA|^2 + |PB|^2 + |PC|^2 + |PD|^2 = \text{constant}$$


is either a circle or nothing, depending on the constant.


What is the radius of the circle, if the parallelogram side lengths are $L$ and $W$ and the constant is $K$?


[Solution]

Monday, July 12, 2021

Lead against a confident slam

This is a hand from the PanIIT inter IIT bridge tournament conducted online in 2020/2021. 


Both vul, IMPS. You hold 8x, A9x, Q7xxxx, K9.

Partner passes, RHO opens 1S, you pass. LHO bids 4NT, RHO shows two keycards without Q and LHO bids 6S.


What would you lead?


Given that you hold HA, DQ and CK and LHO jumped directly to 4NT, it is very likely they have a distributional hand with a long and good club suit. The club finesse declarer needs is working, even if they can only take it once.

At the table I tried the lead of C9 from K9. This turned out to be a lucky lead as you can see from the four hands below.


IMPS 
Both 
 North
♠ AQ7
♥ J
♦ K
♣ AQJ76532
 West
♠ 84
♥ A92
♦ Q76532
♣ K9

      


 East
♠ T62
♥ K87643
♦ T98
♣ 4
 South
♠ KJ953
♥ QT5
♦ AJ4
♣ T8

W N E S
P1S
P4NTP5H
P6SPP
P

Declarer decide to spurn the club finesse and went up with the CA and could no longer make the contract!

Monday, July 5, 2021

Cover the plane with strips

 In the 2D plane, a strip is the space between (and including) two parallel lines (which extend to infinity in both directions). The width of a strip is the distance between the two parallel lines that make up a strip. The width of a strip is non-zero (otherwise we just call it a line).


Can you fully cover the 2D plane with strips the sums of whose widths is finite? (Proof required of course).



Scroll down for a solution.



Consider a circle of radius $R$. A strip of width $w_i$ can cover an area at most $2w_iR$.


So strips of total width $w$ (infinite number of strips or not), can cover at most an area of $2wR$.


For sufficiently large $R$, $\pi R^2 \gt 2wR$. So we cannot cover the plane with strips the sum of widths of which is finite.

Monday, June 7, 2021

IMO 2019 Q1

 This problem from IMO 2019 (international maths olympiad) was surprisingly easier than expected.


Find all functions $f: Z \to Z$ such that


$$ f(2a) + 2f(b) = f(f(a+b)) \quad \quad \forall a,b \in Z$$


$Z$ is the set of integers.

Thursday, June 3, 2021

A British Math Olympiad problem

 Find all non-negative integers $a, b$ such that


$$ \sqrt{a} + \sqrt{b} = \sqrt{2019}$$

Monday, April 5, 2021

Cute INMO problem (2011)

 A cute problem from the Indian national Math Olympiad (of 2011 I believe).


Find all real $(x,y)$ such that


$$16^{x^2 + y} + 16^{y^2 + x} = 1 $$

Tuesday, March 16, 2021

Inequality from the French math olympiad

 I think it is from the French Olympiad, not sure.


$x, y$ are positive reals. Show that


$$ x^y + y^x \ge 1$$