Chaitanya's Random Pages

April 30, 2015

Number of countries that have abolished the death penalty by year

Filed under: Uncategorized — ckrao @ 11:36 am

The graph below is generated from data at this Wikipedia page.

By 1978 only 20 or so countries had abolished the death penalty but over 80 countries have followed suit since. Around 36 countries still retain capital punishment in law and practice with the remaining 50+ countries inactive in its use.


April 19, 2015

Distances to a line from vertices of a regular polygon

Filed under: mathematics — ckrao @ 11:01 am

If we take a regular polygon and any line through its centre, then the sum of the squares of the distances from the vertices of the polygon to the line is independent of the orientation of the line or polygon. For example, in the following two diagrams, the sum of the squares of the lengths of the 5 blue line segments is the same.


Such a result is amenable to a proof via complex numbers. Without losing generality the real number line may be our line of interest and the points of the n-sided polygon may be described by the complex numbers z_k := R\exp(2\pi i k / n + i \phi) for k = 0, 1, ..., n-1, where R is the circumradius of the polygone and \phi is an arbitrary real-numbered phase. Then the squared distance from a point to the real line is R^2\cos^2 (2\pi k / n + \phi) = \left(z_k + \overline{z_k})\right)^2/4 where \overline{z_k} = R^2/z_k. Summing this over k gives our sum of squared distances as

\begin{aligned} \frac{1}{4} \sum_{k=0}^{n-1} \left(z_k + \overline{z_k}\right)^2  &= \frac{1}{4} \sum_{k=0}^{n-1} \left(z_k^2 + 2z_k\overline{z_k} + \overline{z_k}^2\right)\\  &= \frac{1}{4} \sum_{k=0}^{n-1} \left(z_k^2 + 2R^2 + \overline{z_k}^2\right)\\  &= \frac{nR^2}{2} + \frac{1}{4} \left(\sum_{k=0}^{n-1} z_k^2 + \sum_{k=0}^{n-1} \overline{z_k}^2\right).\quad\quad(1)\end{aligned}

 Each of these sums is geometric in nature so can be simplified. For example,

\begin{aligned}\sum_{k=0}^{n-1} z_k^2 &= \sum_{k=0}^{n-1} R^2\exp(4\pi i k / n + 2i\phi)\\&= R^2 \exp(2i\phi)\sum_{k=0}^{n-1} \exp(4\pi i k / n)\\  &= \begin{cases}R^2 \exp(2i\phi)\frac{1-\exp(4\pi i n / n)}{1- \exp(4\pi i / n)}, & \text{if }\exp(4\pi i/n)\neq 1 \\  R^2 \exp(2i\phi)n, & \text{if }\exp(4\pi i/n)= 1 \end{cases}\\  &= R^2 \exp(2i\phi)\frac{1-\exp(4\pi i)}{1- \exp(4\pi i / n)}, \quad \text{as }n \geq 3\text{ means }\exp(4\pi i/n)\neq 1\\  & = 0.\quad\quad(2)\end{aligned}

Similarly, \sum_{k=0}^{n-1} \overline{z_k}^2 = 0, being the conjugate of (2), and so from (1) our required sum of squared distances is nR^2/2, which is independent of \phi proving the orientation independence.

More generally,

\begin{aligned}\sum_{k=0}^{n-1} z_k^m &= R^m\exp(i m \phi) \sum_{k=0}^{n-1} \exp(2\pi i k m / n) \\  &= \begin{cases} R^m\exp(i m \phi) n, & \text{if }m/n \text{ is an integer}\\ 0, & \text{otherwise}\end{cases}.\quad\quad(3)\end{aligned}

This enables us to generalise the above result to the following.

Given a regular n-sided polygon and line through its circumcentre, the sum of the mth power signed distances from the vertices of the polygon to the line is independent of the orientation when n > m.

By signed distances, we mean that points on different sides of the line will have distances of opposite sign.

To prove this, we define z_k := R\exp(2\pi i k / n + i \phi) as before and this time our desired sum is

\begin{aligned}\sum_{k=0}^{n-1} \left(\frac{z_k + \overline{z_k}}{2}\right)^m  &= \frac{1}{2^m}\sum_{k=0}^{n-1} \sum_{j=0}^m z_k^j \overline{z_k}^{m-j} \binom{m}{j}\\  &= \frac{1}{2^m}\sum_{k=0}^{n-1} \sum_{j=0}^m z_k^j (R^2/z_k)^{m-j}\binom{m}{j}\\  &= \frac{1}{2^m}\sum_{k=0}^{n-1} \sum_{j=0}^m z_k^{2j-m} (R^2)^{m-j}\binom{m}{j}\\  &= \frac{1}{2^m} \sum_{j=0}^m (R^2)^{m-j}\binom{m}{j}\sum_{k=0}^{n-1}z_k^{2j-m}. \quad\quad(4)\\  \end{aligned}

By (3), \sum_{k=0}^{n-1}z_k^{2j-m} = 0 unless (2j-m)/n is an integer. For m < n this can only occur in the case j = m/2 (if m is even). Hence (4) becomes

\begin{aligned}\sum_{k=0}^{n-1} \left(\frac{z_k + \overline{z_k}}{2}\right)^m &= \begin{cases} \left(\frac{R}{2}\right)^m\binom{m}{m/2}n, & \text{if }m\text{ is even,}\\ 0, & \text{otherwise.}\end{cases}\end{aligned} \quad\quad(5)

Finally, what if the line does not pass through the centre of the polygon but is instead at distance d from the centre?


This corresponds to replacing \left(\frac{z_k + \overline{z_k}}{2}\right) with \left(\frac{z_k + \overline{z_k}}{2}-d\right) in the above calculations and we find

\begin{aligned} \sum_{k=0}^{n-1} \left(\frac{z_k + \overline{z_k}}{2}-d\right)^m &= \sum_{k=0}^{n-1} \sum_{j = 0}^m\left(\frac{z_k + \overline{z_k}}{2}\right)^j (-d)^{m-j} \binom{m}{j}\\  &= \sum_{j = 0}^m (-d)^{m-j} \binom{m}{j}\sum_{k=0}^{n-1} \left(\frac{z_k + \overline{z_k}}{2}\right)^j\\  &= \sum_{i = 0}^{\lceil{m/2}\rceil} (-d)^{m-2i} \binom{m}{2i} \left(\frac{R}{2}\right)^{2i}\binom{2i}{i} n\\  &= (-1)^m n \sum_{i = 0}^{\lceil{m/2}\rceil} \frac{m!}{(m-2i)!i!i!}d^{m-2i}\left(\frac{R}{2}\right)^{2i}.\quad\quad(6)\end{aligned}

Once again we find the sum is independent of the orientation of the line or polygon. In the particular case of m=2 this sum is nR^2/2 + nd^2, which also may be obtained by an application of the parallel axis theorem.

Create a free website or blog at

%d bloggers like this: