Clocks are amazing. They tell us time. In this post I want to talk about working of analog clocks. In case you haven’t seen an analog clock, this is how it looks like:




A wall clock, it’s working part in the back and inside of the working part.

But, what clocks have to do with mathematics? As I have mentioned several times, one major part of mathematics is about counting and clocks “count”! Clocks are amazing counting device, they perform mod 12 and mod 60 calculations (that’s why modular arithmetic is also called clock arithmetic).

Unfortunately, the ideal cases exist only in our abstract world of mathematics. In real world, whatever we build has some error percentage and our motive to minimize this error. A mathematical construction, called Stern-Brocot tree, was created to help build timepieces and understand number theory.


By Aaron Rotenberg (Own work) [GFDL or CC-BY-SA-3.0], via Wikimedia Commons

This “tree” gives an exceptionally elegant way to enumerate the positive rational numbers and is a surprisingly useful tool for constructing clocks.  For more information about this construction read this feature column article by David Austin.


Just like continued fractions, this tree gives us good rational approximations of a given real number. Clocks typically have a source of energy–such as a spring, a suspended weight, or a battery–that using gears turns a shaft at a fixed rate. We can increase the precision by using more number of gears of different teeth count in appropriate combination.

I will end this post with an example from Austin’s article:

Suppose we place a pinion on a shaft that rotates once every hour and ask to drive a wheel that rotates once in a mean tropical year, which is 365 days, 5 hours, 49 minutes. Converting both periods to minutes, we see that we need the ratio 720 / 525,949. The problem here is that the denominator 525,949 is prime so we cannot factor it. To obtain this ratio exactly, we cannot use gears with a smaller number of teeth. It is likewise impossible to find a multi-stage gear train to obtain this ratio. But, as we slide down the “tree” toward 720 / 525,949, the rationals we meet along the way will give good approximations with relatively small numerators and denominators. As we descend the Stern-Brocot tree towards 720 / 525,949, we find the fraction 196 / 143,175, which may be factored into four rational factors, 2/3, 2/25, 7/23 and 7/83. We can therefore construct a four-stage gear train and can get a pretty accurate clock.

I hope I have been able to convince you that clocks are much more interesting than they would appear and you should read the article by David Austin for further references.

Arithmetic Operations


There are only 4 binary operations which we call “arithmetic operations”. These are:

  • Addition (+)
  • Subtractions (-)
  • Multiplication (×)
  • Division (÷)

Reading this fact, an obvious question is:

Why only four out of the infinitely many possible binary operations are said to be arithmetical?

Before presenting my attempt to answer this question, I would like to remind you that these are the operations you were taught when you learnt about numbers i.e. arithmetic.

In high school when \sqrt{2} is introduced, we are told that real numbers are of two types: “rational” and “irrational”. Then in college when \sqrt{-1} is introduced, we should be told that complex numbers are of two types: “algebraic” and “transcendental“.

As I have commented before, there are various number systems. And for each number system we have some valid arithmetical operations leading to a valid algebraic structure. So, only these 4 operations are entitled to be arithmetic operations because only these operations lead to valid algebraic numbers when operated on algebraic numbers.

Now this leads to another obvious question:

Why so much concerned about algebraic numbers?

To answer this question, we will have to look into the motivation for construction of various number systems like integers, rational, irrationals, complex numbers… The construction of these number systems has been motivated by our need to be able to solve polynomials of various degree (linear, quadratic, cubic…). And the Fundamental Theorem of Algebra says:

Every polynomial with rational coefficients and of degree n in variable x has n solutions in  complex number system.

But, here is a catch. The number of complex numbers which can’t satisfy any polynomial (called transcendental numbers) is much more than the number of complex numbers which can satisfy a polynomial equation (called algebraic numbers). And we wish to find solutions of a polynomial equation (ie.e algebraic numbers) in terms of sum, difference, product, division or m^{th} root of rational numbers (since coefficients were rational numbers). Therefore, sum, difference, product and division are only 4 possible arithmetic operations.

My previous statement may lead to a doubt that:

Why taking m^{th} root isn’t an arithmetic operation?

This is because it isn’t a binary operation to start with, since we have fixed m. Also, taking m^{th} root is allowed because of the multiplication property.

CAUTION: The reverse of m^{th} root is multiplying a number with itself m times and it is obviously allowed. But, this doesn’t make the binary operation of taking exponents, \alpha^{\beta} where \alpha and \beta are algebraic numbers, an arithmetic operation. For example, 2^{\sqrt{2}} is transcendental (called Gelfond–Schneider constant or Hilbert number) even though 2 and \sqrt{2} are algebraic.

Making Math GIFs


Few months ago I wrote about the technologies we use today to share joy of mathematics. But, I overlooked one very important tool which we can use today: Graphics Interchange Format (GIF). For example, see this Tumblr blog: matan-matika.

Though I used this “technology” in one of my posts earlier this year, I didn’t know how to create my own animated GIF images.  So I started searching and stumbled on an HTML5 application by Pascal Bauermeister called MathVision . It is capable of generating mathematical art pictures using the contour plot technique. It uses simplified Java syntax and can be easily learnt by following this Instructable.

As an exercise in this Instructable, we are asked to make diagonal stripes, here is my attempt:

WIDTH = 350;
RATIO = 1;
X_MIN = 0; X_MAX = 10;
Y_MIN = 0; Y_MAX = 10;

color rgb(x, y) {
  int bu = y+x;
  int value = (int)bu % 2;
  int luma = value * 255;
  return color(luma);


Here is a “disturbing” animated spiral (note that it’s spinning in the direction opposite to the one given in instructable; just need to decrement time):

FRAMES = 10;
OUT_PAUSE = false;
WIDTH = 250;
RATIO = 1;
X_MIN = -1; X_MAX = 1;
Y_MIN = -1; Y_MAX = 1;

color rgb(x, y, t) {
float radius = dist(x, y, 0, 0);
float angle = -atan2(x, y);
angle = angle - t;

float value = angle*3 - (radius)*12;
float stripe = cos(value);

float luma = (stripe - 5) * 127;
return color(luma);


Today, 6-10-2016, is a Palindrome Day (if written in dd-mm-yyyy format)! So I end my post with this GIF I recorded using byzanz (on Ubuntu) and edited using




In 1930, David Hilbert gave radio address lecture. I want to discuss following paragraph from that lecture (when translated to English):

With astonishing sharpness, the great mathematician POINCARÉ once attacked TOLSTOY, who had suggested that pursuing “science for science’s sake” is foolish. The achievements of industry, for example, would never have seen the light of day had the practical-minded existed alone and had not these advances been pursued by disinterested fools.

Science exists because we (human beings) want to find reason for everything happening around us (like how air molecules interact, which bacteria is harmful…) . We claim that this will enrich our understanding of the nature thus enabling us to make rational decisions (like when should I invest my money in stock market, from how much hight I can jump without hurting myself…).

Let me illustrate the point I want to make: Mathematicians make observations about real/abstract objects (shape of universe/klein bottle) and try to explain them using logical arguments based on some accepted truths (axioms/postulates). But today we have “science” for almost every academic discipline possible. Therefore, we (human beings) have become so much obsessed with finding reasons for everything that we even want to know why the things happened a moment ago so that we are able to predict what will happen in a moment from now. So the question is:

Should there be a reason for everything?

Can’t some thing just be happening around us for no reason. Why we try to model everything using psedo-randomness and try to extract a meaning from it? In case you are thinking that probability helps us understanding purely random events, you are wrong. We assume events to be purely random, we are never sure of their randomness and based on this assumption we determine chances of that event to happen which infact tells nothing about future (like an event with 85% chances of happening may not happen in next trial).

In same spirit, I can ask: “Should there be reason for you being victim of a terrorist attack?” We can surely track down a chain of past events (and even the bio-chemical pathways) leading to the attack and you being a victim of it.

Why we try to give “luck” as reason for some events? Is this our way of acknowledging randomness or our inability to find reason?

Moreover, David Hilbert ends his lecture with following slogan (in German):

Wir müssen wissen, Wir werden wissen.

which  when translated to English means: “We must know, we will know.”.

Popular-Lonely primes understood


While reading standup mathematician Matt Parker‘s book Things to Make and do in Fourth Dimension, I found answer (on pp. 146) to the question I raised 7 months ago.


When the grid happens to be a multiple of 6 wide, suddenly all primes snap into dead-straight lines. All primes (except 2 and 3) are one more or less than a multiple of 6. (© Matt Parker, 2014)

He also proves the following surprising theorem:

The square of every prime number greater than 3 is one more than a multiple of 24.

Let p be an odd prime not equal to 3. Now we subtract one from the square of this prime number. Therefore, we wish to prove that p^2-1=(p-1)(p+1) is a multiple of 24.

Note that, p^2-1 is a product of two even numbers. In particular, one of these two even numbers must be a multiple of 4, as they are consecutive even numbers and every other even number is divisible by 4. Hence we conclude that p^2-1 is divisible by 8. 

Observe that exactly one of three consecutive numbers, p-1,p,p+1 must be divisible by 3. Since p is an odd prime different from 3, one of p-1 or p+1 must be divisible by 3. Hence we conclude that p^2-1 is divisible by 3.

Combining both the conclusions made above, we complete proof of our statement (since 2 and 3 are coprime).

Special Numbers: update


This post is a continuation of my earlier post: Special Numbers

Four (4)

This is the only euclidean space with properties different from other n-dimensional euclidean spaces. For example, there are smooth 4-manifolds which are homeomorphic but not diffeomorphic.  Put differently, for any dimension except four there is only one differentiable structure on the space underlying the Euclidean space of that dimension. For a discussion in this direction see this article by Liviu Nicolaescu. For other special properties of 4-dimesnions read Wikipedia article on 4-manifold.
Thanks to Dr. Ritwik Mukherjee for explaining this fact about four-space.

Hyperbolic Plane Example


Few months ago I gave a lecture on Non-euclidean geometry and it was a bit difficult for me to give audience an example of hyperbolic surface from their day-to-day life. While reading Donal O’ Shea’s book on Poincaré Conjecture I came across following interesting example on pp. 97 :


Negatively curved cloth will drape a woman’s side (© Donal O’ Shea, 2007)

Estrogen causes fat to be stored in the buttocks, thighs, and hips in women. Thus females generally have relatively narrow waists and large buttocks, and this along with wide hips make for a wider hip section and a lower waist-hip ratio compared to men. The saddle-shaped area on a woman’s side above her hip has negative curvature.

One can imagine cloth (it is flexible but does not stretch, hence an isometry) that would drape it perfectly. Here the region inside a circle of given radius contains more material than the same circle on the plane, and to make the cloth the tailor might start with a flat piece of fabric, make a cut as if he/she were going to make a dart, but instead of stitching the cut edges together, insert an extra piece of fabric or a gusset. Negatively curved cloth would have lots of folds if one tried to lay it flat in  dresser.

If one tries to extend a cloth with constant positive curvature (like a cap), in all directions, it would close up, making a sphere. On the other hand, if one imagines extending a cloth with constant negative curvature in all directions, one gets a surface called hyperbolic plane.