The House Number Problem

Shakti Kumar
6 min readApr 24, 2022

--

Coming 26th April is the death anniversary of Indian mathematician Srinivasa Ramanujan. It was on this exact day that he breathed his last in the year 1920, nearly 100 years back

I thought of writing something that would extol his genius in a way that would be simple and understandable by all. That was when this particular incident mentioned in his biography (The Man Who Knew Infinity by Robert Kanigel) struck me.

This post will be about a problem that was posed to Ramanujan by PC Mahalanobis (the founder of the Indian Statistical Institute) during his stay in London. The solution to this problem is both simple and complicated at the same time. Read on to understand how

The Problem

The popular English magazine Strand carried a page titled “Perplexities”, devoted to intriguing puzzles. In December 1914, a problem titled “Puzzles at a Village Inn” managed to capture the interest of readers. The problem was set in a village called Louvain

One Sunday morning, Mahalanobis was sitting in Ramanujan’s room with a copy of the December issue in his hand. While Ramanujan was cooking, Mahalanobis sat intrigued by the above problem and thought of sharing it with Ramanujan. The problem read thus:

“I was talking the other day”, said William Rogers to the other villagers gathered around the inn fire, “to a gentleman about the place called Louvain. He said he knowed it well — used to visit a Belgian friend there. He said the house of his friend was in a long street, numbered on this side one, two, three and so on and that all the numbers of one side of him added up exactly the same as all the numbers on the other side of him. He said he knew there was more than 50 houses on that side of the street, but not so many as 500. Perhaps the reader may like to discover the number of that house

Solution

Let us picturize the above situation:

Let the total number of houses in the street be n

Let k be the house of the friend

According to the problem, the sum of the house numbers to the left of the friend(1, 2, 3, …, k-1), is the same as the sum of the house numbers to his right (k+1, k+2, k+3, …, n)

To express in terms of mathematics

1 + 2 + 3 … + k-1 = (k+1) + (k+2) + (k+3) … + (n-1) + n — — — — (1)

As most of us know, the sum of the first n natural numbers = n(n-1)/2

Hence, the LHS = k(k-1)/2

With regards to the RHS, it is a little complicated to compute the sum in the present form. Hence, we will do a little modification to bring it to a form that is suitable for us and very easy

We can write the sum of the first n numbers as, the sum of the first k numbers + sum of the remaining numbers (k+1 to n)

i.e: 1+2+3+…..+n = (1+2+3+… (k-1)+ k) + (k+1) + (k+2) + …. + n

Re-arranging, we get:

(k+1) + (k+2) + … (n-1) + n = (1+2+3….n) — (1+2+3…k) — — — — (2)

i.e The RHS is equal to the sum of the first n numbers minus the sum of the first k numbers

1 + 2 + 3 … + n = n(n+1)/2

1 + 2 + 3 … + k = k(k+1)/2.

Substituting the above 2 equations in Eq. (2), we get:

We see that in the above equation, both n & k are variables. We need to know the value of either one to determine the other

One of the most basic values of n, k that satisfy the above equation are: n = 8 & k=6.

i.e: In a street with 8 houses. Consider the 6th house. The sum of all the house numbers to its left (1+2+3+4+5 = 15), is equal to the sum of the house numbers to its right (7+8 = 15)

One of the ways to determine the solution set to the above problem is by brute force — substituting various values for n and finding which values yield a natural number for k.

Back To The Problem

Coming back to the original problem, the problem specifies that the number of houses were between 50 and 500. The only value that satisfies within this limit is 288 houses.

Substituting n=288 in the final equation and solving would get you k=204.

Hence, the answer to the problem is: There were totally 288 houses and the friend’s house number was 204

This is the only solution to the problem (given the constraint of 50 to 500). However, a few other solutions exist outside of the above constraint. Some are given by

Why Ramanujan Is Great

Through a bit of trial and error, Mahalanobis was able to arrive at the solution in a few minutes. Ramanujan too had figured it out. But the difference?

While Mahalanobis had figured out only one solution (288 houses), Ramanujan had figured out an expression that would give all the correct answers.

“Please take down the solution” Ramanujan said and went on to dictate a continued fraction. This was the solution to the whole class of such problems.

(To know about continued fractions, you can refer to one of my old posts: Continued Fractions)

Astonished, Mahalanobis asked Ramanujan how he had arrived at it. To it, the genius replied

“Immediately I heard the problem it was clear that the solution should obviously be a continued fraction. I then thought, which continued fraction? And the answer came to my mind”

The Man Who Knew Infinity, Robert Kanigel (Pg 215)

“The answer came to my mind” — That was one of the most interesting aspects of the mathematical genius. Things which other people break their heads over, he claimed “came to my mind”. How such difficult mathematical equations and proof just came to his mind nobody could fathom. When asked, he claims that his family deity (Goddess Namagiri) used to write the equations on his tongue in his sleep

If you are interested in knowing the actual method of how Ramanujan got the answer, it involves taking the final equation (2k² = n² + n) and converting it into a form know as “Fermat-Pell” equations and then finding the continued fraction for the same, from which we can get the set of solutions for the equation. It is a bit complicated and beyond the scope of this article.

Those interested, can refer to this post written by a retired Professor of the Institute of Mathematical Sciences (IMSc), where the entire solution has been detailed

Ramanujan-Mahal anobis: A Sunday Puzzle

Thanks for reading!!!

Reference

The Man Who Knew Infinity by Robert Kanigel (Pg 214, 215)

Originally published at http://infinitesimallysmallcom.wordpress.com on April 24, 2022.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Shakti Kumar
Shakti Kumar

Written by Shakti Kumar

Someone who strongly believes mathematics is the gym of the human mind

No responses yet

Write a response