Roots of Unity Filter Part 2 - Roots of Unity

Note

This is a three part series I wrote back in 2019 on a technique applicable to certain competitive math problems: roots of unity filters. The first two parts are just a recap of complex numbers and roots of unity respectively. If you're already comfortable with both of these topics, feel free to skip to Part 3.

Basics

Definition

The nnth roots of unity for a positive integer nn are all of the complex numbers zz that satisfy the following equation:

zn=1z^n = 1

One thing to note from this equation is that there are nn nnth roots of unity since the roots of unity could be interpreted as the nn roots to the polynomial

zn1z^n - 1

In this document, we will denote the "smallest" nnth root of unity as the nnth root of unity with the smallest positive angle θ\theta when graphed on the complex coordinate plane. Note that this means although 11 is always an nnth root of unity, it is not considered in this document as the "smallest" nnth root of unity.

Theorem

If ω\omega is the smallest nnth root of unity, then all of the powers of ω\omega are also roots of unity.

ω1,ω2,...,ωn\omega^1, \omega^2, ..., \omega^{n}

This can be proven as follows:

zn=1z^n = 1
ωn=1\omega^n = 1
(ωi)n=(ωn)i=1i=1(\omega^i)^n = (\omega^n)^i = 1^i = 1

In fact, all of the nnth roots of unity can be written as the first nn powers of the smallest nnth root of unity.

Note that with this method, we do not obtain more than nn roots of unity because if we raise ω\omega to the n+1n + 1th power, we can factor out a term of wn=1w^n = 1 to obtain the root of unity ww again. This shows that the nnth roots of unity are cyclicnature, which is a really powerful application of them especially towards things like roots of unity filter, which we will cover next.

Polynomial Interpretation

As we stated before, we can consider the nnth roots of unity as the roots of the polynomial

xn1x^n - 1

However, we can also write a polynomial in terms of its factors, which means that we can write the polynomial xn1x^n - 1 as the following:

xn1=(xω)(xω2)...(xωn)=(x1)(xω)...(xωn1)x^n - 1 = (x - \omega)(x - \omega^2)...(x - \omega^n) = (x - 1)(x - \omega)...(x - \omega^{n - 1})

This interpretation can be pretty useful in a few problems, as we will see in an example later.

A more important aspect of this interpretation is the following result. Note that we can actually factor the equation xn1=0x^n - 1 = 0 as:

(x1)(1+x+x2+...+xn1)=0(x - 1)(1 + x + x^2 + ... + x^{n - 1}) = 0

Try multiplying out the factorization to see why. If we divide both sides by x1x - 1 we obtain the following theorem:

Theorem

For any nnth root of unity w1w \neq 1, the following equation is true:

1+ω+ω2+...+ωn1=01 + \omega + \omega^2 + ... + \omega^{n - 1} = 0

Note that for this theorem, ω\omega does not have to be the smallest nnth root of unity.

Calculating Roots of Unity

We can calculate roots of unity using de Moivre's Theorem. Consider the equation

xn=1x^n = 1

We can rewrite 11 in its polar form as cis(2πk)\text{cis}(2\pi k), where kk is any integer. Then, by applying de Moivre's Theorem with the exponent n-n, we obtain the following:

x=cis(2πkn)x = \text{cis}\left(\dfrac{2\pi k}{n}\right)

Note that a negative exponent with de Moivre's Theorem corresponds to dividing the angle by nn, not multiplying it by n-n.

By ranging kk in the interval [0,n1][0, n - 1], all nn roots of unity can be obtained. By setting k=1k = 1, we can show that the smallest nnth root of unity is:

ω=cis(2πn)\omega = \text{cis}\left(\dfrac{2\pi}{n}\right)

Example

The 5th roots of unity are as follows:

ω5=1\omega^5 = 1
ω=cis(2πk5)\omega = \text{cis}\left(\dfrac{2\pi k}{5}\right)
ω=1,cis(2π5),cis(4π5),cis(6π5),cis(8π5)\omega = 1, \text{cis}\left(\dfrac{2\pi}{5}\right), \text{cis}\left(\dfrac{4\pi}{5}\right), \text{cis}\left(\dfrac{6\pi}{5}\right), \text{cis}\left(\dfrac{8\pi}{5}\right)

Example

The 4th roots of unity are as follows:

ω4=1\omega^4 = 1
ω=cis(2πk4)\omega = \text{cis}\left(\dfrac{2\pi k}{4}\right)
ω=1,cis(2π4),cis(4π4),cis(6π4)\omega = 1, \text{cis}\left(\dfrac{2\pi}{4}\right), \text{cis}\left(\dfrac{4\pi}{4}\right), \text{cis}\left(\dfrac{6\pi}{4}\right)
ω=1,i,1,i\omega = 1, i, -1, -i

Graphing Roots of Unity

A quite interesting property emerges once we graph the nth roots of unity. To demonstrate this, we shall graph the 5th roots of unity below.

5th Roots of Unity

As seen above, the 5th roots of unity produce a set of points evenly spaced around the complex plane. In fact, they form a regular pentagon. This is true for any nnth roots of unity.

Theorem

The nnth roots of unity will produce a regular nn-gon when graphed in the complex plane.

This can be seen when we look at the cis\text{cis} form of the roots of unity, as all of our points are evenly spaced around the unit circle.

This visualization can help give some visual intuition towards understanding the following sum:

1+ω+ω2+...+ωn11 + \omega + \omega^2 + ... + \omega^{n-1}

The nth roots of unity are all evenly spaced around the point (0,0)(0, 0), making their average the point (0,0)(0, 0). As a result, the sum of their real components must be 00 and the sum of their imaginary components must be 00. As a result, their total sum must be 00.

This visualization also helps with showing why the roots of unity are cyclic intuitively, as once you multiply the angle of a root of unity nn times to obtain more roots of unity, you will come back around the unit circle and start again.

Example Problems

Example

Problem from Brilliant.org by Andy Hayes


Consider the equation

x7+x6+x5+...+x+1=0x^7 + x^6 + x^5 + ... + x + 1 = 0

Let xkx_k be the kkth distinct root of the equation, and let (xk)\Re(x_k) be the real part of the root. Find

k=17[(xk)2]\sum_{k=1}^7[\Re(x_k)^2]

There are three primary ways to approach this problem:

  • The given equation may remind you of the result we derived earlier, which states that the given equation is valid for all of the 88th roots of unity besides 1. As a result, we can immediately apply our knowledge about roots of unity and solve the problem.

  • However, if you do not see the above connection immediately, there are a few other ways to see the above. First, you could realize that the sum given is a geometric series, which means that it can be rewritten in the form

    x81x1=0\dfrac{x^8 - 1}{x - 1} = 0

    From this, it is clear that the numerator will be equal to 00 for each of the 88th roots of unity, while the denominator eliminates 11 as a solution.

  • Another way to see the above is to multiply the entire given equation by xx.

    x(x7+x6+x5+...+x+1)=x8+x7+x6+...+x2+xx(x^7 + x^6 + x^5 + ... + x + 1) = x^8 + x^7 + x^6 + ... + x^2 + x

    We can then subtract the original equation from this equation to obtain:

    x81=0x^8 - 1 = 0

    We can see that all of the 88th roots of unity are solutions, although 11 is an extraneous solution we obtained after multiplying everything by xx. We can be sure there is an extraneous solution since there are 8 8th roots of unity, but the original polynomial only has degree 7.

Once we find this, we can easily calculate the 8th roots of unity because each of them will correspond to angles in increments of π4\dfrac{\pi}{4}.

8th Roots of Unity

By computing the cosine (which produces the real component of the roots of unity) of all of these angles and including θ=0\theta = 0, we obtain the answer:

cos(π4)2+cos(π2)2+cos(3π4)2+cos(π)2+\cos\left(\dfrac{\pi}{4}\right)^2 + \cos\left(\dfrac{\pi}{2}\right)^2 + \cos\left(\dfrac{3\pi}{4}\right)^2 + \cos(\pi)^2 +
cos(5π4)2+cos(3π2)2+cos(7π4)2=3\cos\left(\dfrac{5\pi}{4}\right)^2 + \cos\left(\dfrac{3\pi}{2}\right)^2 + \cos\left(\dfrac{7\pi}{4}\right)^2 = \boxed{3}

Example

Problem from Thomas Mildorf's Mock AIME 1: #10

ABCDEFABCDEF is a regular heptagon inscribed in a unit circle centered at OO. ll is the line tangent to the circumcircle of ABCDEFGABCDEFG at AA, and PP is a point on ll such that AOP\triangle AOP is isosceles. Let pp denote the value of APBPCPDPEPFPGPAP * BP * CP * DP * EP * FP * GP. Determine the value of p2p^2.

At first glance, this problem may not seem related to roots of unity. However, it can be solved really nicely with roots of unity.

The first hint that roots of unity can be applied is the fact that there is a regular heptagon inscribed in a unit circle. Heptagons are nasty in geometry, as they have fractional angle measures. Secondly, the 7th roots of unity are perfect for expressing 7 points equally spaced around the unit circle, which is what this heptagon ABCDEFABCDEF is.

As a result, we can graph the 7 roots of unity as ABCDEFABCDEF as shown below.

ABCDEF

Note that we aligned AA with the x-axis (making it equal to 1) to make the next step simpler. We then have to draw the line ll such that ll is tangent to the heptagon. Since we alined AA with the x-axis, the line ll is simply a vertical line.

ABCDEF with line l

We can then draw the point PP such that AOP\triangle AOP is isosceles. Note that since the roots of unity are centered around the origin, the center OO of our heptagon will be the origin. Since PP is going to have to lie on ll and ll is vertical, the angle OAPOAP is going to be a right angle. Therefore, the triangle must have that OAAP\overline{OA} \cong \overline{AP}. If the triangle had any other two sides equal, then the angles would be impossible. You can try drawing it and seeing for yourself.

Note that OA=1OA = 1 since AA is on the unit circle, so AP=OA=1AP = OA = 1. We will arbitrarily choose PP to be 11 unit above the x-axis. The answer will be the same regardless of whether PP is above or below the x-axis due to symmetry.

ABCDEF with line l and point P

Now that the diagram is set up, we can proceed with calculating the given product, with is the square of the product of all of the distances from PP to all of the points on in ABCDEFABCDEF.

To calculate the distance between two complex numbers, we need to do a bit of thinking. To find the distance between two complex numbers in the complex plane, we can first find the complex number that represents the difference between the two. Then, we can just find the magnitude of this complex number. For instance, the distance between complex numbers z=1+2iz = 1 + 2i and w=3+4iw = 3 + 4i would be:

wz=2+2i=22+22=22|w - z| = |2 + 2i| = \sqrt{2^2 + 2^2} = 2\sqrt{2}

Now that we have this out of the way, we can go back to the problem. We can label all of the points of our hexagon as the roots of unity 1,ω,ω2,ω3,...,ω61, \omega, \omega^2, \omega^3, ..., \omega^6.

ABCDEF with point P and Distances

We can also label our point PP as the complex number P=1+iP = 1 + i. To find the product of the distances from PP to each of the points, we can do the following:

p=P1PωPω2...Pω6p = |P - 1| * |P - \omega| * |P - \omega^2| * ... * |P - \omega^6|

By using the properties of multiplied complex numbers, we can show that this is equal to the following:

p=(P1)(Pω)(Pω2)...(Pω6)p = |(P - 1)(P - \omega)(P - \omega^2)...(P - \omega^6)|

You may realize that this looks similar to what we discussed earlier with an alternative form of the polynomial xn1x^n - 1, but with PP plugged in for xx.

x71=(x1)(xω)(xω2)...(xω6)x^7 - 1 = (x - 1)(x - \omega)(x - \omega^2)...(x - \omega^6)

Therefore, we can rewrite pp as the following:

p=P71p = |P^7 - 1|

We know what PP is, so now we can just plug in the numbers! However, rather than calculating P7P^7 by hand, we can take a shortcut with de Moivre's theorem.

We can calculate P=12+12=2\lvert P \rvert = \sqrt{1^2 + 1^2} = \sqrt{2} and arg(P)=atan(1/1)=π4\text{arg}(P) = \text{atan}(1/1) = \dfrac{\pi}{4}. Therefore, we can write PP in polar form as P=2cis(π4)P = \sqrt{2}\text{cis}\left(\dfrac{\pi}{4}\right). We can then calculate P7P^7 easily using de Moivre's as:

P7=27/2cis(7π4)=82(22i22)=88iP^7 = 2^{7/2}\text{cis}\left(\dfrac{7\pi}{4}\right) = 8\sqrt{2}\left(\dfrac{\sqrt{2}}{2} - i\dfrac{\sqrt{2}}{2}\right) = 8 - 8i

We can then finish the problem:

p=P71=78i=72+82=113p = |P^7 - 1| = |7 - 8i| = \sqrt{7^2 + 8^2} = \sqrt{113}
p2=113p^2 = \boxed{113}