Visualizing Cantor’s Zig Zag

A famous and intriguing result in mathematics is that there are just as many points on a line as there are in a plane. This seems counterintuitive at first: planes contain infinitely many lines, so not only should a plane have infinitely many more points than a line, it should have infinitely times as many points as a line! But this is one of the many curious consequences of the mathematics of infinity.

Here, we’ll restrict ourselves to points in the plane with non-negative integer coordinates. Think about points of the form ( c), where c is a non-negative integer. Since there are infinitely many integers, this set of points is infinite, and the points all lie on the line y = 0. The set of points of the form ( c, ) is also infinite, and these points all lie on the line = 1. Notice that, since these two lines are parallel, every point on one matches up perfectly with a point on the other: (0,0) with (0,1); (1,0) with (1,1); (2,0) with (2,1), and so on.

This matching offers a reasonable argument that the two sets have the same number of points: Every point in each set has a unique partner in the other, so counting the points in one is equivalent to counting the points in the other. In this case, we say that the two sets are in one-to-one correspondence. And if anything, this only seems to bolster the argument that there are more points in the plane than on a line: There are infinitely many lines of the form y = k in the plane, and each one contains as many points as the line = 0. So the plane should contain infinitely times as many points as the line! But the mathematics of infinity is tricky business.

Even though it seems like there are far more points in the plane than on the line, it’s possible to match the two sets up in a one-to-one correspondence. It’s not obvious how to do that, but thanks to Georg Cantor and his famous zig zag, we know it can be done. Here’s a visualization I created in Desmos to demonstrate this matching.

This animation shows how each point in the quarter-plane can be paired up with exactly one point on the half-line, and vice versa. The zig-zag pattern enumerates the points in the plane, showing that they could be rightly imagined as though all lying in order on a straight line. This one-to-one correspondence shows that the sets are the same size. And while this demonstration is limited to only part of the plane, the argument can be extended: for example, skipping every other point on the line y = 0 would create space to accommodate the points with negative y-coordinates.

The animation above is an extension of an earlier version shared on Twitter.

Thanks to Chris Long (@octonion) for inspiring this journey into the infinite by linking to this great paper on Cantor packing polynomials, which I used to create the above Desmos demonstrations. And Kelsey Houston-Edwards also recently shared a fun and related problem. I guess infinity is in the air!

Related Posts

 

02/18/2018 — Happy Permutation Day!

Today we celebrate a Permutation Day! I call days like today permutation days because the digits of the day and the month can be rearranged to form the year.

We can also consider today a Transposition Day, as we need only a single transposition (an exchange of two numbers) to turn the year into the day and date.

Celebrate Permutation Day by mixing things up! Try doing things in a different order today. Just remember, for some operations, order definitely matters!

The 2017-18 Conjecture

Like many mathematicians and teachers, I often enjoy thinking about the mathematical properties of dates, not because dates themselves are inherently meaningful numerically, but just because I enjoy thinking about numbers.

A new year means a new number to think about. And one interesting fact about our new year, 2018, is that it is semiprime.

A number is semiprime if it is the product of exactly two prime factors: for example, 15 = 3 * 5 is semiprime, as is 49 = 7 * 7, but neither 13 nor 30 are. Semiprime numbers are also referred to as biprime2-almost prime, or pqnumbers.

Semiprimes are very interesting in and of themselves, particularly in cryptography, but what caught my attention is that the previous year, 2017, is a prime number. That means we have a semiprime number, 2018, adjacent to a prime number, 2017. How unusual is this?

I played around a bit and ended up writing some simple programs to find and analyze semiprimes. Among the first 500,000 integers, there are roughly 108,000 semiprimes and 41,500 primes. Of the 108,000 semiprimes, only about 2,500 (or 2.3%) are adjacent to a prime number. This seems low to me: there are 83,000 prime-adjacent spots among the first 500,000 integers, representing 18% of the spots semiprimes could occupy. But only about 2.3% of the 108,000 semiprimes end up in those spots. That seems unusual. * [See Update]

In thinking about what happens further out along the number line, I couldn’t help but wonder if there are infinitely many prime-semiprime pairs like 2017 and 2018. I certainly don’t know the answer, but I thought I would start the new year boldly, with a conjecture:

The 2017-18 Conjecture

There are infinitely many pairs of consecutive integers one of which is prime and one of which is semiprime.

I think this problem’s resemblance to the Twin Prime Conjecture led me to both imagine this conjecture and also suspect it’s true. As with virtually everything in mathematics, I’m sure someone has thought of this before, and I would love a reference if anyone can provide it.

Thinking ahead, I was excited to notice that next year will also be a semiprime!

But it appears that the Twin Semiprime Conjecture is already an existing open question, which means I have less than a year to come up with a new conjecture for 2019.

Happy New Year! 2018 has already inspired to me to do some number theory, tackle some computing challenges, and think about some new ideas for the classroom. It’s a good mathematical start to the new year, and here’s hoping 2018 only gets better.

UPDATE, 1/18/2018

In a comment, Brent pointed out that I undercounted the number of semiprimes adjacent to a prime. A recalculation is consistent with Brent’s numbers: among the 108,000 semiprimes up to 500,000, around 4,900 of them are adjacent to prime number. Thanks, Brent!

Related Posts

 

Follow

Get every new post delivered to your Inbox

Join other followers: