You are currently browsing the category archive for the ‘graphing’ category.

Ramanujan’s Taxi Cabs and the Sum of 2 Cubes

The Indian mathematician Ramanujan (picture cite: Wikipedia) is renowned as one of great self-taught mathematical prodigies.  His correspondence with the renowned mathematician G. H Hardy led him to being invited to study in England, though whilst there he fell sick.  Visiting him in hospital, Hardy remarked that the taxi that had brought him to the hospital had a very “rather dull number” – number 1729.  Ramanujan remarked in reply, ” No Hardy, it’s a very interesting number!  It’s the smallest number expressible as the sum of 2 cubes in 2 different ways!”

Ramanujan was profoundly interested in number theory – the study of integers and patterns inherent within them.  The general problem referenced above is finding integer solutions to the below equation for given values of A:

In the case that A = 1729, we have 2 possible ways of finding distinct integer solutions:

The smallest number which can be formed through 3 distinct (positive) integer solutions to the equation is A = 87, 539, 319.

Although this began as a number theory problem it has close links with both graphs and group theory – and it is from these fields that mathematicians have gained a deeper understanding as to the nature of its solutions.  The modern field of elliptical curve cryptography is closely related to the ideas below and provides a very secure method of encrypting data.

We start by sketching the graph of:

For some given integer value of A. We will notice that the graph has a line of symmetry around y = x and also an asymptote at y = -x.  If we plot:

We can see that both our integer solutions to this problem (1,12) and (9,10) lie on the curve:

Group theory

Groups can be considered as sets which follow a set number of rules with regards to operations like multiplication, addition etc.  Establishing that a set is a group then allows certain properties to be inferred.  If we can establish the following rules hold then we can create an Abelian group.  If we start with a set A and and operation Θ.

1) Identity. For an element e in A, we have a Θ e = a for all a in A.

(for example 0 is the identity element for the addition operation for the set of integers numbers. a+0 = a for all a in the real numbers).

2) Closure.  For all elements a,b in A, a Θ b = c, where c is also in A.

(For example with the addition operation, the addition of 2 integers numbers is still an integer)

3) Associativity. For all elements a,b,c in A, (a Θ b) Θ c = a Θ (b Θ c)

(For example with the addition operation, (1+2) + 3 = 1 + (2+3) )

4) Inverse.  For each a in A there exists a b in A such that a Θ b = b Θ a = e.  Where e is the identity.

(For example with the addition operation, 4+-4 = -4+4 = 0.  0 is the identity element for addition)

5) Commutativity. For all elements a,b in A, a Θ b = b Θ a

(For example with the addition operation 1+2 = 2+1).

As we have seen, the set of integers under the operation addition forms an abelian group.

Establishing a group

So, let’s see if we can establish a Abelian group based around the rational coordinates on our graph.  We can demonstrate with the graph:

We then take 2 coordinate points with rational coordinates (i.e coordinates that can be written as a fraction of integers).  In this case A (1,12) and B (9,10).

We then draw the line through A and B.  This will intersect the graph in a 3rd point, C (except in a special case to be looked at in a minute).

We then reflect this new point C in the line y = x, giving us C’.

In this case C’ is the point  (46/3, -37/3)

We therefore define addition (our operation Θ) in this group as:

A + B = C’.

(1,12) + (9,10) = (46/3, -37/3).

We now need to deal with the special case when a line joining 2 points on the curve does not intersect the curve again.  This will happen whenever the gradient of this line is -1, which will make it parallel to the graph’s asymptote y = -x.

In this case we affix a special point at infinity to the Cartesian (x,y) plane.  We define this point as the point through which all lines with gradient -1 intersect.  Therefore in our expanded geometry, the line through AB will intersect the curve at this point at infinity. Let’s call our special point  Φ.  Now we have a new geometry,  the (x,y) plane affixed with Φ.

We can now create an Abelian group.  For any 2 rational points P(x,y), Q(x,y) we will have:

1) Identity.  P + Φ = Φ + P = P

2) Closure.  P + Q = R. (Where R(x,y) is also a rational point on the curve)

3) Associativity. (P+Q) + R = P+(Q+R)

4) Inverse.  P + (-P) = Φ

5) Commutativity.  P+Q = Q+P

Understanding the identity

Let’s see if we can understand some of these.  For the identity, if we have a point A on the line and the point at infinity then this will contain the line with gradient -1.  Therefore the line between the point at infinity and A will intersect the curve again at B.  Our new point, B’ will be created by reflecting this point in the line y = x.  This gets us back to point A.  Therefore P + Φ = P as required.

Understanding the inverse

With the inverse of our point P(x,y) given as -P = (-x,-y) we can see that this is the reflection in the line y = x.  We can see that we we join up the 2 points reflected in the line y = x we will have a line with slope -1, which will intersect with the curve at our point at infinity.  Therefore P + (-P) = Φ.

Through our graphical understanding the commutativity rule also follows immediately, It doesn’t matter which of the 2 points come first when we draw a line that connects them, therefore P+Q = Q+P.

Understanding associativity and closure

Neither associativity nor closure are obvious from our graph.  We could check individual points to show that (P+Q) + R = P+(Q+R), but it would be harder to explain why this always held.  Equally whilst it’s clear that P+Q will always create a point on the curve it’s not obvious that this will be a rational point.

In fact we do have both associativity and closure for our group as we have the following algebraic definition for our addition operation:

For a given point:

On a given curve of the form:

The addition of 2 points is given by:

In the case of our curve:

If we take P = (1,12).  P + P will be given by:

We can check this result graphically.  If P and Q are the same point, then the line that passes through both P and Q has to be the tangent to the curve at that point.  Therefore we would have:

Here the tangent at A does indeed meet the curve again – at point C, which does reflect in y = x to give us the coordinates above.

We could also find this intersection point algebraically.  If we differentiate the original curve to find the gradient when x = 1 we can find the equation of the tangent when x=1 and then substitute this back into the equation of the curve to find the intersection point.  This would give us:

We would then reverse the x and y coordinates to reflect in the line y = x.  This also gives us the same coordinates.

More generally if we have the 2 rational coordinates on the curve:

We have the algebraic formula for addition as:


If P = (1,12) and Q = (9,10), P + Q would give (after much tedious substitution!):

This agrees with the coordinates we found earlier using the much easier geometrical approach. As we can see from this formula, both coordinate points will always be rational – as they will be composed of combinations of our original rational coordinates.  For any given curve there will be a generator set of coordinates through which we can generate all other rational coordinates on the curve through our addition operation.

So, we seem to have come a long way from our original goal – finding integer solutions to an algebraic equation. Instead  we seem to have got sidetracked into studying graphs and establishing groups.  However by reinterpreting this problem as one in group theory then this then opens up many new mathematical techniques to help us understand the solutions to this problem.

A fuller introduction to this topic is the very readable, “Taxicabs and the Sum of Two Cubes” by Joseph Silverman (from which the 2 general equations were taken) .

Finding the volume of a rugby ball (prolate spheroid)

With the rugby union World Cup currently underway I thought I’d try and work out the volume of a rugby ball using some calculus.  This method works similarly for American football and Australian rules football.   The approach is to consider the rugby ball as an ellipse rotated 360 degrees around the x axis to create a volume of revolution.  We can find the equation of an ellipse centered at (0,0) by simply looking at the x and y intercepts.  An ellipse with y-intercept (0,b) and x intercept (a,0) will have equation:

Therefore for our rugby ball with a horizontal “radius” (vertex) of 14.2cm and a vertical “radius” (co-vertex) of 8.67cm will have equation:

We can see that when we plot this ellipse we get an equation which very closely resembles our rugby ball shape:

Therefore we can now find the volume of revolution by using the following formula:

But we can simplify matters by starting the rotation at x = 0 to find half the volume, before doubling our answer.  Therefore:

Rearranging our equation of the ellipse formula we get:

Therefore we have the following integration:

Therefore our rugby ball has a volume of around 4.5 litres.  We can compare this with the volume of a football (soccer ball) – which has a radius of around 10.5cm, therefore a volume of around 4800 cubic centimeters.

We can find the general volume of any rugby ball (mathematically defined as a prolate spheroid) by the following generalization:

We can see that this is very closely related to the formula for the volume of a sphere, which makes sense as the prolate spheroid behaves like a sphere deformed across its axes. Our prolate spheroid has “radii” b, b and a – therefore r cubed in the sphere formula becomes b squared a.

Prolate spheroids in nature

The image above [wiki image NASA] is of the Crab Nebula – a distant Supernova remnant around 6500 light years away.  The shape of Crab Nebula is described as a prolate spheroid.

The Shoelace Algorithm to find areas of polygons

This is a nice algorithm, formally known as Gauss’s Area formula, which allows you to work out the area of any polygon as long as you know the Cartesian coordinates of the vertices.  The case can be shown to work for all triangles, and then can be extended to all polygons by first splitting them into triangles and following the same approach.

Let’s see if we can work out the algorithm ourselves using the construction at the top of the page.  We want the area of the triangle (4), and we can see that this will be equivalent to the area of the rectangle minus the area of the 3 triangles (1) (2) (3).

Let’s start by adding some other coordinate points for the rectangle:

Therefore the area of the rectangle will be:

(1) + (2) +(3) +(4): (x3-x2)(y1-y3)

And the area of triangles will be:

(1): 0.5(x3-x2)(y2-y3)

(2): 0.5(x1-x2)(y1-y2)

(3): 0.5(x3-x1)(y1-y3)

Therefore the area of triangle (4) will be:

Area = (x3-x2)(y1-y3) – 0.5(x3-x2)(y2-y3) – 0.5(x1-x2)(y1-y2) – 0.5(x3-x1)(y1-y3)

Therefore we have our algorithm!  Let’s see if it works with the following coordinates added:

x1 = 2  x = 1  x = 3
y1 = 3 y = 2  y = 1

Area = (x3-x2)(y1-y3) – 0.5(x3-x2)(y2-y3) – 0.5(x1-x2)(y1-y2) – 0.5(x3-x1)(y1-y3)

Area = (3-1)(3-1) – 0.5(3-1)(2-1) – 0.5(2-1)(3-2) – 0.5(3-2)(3-1)

Area = 4 – 1 – 0.5 – 1 = 1.5 units squared

We could check this using Pythagoras to find all 3 sides of the triangle, followed by the Cosine rule to find an angle, followed by the Sine area of triangle formula, but let’s take an easier route and ask Wolfram Alpha (simply type “area of a triangle with coordinates (1,2) (2,3) (3,1)).  This does indeed confirm an area of 1.5 units squared.  Our algorithm works.  We can of course simplify the area formula by expanding brackets and simplifying.  If we were to do this we would get the commonly used version of the area formula for triangles.

The general case for finding areas of polygons

The general formula for the area of an n-sided polygon is given above.

For a triangle this gives:

For a quadrilateral this gives:

For a pentagon this gives:

You might notice a nice shoelace like pattern (hence the name) where x coordinates criss cross with the next y coordinate along.  To finish off let’s see if it works for an irregular pentagon.

If we arbitrarily assign our (x1, y1) as (1,1) and then (x2, y2) as (3,2), and continue in a clockwise direction we will get the following:

area = absolute of 0.5( 1×2 + 3×4 + 3×1 + 4×0 + 2×1 – 3×1 – 3×2 – 4×4 – 2×1 – 1×0)

area = 4.

Let’s check again with Wolfram Alpha – and yes it does indeed have an area of 4.

It could be a nice exploration task to take this further and to explore how many different methods there are to find the area of polygons – and compare their ease of use, level of mathematics required and aesthetic appeal.


The Van Eck Sequence

This is a nice sequence as discussed in the Numberphile video above.  There are only 2 rules:

  1. If you have not seen the number in the sequence before, add a 0 to the sequence.
  2. If you have seen the number in the sequence before, count how long since you last saw it.

You start with a 0.


You have never seen a 0 before, so the next number is 0.


You have seen a 0 before, and it was 1 step ago, so the next number is 1.


You have never seen a 1 before, so the next number is 0.


You have seen a 0 before, it was 2 steps ago, so the next number is 2.



I can run a quick Python program (adapted from the entry in the Online Encyclopedia of Integer Sequences here) to find the first 100 terms.

A181391 = [0, 0]
for n in range(1, 10**2):
 for m in range(n-1, -1, -1):
  if A181391[m] == A181391[n]:

This returns:

[0, 0, 1, 0, 2, 0, 2, 2, 1, 6, 0, 5, 0, 2, 6, 5, 4, 0, 5, 3, 0, 3, 2, 9, 0, 4, 9, 3, 6, 14, 0, 6, 3, 5, 15, 0, 5, 3, 5, 2, 17, 0, 6, 11, 0, 3, 8, 0, 3, 3, 1, 42, 0, 5, 15, 20, 0, 4, 32, 0, 3, 11, 18, 0, 4, 7, 0, 3, 7, 3, 2, 31, 0, 6, 31, 3, 6, 3, 2, 8, 33, 0, 9, 56, 0, 3, 8, 7, 19, 0, 5, 37, 0, 3, 8, 8, 1, 46, 0, 6, 23]

I then assigned each term an x coordinate value, i.e.:

0 , 0
1 , 0
2 , 1
3 , 0
4 , 2
5 , 0
6 , 2
7 , 2
8 , 1
9 , 6
10 , 0
11 , 5
12 , 0
13 , 2
14 , 6
15 , 5
16 , 4
17 , 0
18 , 5
19 , 3
20 , 0


This means that you can then plot the sequence as a line graph, with the y values corresponding to the sequence terms.  As you can see, every time we hit a new peak the following value is 0, leading to the peaks and troughs seen below:

Let’s extend the sequence to the first 1000 terms:


We can see that the line y = x provides a reasonably good upper bound for this data:



But it is not known if every number would actually appear in the sequence somewhere – so this bound may not hold for larger values.

Length of steps before new numbers appear.

We can also investigate how long we have to wait to see each number for the first time by running the following Python code:

A181391 = [0, 0]
for n in range(1, 10**3):
 for m in range(n-1, -1, -1):
  if A181391[m] == A181391[n]:

  for m in range(1,50):
   if A181391[n]==m:
    print(m, ",", n+1)

This returns the following data:

1 , 3
2 , 5
6 , 10
5 , 12
4 , 17
3 , 20
9 , 24
14 , 30
15 , 35
17 , 41
11 , 44
8 , 47
42 , 52
20 , 56
32 , 59
18 , 63
7 , 66
31 , 72
33 , 81
19 , 89


The first coordinate tells us the number we are interested in, and the second number tells us how long we have to wait in the sequence until it appears.  So (1 , 3) means that we have to wait until 3 terms in the sequence to see the number 1 for the first time.

Plotting this for numbers 1-50 on a graph returns the following:

So, we can see (for example that we wait 66 terms to first see a 7, and 173 terms to first see a 12.  There seems to be a general trend that as the numbers get larger we have to wait longer to see them.  Testing this with a linear regression we can see a weak to moderate correlation:


Checking for the numbers up to 300 we get the following:

For example this shows that we have to wait 9700 terms until we see the number 254 for the first time.  Testing this with a linear correlation we have a weaker positive correlation than previously.

So, a nice and quick investigation using a combination of sequences, coding, graphing and regression, with lots of areas this could be developed further.


Website Stats


Recent Posts

Follow IB Maths Resources from British International School Phuket on