Chaitanya's Random Pages

September 30, 2011

2011 summer heat in southern USA

Filed under: climate and weather — ckrao @ 1:04 pm

Much of the southern part of the USA experienced its warmest summer on record this year. Below are temperature graphs (max, min, averages) for two of the places that smashed records by a wide margin: Wichita Falls (Texas) and Shreveport (Louisiana). For the summer (June-August) Wichita Falls averaged 3.4F more than average! Its previous record for 100F days was 79 while this year it recorded 98.

For August Shreveport broke its previous record warmest month by 3 degrees F!

Finally, I include below the temperature graph for Phoenix, Arizona which had a record number of 110F days (43.3C) for a summer – 33. Its August was its equal hottest month on record (with July 2009). It is most likely the hottest big city in the western world in terms of summer temperatures.

The data for the above graphs is taken from

Further reading:

[1] Weather Extremes : Re-Cap of Summer of 2011 Heat Records in the U.S.A. : Weather Underground

[2] Dr. Jeff Masters’ WunderBlog : Texas fires will diminish today; Lee’s rains set all-time records : Weather Underground

[3] Dr. Jeff Masters’ WunderBlog : A heat wave recap; generally quiet tropics : Weather Underground

[4] Texas Heat and Drought [SEC=UNCLASSIFIED] – austpacwx | Google Groups

September 17, 2011

The shortest broken line of fixed angle joining three parallel lines

Filed under: mathematics — ckrao @ 8:10 am

My previous post was inspired by the following problem I found at the geometry problems website.

Given three parallel lines separated by distances a, b as shown, what is the minimum length of x+y as a function of \theta?

The quantity to minimise is \displaystyle x+y = \frac{a}{\sin \alpha} + \frac{b}{\sin \beta}, which is the same expression we needed to minimise in the previous post, except that this time we have \alpha + \beta = \theta instead of \alpha + \beta + \theta = \pi. We simply replace \theta with \pi -\theta in the answer given there, and find that the minimum length is

\displaystyle d = \frac{1}{\sin \theta}\left[3x^2 - \frac{a^2b^2}{x^2} + 4(a + b \cos \theta )x + a^2 + b^2 + 4ab \cos \theta\right]^{1/2},

where x is the positive root satisfying the cubic equation

\displaystyle x^3 + (b \cos \theta)x^2 - (ab \cos \theta)x - ab^2 = 0.

Indeed, if we rotate the top line by \pi - \theta about the “hinge” we obtain the same picture as last time and see that a and b represent the same quantity in both cases:

The only difference is that the first problem allows for the case of \theta = \pi, in which case the minimum distance is clearly a+b.

It is interesting how these seemingly different problems are identical, with a simple rotation connecting them.

September 13, 2011

Philo’s line: the shortest line segment through a given point in a given angle

Filed under: mathematics — ckrao @ 10:02 pm

In this post we look at the following problem:

Given a point P in a given angle of size {\theta} formed by two lines, what is the shortest length d of a segment MN passing through P with M and N on each line?

I found out recently that such a line is called Philo’s line and the problem of finding the shortest segment is more tricky than one first suspects. It is named after Philo of Byzantium who lived in the 3rd century BC. Had I known it was as tricky to begin with I may not have spent as long investigating it! It was certainly worthwhile though and I encountered a fun mix of calculus, geometry and algebra (polynomials) on the way which I show here.

We can specify the point P in more that one way – for example by its distances to the two sides (a,b), or by the lengths OE, OF (e,f) as shown in the following figure.

The two pairs are related by the equations

\displaystyle e = \frac{a + b \cos \theta}{\sin \theta}, f = \frac{b + a \cos \theta}{\sin \theta}

\displaystyle a = \frac{e - f \cos \theta}{\sin \theta}, b = \frac{f - e \cos \theta}{\sin \theta}

We shall work with a and b with the knowledge that if we need to use e and f, they are simply related to a and b by linear transformations. Note that it is possible for e or f to be negative if \theta > 90^{\circ}.

In the symmetric case of a=b, we can say that for any angle \theta, P will be on the angle bisector of the angle and Philo’s line will be perpendicular to OP by symmetry. In this case, we find by simple trigonometry m = 2a/\sin \theta and so by the cosine rule,

\displaystyle d^2 = m^2 + m^2 - 2m^2\cos \theta = \frac{8a^2(1 - \cos \theta )}{\sin^2 \theta}.\quad \quad (1)

(We can also write the simpler expression d = 2a/\cos (\theta/2) but above form is handier for future reference!)

In the case when a\neq b and \theta = 90^{\circ}, one may think that Philo’s line is that which makes MO = ON, but this is not the case. Take the example of a = 8, b = 1:

The equivalent formulation is this: what is the shortest line segment through the point (8,1) lying in the first quadrant? This is equivalent to the “ladder around a corner” problem that I discussed in an earlier post. The shortest line segment through (8,1) is also the longest ladder that can fit in a corridor with perpendicular corner  bound by the axes and with inside corner at (8,1).

As found in that post, the optimal line has intercepts (a + a^{1/3}b^{2/3}, 0) and (0, b + a^{2/3}b^{1/3}). The resulting squared distance is

\displaystyle d^2 = (a^{2/3} + b^{2/3})^3. \quad \quad (2)

Shown here is this line in the case (a,b) = (8,1) and how it differs from the symmetric line keeping OM = MN. We see that Philo’s line (in red) has length 5\sqrt{5} = \sqrt{125} while the symmetric line has the much greater length 9\sqrt{2} = \sqrt{162}.

This is an instance where our intuition may defy us. In general it is very difficult to identify Philo’s line unless we have an alternative way of characterising it. That is, we need a way of constructing it, or to find other properties that the line satisfies. The above expressions for the intercepts cannot be constructed with compass and straight edge for general a and b since they involve cube roots. In fact Philo was motivated by this problem while working on the classical problem of doubling the cube (equivalently, constructing the cube root of 2) [1, 2]. It was only shown in the 19th century that such a construction with compass and straight edge is impossible so the problem eluded mathematicians for more than two millenia! Even Newton worked on the problem of constructing Philo’s line by compass and straight edge [3].

We will now turn to the general case of an arbitrary angle \theta and use calculus to find the minimum distance in terms of the roots of a cubic polynomial. On the way we will see a few interesting equivalent characterisations of the line. The special case of \theta = 90^{\circ} was solved in an earlier post using Hölder’s inequality without the need for calculus.

Main result

This post will prove the following.

Given two lines intersecting in an angle \theta and a point P with distances a and b to the two lines, the squared length of Philo’s line, the shortest line segment through P and joining the two lines, is given by

\displaystyle d^2 = \frac{1}{\sin^2 \theta}\left[3x^2 - \frac{a^2b^2}{x^2} + 4(a - b \cos \theta )x + a^2 + b^2 - 4ab \cos \theta\right], \quad \quad (3)

where x is the positive root satisfying the cubic equation

\displaystyle x^3 - (b \cos \theta)x^2 + (ab \cos \theta)x - ab^2 = 0.\quad \quad (4)

Before proving this, let us check to see what happens in the special cases we saw earlier. In the case a=b, the cubic (4) becomes

\displaystyle x^3 - (a \cos \theta )x^2 + a^2 \cos \theta - a^3 = (x-a) (x^2 + a(1 - \cos \theta )x + a^2) = 0.

The quadratic factor has only complex roots, and so we have the unique real solution x = a. This leads to

\begin{array} {lcl} d^2 &=& \frac{1}{\sin^2 \theta } \left[ 3x^2 - \frac{a^2b^2}{x^2} + 4(a - b \cos \theta )x + a^2 + b^2 - 4ab \cos \theta\right]\\&=& \frac{1}{\sin^2 \theta} \left[ 3a^2 - \frac{a^2.a^2}{a^2} + 4(a - a \cos \theta ) a + a^2 + a^2 - 4a^2 \cos \theta \right] \\&=& \frac{1}{\sin^2 \theta } \left[ 3a^2 - a^2 + 4a^2 - 4a^2 \cos \theta + a^2 + a^2 - 4a^2 \cos \theta \right] \\ &=& \frac{8a^2(1-\cos \theta )}{\sin^2 \theta}, \end{array}

matching with (1).

In the other special case \theta = 90^{\circ}, the cubic becomes

\displaystyle x^3 - (b \cos \theta)x^2 + (ab \cos \theta)x - ab^2 = x^3 - ab^2 = 0,

giving us x = a^{1/3}b^{2/3} as the unique real solution. Substituting this into (3) we obtain (2):

\begin{array}{lcl} d^2 &=& \frac{1}{\sin^2 \theta }\left[ 3x^2 - \frac{a^2 b^2}{x^2} + 4(a - b\cos \theta )x + a^2 + b^2 - 4ab \cos \theta \right]\\ &=& \frac{1}{1}\left[ 3(a^{1/3}b^{2/3})^2 - \frac{a^2b^2}{(a^{1/3}b^{2/3})^2} + 4a.a^{1/3}b^{2/3} + a^2 + b^2\right]\\ &=& 3a^{2/3} b^{4/3} - a^{4/3}b^{2/3} + 4a^{4/3}b^{2/3} + a^2 + b^2\\ &=& \left( a^{2/3} + b^{2/3} \right)^3. \end{array}

Hence both earlier results are verified. Isn’t it interesting how the cubic yields such different looking solutions? 🙂

Finding equivalent characterisations

I will firstly show my initial approach leading to a couple of known characterisations of the problem. Then I will present a second approach leading to the above result.

Let \alpha be the angle between the shortest line and the line ON (0 < \alpha < \pi - \theta). Let \beta be the angle between the shortest line and the line OM. Observe that \alpha + \beta +\theta = \pi.

The distance to be minimised is \displaystyle d(\alpha) = \frac{a}{\sin \alpha} + \frac{b}{\sin(\alpha + \theta)} where 0 < \alpha < \pi - \theta.

Setting d'(\alpha) to 0 gives

\displaystyle -\frac{a \cos \alpha}{\sin^2 \alpha} - \frac{b \cos (\alpha + \theta)}{\sin^2 (\alpha + \theta)} = 0.

From this,

\displaystyle \frac{b}{a} = \frac{-\sin^2 (\alpha + \theta) \cos \alpha}{\sin^2 \alpha \cos (\alpha + \theta)} = \frac{\sin^2 \beta \cos \alpha}{\sin^2 \alpha \cos \beta},\quad \quad (5)

where \alpha + \beta +\theta = \pi. Neither of the boundary conditions \alpha =0 or \alpha = \pi will lead to the solution (for a, b > 0), so the minimum d will occur when (5) is satisfied.

Let D be the foot of the altitude from O to MN (refer to next figure below). Then we also have

\displaystyle \frac{\sin^2 \beta \cos \alpha}{\sin^2 \alpha \cos \beta} = \frac{ (OD/OM) (ND/ON) \sin \beta}{ (OD/ON)(MD/OM)\sin \alpha} = \frac{ND \sin \beta}{MD \sin \alpha}, \quad \quad (6)


\displaystyle \frac{b}{a} = \frac{MP \sin \beta}{NP \sin \alpha}. \quad \quad (7)

Combining (5), (6) and (7) it follows that P must satisfy ND/MD = MP/NP, from which MD = NP. That is, Philo’s line is chosen so that P is the isotomic conjugate of the foot of the altitude from O to MN. This is possibly the most commonly known characterisation of Philo’s line as presented in [1].

A second characterisation is that the intercepts M and N of Philo’s line with the two lines of the given angle are equidistant to the point Q which is the midpoint of OP. Equivalently, Q is on the perpendicular bisector of Philo’s line.

The following figure shows these two characterisations.

In our earlier 90 degree example of P at (8,1) the intercepts (10, 0) and (0,5) are equidistant from Q(4,0.5).

I also played with other equivalent formulations of the condition (5) and came up with the following figures in an attempt to find \alpha and \beta given a, b and \theta.

1) A maps to B and B maps to A under inversion in each circle illustrated below, where \theta is the angle between the tangents shown.

2) The following dual figure can be constructed:

3) In this construction, unlike the previous two, one can at least draw part of the figure with the known information. Start with a triangle OAB with lengths a, b and included angle \pi - \theta and construct rays from O perpendicular to OA and OB. Then we wish to construct points C and D on these rays so that the red lines shown form 90-degree angles.

These equivalent characterisations may look interesting, but they still do not tell us the length of the line! I had to adopt a different tactic.

Proof of result using Lagrange multipliers

The approach that leads one to the cubic (4) is by solving the following optimisation problem through Lagrange multipliers. Let OM = m, ON = n. Then by the cosine rule, \displaystyle d^2 = m^2 + n^2 - 2mn \cos \theta. The condition that P is on MN is equivalent to the condition that the areas of triangles OMP and ONP add to OMN, or mb + na = mn \sin \theta (equivalently, a/m + b/n = \sin \theta). Hence we state our optimisation problem as

\displaystyle \max m^2 + n^2 - 2mn \cos \theta \quad \text{ s.t. }\quad mb + na = mn \sin \theta.

To solve this, we form the Lagrangian L(m,n,\lambda) = m^2 + n^2 - 2mn \cos \theta - \lambda(mb + na - mn \sin \theta) and set its partial derivatives \partial L/\partial m and \partial L/\partial n to 0:

\displaystyle 2m - 2n \cos \theta - \lambda(b - n \sin \theta) = 0
\displaystyle 2n - 2m \cos \theta - \lambda(n - m \sin \theta) = 0

This gives us

\displaystyle \frac{m - n\cos \theta}{b - n\sin \theta} = \frac{n - m \cos \theta}{a - m \sin \theta} \Rightarrow \frac{b - n\sin \theta}{a - m \sin \theta} = \frac{m - n\cos \theta}{n - m \cos \theta}.\quad \quad (8)

At this point we make the substitution m = \frac{a + x}{\sin \theta}, n = \frac{b + y}{\sin \theta}. This is motivated by the simpler cases considered earlier: geometrically x and y are as shown below and they have more manageable forms in those simpler cases.

We also find that the constraint mb + na = mn \sin \theta or a/m + b/n = \sin \theta becomes

\frac{a}{a+x} + \frac{b}{b+y} = 1.

Ordinarily one might be satisfied with such a condition, but further simplification is possible!

\begin{array}{rcl} \frac{a}{a+x} &=& 1 - \frac{b}{b+y}\\ &=& \frac{y}{b+y}\\ \Leftrightarrow \frac{x+a}{a} &=& \frac{b+y}{y} \\ \Leftrightarrow\ \frac{x}{a} &=& \frac{b}{y} \\ \Leftrightarrow\ xy &=& ab \end{array}

Cool! I never would have thought that \frac{a}{a+x} + \frac{b}{b+y} = 1 is equivalent to xy = ab. 🙂

The equations m = \frac{a + x}{\sin \theta}, n = \frac{b + y}{\sin \theta} give x= m\sin \theta - a, y = n \sin \theta - b and so (8) under this subsitution for m and n becomes

\begin{array}{lcl} \frac{y}{x} &=& \frac{m - n\cos \theta}{n - m \cos \theta}\\ &=& \frac{(a+x)/\sin \theta - (b+y)\cos \theta /\sin \theta }{(b + y)/\sin \theta - (a + x)\cos \theta/\sin \theta }\\ &=& \frac{x + a - b\cos \theta + y \cos \theta}{y + b - a \cos \theta + x\cos \theta} \\ &=& \frac{x + a - b\cos \theta}{y + b - a \cos \theta} \quad \text{(by addendo).}\end{array}

Substituting y = ab/x into this equation gives us ab/x^2 = (x + a - b\cos \theta)/(ab/x + b - a\cos \theta), which is equivalent to the following quartic equation (for x \neq 0).

\displaystyle x^4 + (a - b\cos \theta)x^3 - ab(b - a\cos \theta)x - a^2b^2 = 0 \quad \quad (9)

This quartic has a factor (x+a) (found with help from Wolfram|Alpha) and cancelling this factor from both sides gives us our cubic (4):

\displaystyle x^3 - (b \cos \theta)x^2 + (ab \cos \theta)x - ab^2 = 0.

In terms of x, the length of Philo’s line is given by

\begin{array}{lcl} d^2 &=& m^2 + n^2 - 2mn \cos \theta \\ &=& \frac{1}{\sin^2 \theta} \left[ (a + x)^2 + (b+y)^2 -2(a+x)(b+y) \cos \theta \right]\\ &=& \frac{1}{\sin^2 \theta} \left[ x^2 + y^2 - 2(ab + xy)\cos \theta + 2(ax +by) - 2(bx + ay)\cos \theta + a^2 + b^2 \right] \\&=& \frac{1}{\sin^2 \theta} \left[ x^2 + (ab/x)^2 - 4ab \cos \theta + 2(ax + ab^2/x) - 2(bx + a^2b/x) \cos \theta + a^2 + b^2 \right]\\ &=& \frac{1}{\sin^2 \theta} \left[ x^2 + (ab/x)^2 +2\left( (a - b\cos \theta)x+ (b - a\cos \theta)ab/x\right) + a^2 + b^2 - 4ab \cos \theta\right]. \quad \quad (10)\end{array}

Some simplification here is possible by using the quartic form (9), which gives us \displaystyle (ab/x)^2 + 2(b- a \cos \theta)ab/x = 2 x^2 + 2(a-b\cos \theta)x - (ab/x)^2. Subsituting this into (10) gives our desired form (3):

\displaystyle d^2 = \frac{1}{\sin^2 \theta}\left[3x^2 - \frac{a^2b^2}{x^2} + 4(a - b \cos \theta )x + a^2 + b^2 - 4ab \cos \theta\right].

Finally we show why there is only one positive root of the cubic (4). There is an easier approach than evaluating the cubic’s discriminant. Let \displaystyle f(x) = x^3 - (b \cos \theta)x^2 + (ab \cos \theta)x - ab^2. Since f(0) = -ab^2 < 0, there is either one positive root or three (Imagine a graph of the positive cubic – by the intermediate value theorem it crosses the x axis at some positive x value. Here we are counting repeated roots more than once). Suppose there are three positive roots 0 < r_1 \leq r_2 \leq r_3. We now seek a contradiction.

The relationship f(x) = (x-r_1)(x-r_2)(x-r_3) leads to r_1 + r_2 + r_3 = b \cos \theta and \displaystyle 1/r_1 + 1/r_2 + 1/r_3 = (r_1r_2 + r_2r_3 + r_1r3)/r_1r_2r_3 = (ab \cos \theta)/(ab^2) = \frac{\cos \theta}{b}. Multiplying these two equations together gives

\displaystyle (r_1 + r_2 + r_3)(1/r_1 + 1/r_2 + 1/r_3) = \cos^2 \theta \leq 1.

But this contradicts the left side being at least 3 (in fact it is at least 9). We conclude that the three roots cannot all be positive (even including multiplicity), and so there is only one positive root.

Finally here are a few more cases where a nice solution is found from specific values of a, b and \theta:

  • a = 4, b = 108/13, \cos \theta = 33/65 leads to x=36/5 , d=14 (drawing the figure gives a 13-14-15 triangle)
  • a = 18, b = 2, \theta = 60^{\circ} leads to x=3 , d^2\sin^2 \theta = 343
  • a = 48/17, b = 12, \cos \theta = -13/85 leads to x=120/17 , d=21 (drawing the figure gives a 10-17-21 triangle)
  • a = 18, b = 2, \cos \theta = 1/4 leads to x=3 , d^2 \sin^2 \theta = 160

For more about Philo’s line see the references below. In particular, a Euclidean (non-calculus) proof of why Philo’s line is characterised by P being the isotomic conjugate of the foot of the altitude from O is given in p198 of [4]. According to one of the links from [3], Newton found a characterisation in the more general case when the lines OM and ON are curves and the shortest line segment is required to be tangent to a given curve – it involves the concurrency of three normals to the curves.


[1] Wikipedia – Philo Line

[2] Philon’s line

[3] The Philon’s Line

[4] Project Gutenberg’s First Six Books of the Elements of Euclid, by John Casey. Available at

[5] Philon Line–minimal length proof? – Yahoo! Answers

[6] Weisstein, Eric W. “Philo Line.” From MathWorld–A Wolfram Web Resource.

September 5, 2011

Best VFL/AFL Home and Away Seasons

Filed under: sport — ckrao @ 12:05 pm

Despite Collingwood’s final round loss by 96 points to Geelong, they still ended up with the highest percentage in a 22-round VFL/AFL season (best in any season since 1929). The following table is taken from [1]. In the final round their percentage dropped 14%! It was the first time since 1911 the top two teams played in the final round with their positions already guaranteed.

Best Record – Home & Away Season
Team P W D L For Ave. Agn Ave. % Win% Year
Collingwood 18 18 279. 244 1918 106.56 156. 181 1117 62.06 171.71 100.00 1929
Geelong 22 21 1 392. 320 2672 121.45 237. 229 1651 75.05 161.84 95.45 2008
Essendon 22 21 1 415. 326 2816 128.00 259. 216 1770 80.45 159.10 95.45 2000
Carlton 18 17 1 153. 207 1125 62.50 84. 160 664 36.89 169.43 94.44 1908
Essendon 18 17 1 286. 226 1942 107.89 167. 195 1197 66.50 162.24 94.44 1950
South Melbourne 14 13 1 134. 166 970 69.29 89. 144 678 48.43 143.07 92.86 1918
Collingwood 22 20 2 381. 306 2592 117.82 222. 214 1546 70.27 167.66 90.91 2011
St Kilda 22 20 2 322. 265 2197 99.86 206. 175 1411 64.14 155.71 90.91 2009
Carlton 22 20 2 340. 317 2357 107.14 246. 235 1711 77.77 137.76 90.91 1995

Interestingly, 3 of the most successful home-and-away seasons have come in the past four years (neither Geelong nor St Kilda won the premiership in those respective years). The West Coast Eagles previously had the record for the highest percentage in a 22-round home-and-away season: 162.2% in 1991 after a 19-3 season (also losing in the final round).

This year the 4th placed side (West Coast) had a 17-5 record. This is the most games a team has won while missing out on the top 3. Back in 2008 a 13-9 record was enough for St Kilda to claim 4th spot after the home-and-away season! Also, the last time the 5th-ranked team had a percentage above 130 (as Carlton did this year) was 1963.


[1] AFL Tables – Season Records

September 2, 2011

Addendo to sum geometric series

Filed under: mathematics — ckrao @ 12:00 pm

In an earlier post on manipulating fractions, I mentioned the useful addendo property: if a/b = c/d, then

\displaystyle \frac{a}{b} = \frac{c}{d} = \frac{a+c}{b+d}.

This property is in fact used in Euclid’s Elements (Book 9, Proposition 35) written some 2300 years ago to sum a geometric series!

The usual way one is taught to find the sum

\displaystyle S = a + ar + ar^2 + ar^3 + \ldots + ar^{n-1}

is to multiply both sides by r to give

\displaystyle Sr = ar + ar^2 + ar^3 + ar^4 + \ldots + ar^n

and then subtract the first equation from the second:

\displaystyle S(r-1) = ar^n - a.

Hence \displaystyle S = \frac{a(r^n - 1)}{r-1}.

Here is an alternative approach based on Euclid’s work. We begin with the ratios

\displaystyle \frac{ar}{a} = \frac{ar^2}{ar} = \frac{ar^3}{ar^2} = \ldots = \frac{ar^n}{ar^{n-1}}.

Subtracting 1 from each of these ratios (equal to r) gives

\displaystyle \frac{ar - a}{a} = \frac{ar^2-ar}{ar} = \frac{ar^3-ar^2}{ar^2} = \ldots = \frac{ar^n-ar^{n-1}}{ar^{n-1}}.

By addendo each of these ratios (equal to r-1) is also equal to

\displaystyle \frac{(ar - a) + (ar^2 - ar) + (ar^3 - ar^2) + \ldots + (ar^n - ar^{n-1})}{a + ar + ar^2 + \ldots + ar^{n-1}}.

The numerator here simplifies greatly and we are left with

\displaystyle r-1 = \frac{ar^n - a}{a + ar + ar^2 + \ldots + ar^{n-1}},

from which

\displaystyle a + ar + ar^2 + \ldots + ar^{n-1} = \frac{a(r^n - 1)}{r-1}

as desired.

Geometric sequences have a special self-similarity property – multiplying each term by the common ratio r produces a new sequence that only differs from the original sequence at its ends. Keeping this idea in mind makes them easy to sum.

Blog at

%d bloggers like this: