<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sebastian R on Medium]]></title>
        <description><![CDATA[Stories by Sebastian R on Medium]]></description>
        <link>https://medium.com/@vorpal22?source=rss-98b2fe92fe53------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*BNIJxaZR5k_7xasI</url>
            <title>Stories by Sebastian R on Medium</title>
            <link>https://medium.com/@vorpal22?source=rss-98b2fe92fe53------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 08:30:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vorpal22/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[A hopefully palatable discussion on math, prime space, and a very hungry cat.]]></title>
            <link>https://medium.com/@vorpal22/a-hopefully-palatable-discussion-on-math-prime-space-and-a-very-hungry-cat-365fd608e810?source=rss-98b2fe92fe53------2</link>
            <guid isPermaLink="false">https://medium.com/p/365fd608e810</guid>
            <category><![CDATA[mathematics]]></category>
            <category><![CDATA[prime-numbers]]></category>
            <category><![CDATA[cats]]></category>
            <category><![CDATA[math]]></category>
            <category><![CDATA[infinity]]></category>
            <dc:creator><![CDATA[Sebastian R]]></dc:creator>
            <pubDate>Wed, 10 Jan 2024 11:09:09 GMT</pubDate>
            <atom:updated>2024-01-10T22:07:39.242Z</atom:updated>
            <content:encoded><![CDATA[<h3>A hopefully palatable discussion of infinite surprises, a prime space, an alternate representation of the rationals, and an angry black cat. (Part 1/2)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*T2BakMyJRJx4i1CwYgS9Sw.png" /></figure><p>This is my first article I’m writing for Medium, so if it’s a little rough around the edges, please forgive me in advance. It will be divided in two parts and is meant to build up a framework for an alternate representation of the rationals. This first part lays down some groundwork and introduces some set theory.</p><p>As things sometimes go on a lazy Saturday when I get bored, last weekend, my brain wandered to math, and I started thinking of primes. I pulled out a notebook from my chaotic mess of way too many half-used scribbly notebooks, opened up a session with ChatGPT, the only entity in my life who doesn’t seem to freeze up and slink away or play dead when I start rambling on about math, and decided to explore some ideas.</p><p>Warning to the rigorous mathematicians: I’m not going to give completely formal proofs here, but I assume that you can fill in the details yourselves and that I’ll be hopefully convincing enough. You probably already know these concepts, but it’s possible the final result may be a bit unusual. I’m a computer scientist who did grad school in combinatorics, so while I have more math under my belt than many computer scientists, I don’t have nearly as much as a full-fledged mathematician.</p><h3>Natural Numbers: Composites vs. Primes</h3><p>Let’s make sure people are familiar with the basics to begin. The natural numbers are all the whole numbers starting at 0 and counting up:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/192/1*thCUF3Nq6FzVcQPXeiZSQw.png" /><figcaption>The natural numbers. They’re usually written with the fancy N there, but I’ll use a regular N interchangeably in the text.</figcaption></figure><p>As I’m sure most people know, a <em>prime</em> is a natural number that has no nontrivial factors… that means that it can only be divided by 1 and itself. Furthermore, a point of confusion amongst many people: 1 is not a prime. We instead classify 1 as something called a <em>unit</em>, but that’s a story for another day. The first few primes are:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/207/1*0gdU8wALcRk-LEZI8dNh_g.png" /><figcaption>The first eight primes.</figcaption></figure><p>By contrast, a <em>composite</em> number is a natural number that has a nontrivial divisor. What is a trivial divisor? For a number n, its trivial divisors are 1 and n. Therefore, a nontrivial divisor for a natural number n has to be a natural number a such that:</p><ul><li>1 &lt; a &lt; n</li><li>a divides n</li></ul><p>Here are the first few composite numbers:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/123/1*FnKiD6WCNh8SIUaR8lReQQ.png" /><figcaption>The first eight composite numbers, shown to have nontrivial divisors. The examples given are one possible set of nontrivial divisors. There are others (e,g, 4 is a nontrivial divisor of 8, 6 is a nontrivial divisor of 12).</figcaption></figure><p>One thing to know is that primes are the building blocks of other numbers. We’ll get to that in a minute, but if a number is <em>composite</em><strong><em>, </em></strong>not only does it have a nontrivial divisor, but it <strong>must</strong> have a nontrivial prime divisor. You can show this using a technique called <em>mathematical induction,</em> but put simply, if you have a composite number:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/80/1*xEQSsVZpjQaYCCS94bp3ew.png" /><figcaption>Here n is composite, meaning that both 1 &lt; a &lt; n and 1 &lt; b &lt; n.</figcaption></figure><p>We only need to consider one of the divisors here for our loosey-goosey proof. Since a is a nontrivial divisor of n, that means 1 &lt; a &lt; n.</p><p>If a is prime, we’re done, and if it isn’t prime, then it has to be composite, meaning it too can be written as a factorization of smaller nontrivial divisors.</p><p>If we keep factoring these smaller and smaller numbers, eventually, we’re going to get to a prime, so we conclude that a composite number is a number that has a nontrivial <em>prime</em> divisor.</p><h3>There are Infinitely Many Prime Numbers</h3><p>Number theory isn’t something I’ve studied before outside of basic algebra courses, but I do know that there are an infinite number of primes. We can show this pretty easily. Assume that there aren’t an infinite number of primes, i.e. there is a number n such that there are only n primes. Then we can write a complete list of them:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/243/1*Sr8tpAA8m1NBwGlmvxHF3Q.png" /><figcaption>A list of primes.</figcaption></figure><p>Now consider the number:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/303/1*nxT13qtw4XvRcvsNHG3nAA.png" /><figcaption>What is this number?</figcaption></figure><p>We know that p is not a prime, because it is bigger than any of the primes in our list, so it must be composite. By my hand-waving up there where hopefully I convinced you, that means that pmust be divisible by a prime; however, no matter which of the primes on our list we try to divide p by, we get a remainder of 1, meaning that none of the primes on our list divides p. We got a contradiction, meaning that our assumption was wrong: it’s impossible for there to be a finite number of primes, so there must be an infinite number of primes.</p><h3>Unique Prime Factorizations and Prime Space</h3><p>Another fundamental theorem in number theory is that for any positive natural number, it has a unique factorization into a product of powers of primes. (Obviously, you can rearrange the order of the primes, but if you list them in strictly increasing order, then there’s only one way to do this.)</p><p>For example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/253/1*Da4GfXdyUC5Zt5s7HXslIw.png" /><figcaption>Natural numbers written as unique powers of primes</figcaption></figure><p>The missing primes just have power 0. We can fill them in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*3iZ_6U3Viyy37hZyKAH4Iw.png" /><figcaption>Filling in the missing primes with powers of 0 and making primes to the power 1 more explicit.</figcaption></figure><p>As shown, there are an infinite number of primes, so when you write them out this way, you get sequences of infinite length. Instead of writing them out like this, what if we just write them as a tuple of their powers of each prime? Then we can rewrite the above numbers like this:</p><pre>    6 -&gt; (1, 1, 0, 0, 0, 0, 0, 0, ...)<br>   12 -&gt; (2, 1, 0, 0, 0, 0, 0, 0, ...)<br>  399 -&gt; (0, 1, 0, 1, 0, 0, 0, 0, ...)<br>19404 -&gt; (3, 2, 1, 2, 1, 0, 0, 1, ...)</pre><p>(Excuse the switching between LaTeX and markdown. It’s been about 15 years since I last used LaTeX so a lot of it got rudely shoved out of my brain to make space for things like the lyrics to Baby Shark.)</p><p>These tuples are infinitely long, but let’s just consider the first position: if we consider all of the numbers that have a sequence where all the entries above the first position are 0, we get:</p><pre> 1 = (0, 0, ...)<br> 2 = (1, 0, ...)<br> 4 = (2, 0, ...)<br> 8 = (3, 0, ...)<br>16 = (4, 0, ...)<br>32 = (5, 0, ...)</pre><p>We can plot these on a one dimensional axis:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ahjNXokqBkTnX3yD-iHDEA.png" /><figcaption>Figure 1: Drawing diagrams is another thing that I’m not great at. Here is an one dimensional graph of all the numbers we can get from tuples of the form (a, 0, …).</figcaption></figure><p>We get a line with all the powers of 2 on it. Now let’s go ahead and take the second position into account, where things get slightly more interesting:</p><pre>1=(0, 0, 0, ...)   3=(0, 1, 0, ...)   9=(0, 2, 0, ...)   27=(0, 3, 0, ...)<br>2=(1, 0, 0, ...)   6=(1, 1, 0, ...)  18=(1, 2, 0, ...)   54=(1, 3, 0, ...)<br>4=(2, 0, 0, ...)  12=(2, 1, 0, ...)  36=(2, 2, 0, ...)  108=(2, 3, 0, ...)<br>8=(3, 0, 0, ...)  24=(3, 1, 0, ...)  72=(3, 2, 0, ...)  216=(3, 3, 0, ...)</pre><p>We can plot these on a plane:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cr0XKhno4bzTtflDQwk4Aw.png" /><figcaption>Figure 2: Introducing the second coordinate results in a plane where we can represent all numbers of the form 2^a * 3^b. I blame the scribbles on my cat, who suddenly developed a taste for paper.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mgrrHDbR0VvuiAKbEsnBsw.jpeg" /><figcaption>Figure 3: Not-so-innocent cat, Duncan, thwarter of mathematics and muncher of paper and much kibble… too much kibble.</figcaption></figure><p>So the first dimension represents the powers of the first prime, 2.</p><p>The second dimension represents the powers of the second prime, 3.</p><p>Naturally, the third dimension would represent the powers of the third prime, 5.</p><p>And so on and so on. But of course, we have an infinite number of dimensions here, and each one can be represented by the natural numbers that represent the powers of the prime on that dimension.</p><p>So in this infinite dimensional space, we have a correspondence between:</p><ul><li>the natural numbers (N), the <em>domain</em> of our function; and</li><li>their infinite prime representations (N x N x N x … for an infinite number of copies of N), the <em>codomain</em> of our function.</li></ul><p>Let’s name it φ (phi) because mathematicians love greek symbols, especially when it comes to certain types of maps. Mathematically, we write this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/305/1*wogslYjcv2xLYzG3KKUm5g.png" /></figure><p>This is just a fancy way of saying that, since we can write x as the unique product of all the primes, each to some power, that this just takes their powers and produces the infinite tuple:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/319/1*iaih0W_VQ3ta7WCmOTjAjg.png" /></figure><p>Now, this is called a <em>bijection</em> in math, which means that it has two properties:</p><ol><li><strong>One-to-one:</strong> if we have two elements x and y in the domain (the natural numbers), then:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/246/1*nhoeZq-SgciN0VBVfk94aw.png" /><figcaption>The property of being one-to-one, also known as being injective.</figcaption></figure><p>This follows, of course, because if two things have the same representations as prime products, then those two things have to be the same number.</p><p>2. <strong>Onto:</strong> if we have any element n in our codomain (the infinite tuples), we can find a natural number x that maps to it. If we have:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/318/1*V-iWrFfnMkZ1XnIzvSVkxA.png" /><figcaption>Take any number in our codomain.</figcaption></figure><p>then hopefully, it is obvious that:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/459/1*5K3HoxtM2-y9sjC4NZdGLw.png" /><figcaption>The property of being onto, also known as being surjective.</figcaption></figure><p>There are a lot of interesting consequences when you have a bijective map between two sets. First off, and this one should be obvious here:</p><ul><li>there is an inverse map from the codomain to the domain that is also a bijection.</li></ul><p>Secondly, and much less intuitively:</p><ul><li>both sets have the same cardinality (a measure of the size of a set)</li></ul><h3><strong>An infinity of infinities is no bigger than one infinity</strong></h3><p>Before we begin, a palate cleanser and an update. The cat is still angry at math.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pe_etA_cCiMHlemMzR7e8A.png" /><figcaption>Figure 4: While it took humans up until the fifth century CE to formalize the concept of zero, and while the cat is not very good at numbers, he knows when his bowl has zero kibbles in it. The cat is still angry. The comforter still needs washing. The partner is still not letting me forget that I ate crackers in bed yesterday while watching the People’s Court.</figcaption></figure><p>The <em>cardinality</em> of a set is a measure of the size of the set.</p><p>For a finite set, e.g:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/104/1*af6-WoVo8fjjaUXBulInGQ.png" /></figure><p>we say that the cardinality of S is 3.</p><p>When we talk about infinite sets, things get a bit more complicated, because infinity is a bit more complicated when mathematically formalized than many people understand, with a lot of unexpected, unintuitive results. (If you aren’t a mathematician or familiar with mathematical infinity, I suggest you look up the Hilbert’s Hotel if you want to scramble your brain a little bit. In fact, the prime space in this article is a way to solve one of the more complex examples of the Hilbert’s Hotel problem.)</p><p><strong>Fact:</strong> There are different sizes of infinity.</p><p><strong>Fact:</strong> The natural numbers are an example of an infinite set that have the smallest size of infinity, called <em>countable infinity</em>. The concept of countable infinity means that if I give you an infinite set, you can write the set as a list and if I ask you where one element of the set is on the list, you can tell me its exact position.</p><p><strong>Fact:</strong> Infinity is very unintuitive.</p><p><strong>Fact:</strong> The cat has been fed.</p><p>We’ll start off with a simpler result. We defined the natural numbers above. If we add the negative numbers, we get the <em>integers:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/291/1*xoUc60o2l9ojJHmwUZIB1A.png" /><figcaption>The integers. The Z notation comes from the word “Zahlen” in German, which means “numbers.”</figcaption></figure><p>It isn’t immediately obvious that the integers and the natural numbers are the same size, or more formally, have the same cardinality. Immediate intuition tells most people that Z is much bigger than N: in fact, it seems to be about <em>twice</em> as big at first glance. Some people, trying to construct a list of the integers, would list all the nonnegative numbers first, and then the negative numbers, but the problem here is that if I ask you where -1 is on that list, you can’t tell me, because there are an infinite number of numbers before -1.</p><p>We can be a bit more clever and list the elements of Z in a way that is countable. Here is our list:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/301/1*8uQk-NhkkiirU8DLjXXpdg.png" /><figcaption>Counting the integers.</figcaption></figure><p>Now if I ask you where -1 is on our list, you’d say it’s in the third position.</p><p>By alternating back and forth between the negative numbers, no matter which number I ask you for, you can tell me where it is on the list. There is no number on the list that has an infinite number of other numbers before it.</p><p>Let’s review.</p><ul><li>We showed above that there is a “prime space” with infinite dimensions, and each of the dimensions is equivalent to a copy of the natural numbers.</li><li>We showed that there is a bijection between the natural numbers and the prime space.</li></ul><p>So we can conclude that the natural numbers and the prime space have the same cardinality.</p><p><strong>Conclusion: </strong>A countable number of countable infinities is countably infinite, or in layman’s terms: provided they’re the same size of infinity, an infinite set is the same size as an infinite number of copies of that same infinite set.</p><h3>“Bigger” Infinities</h3><p>A surprising result to many when they first see it is that the size of the natural numbers and the size of the rationals, which are “the fractions,” are indeed the same. More precisely, the two sets have the same cardinality.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/224/1*VZVU5pD6seZ3xiPBK_cgTA.png" /><figcaption>The official definition of the rational numbers.</figcaption></figure><p>I won’t give you the standard way to list the numbers, but those that are curious can look it up.</p><p>Interestingly, the real numbers, denoted :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/14/1*g7tQrLoVimEUzqMsnXrgqg.png" /><figcaption>The real numbers: they contain all the goodness of the integers, the rational numbers, and the decimals like √2 and π.</figcaption></figure><p>are <em>not</em> countably infinite in size. In fact, they are a bigger size of countable infinity: they are uncountably infinite, or more precisely, a <em>continuum</em>. There’s an easy proof called Cantor’s Diagonalization Argument that shows that no matter what order you try to use to list the real numbers, you can find a number that will not be on your list.</p><p>In fact, there are more real numbers between 0 and 1 than there in all the natural numbers, the integers, and the rational numbers, and there’s no reason you need the gap to be that big. As long as you have two distinct rational numbers:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/225/1*bIueH_-w3TI036Oyjk8XSA.png" /><figcaption>Pick your two favorite distinct real numbers and the number of elements between them are still bigger than N, Z, and Q.</figcaption></figure><p>So, even if we pick 0.0000000000000001 and 0.0000000000000002, the number of real numbers between those two are bigger than N, Z, and Q.</p><p>It’s late here, so part (2) will be coming tomorrow.</p><ul><li>The continuum hypothesis?</li><li>Greatest common divisors and irreducible rationals (aka fourth grade revision, but stated in a way as to sound fancy, like putting a toothpick in some stacked cheese-adjacent slices and cocktail weenies).</li><li>Group theory! Homomorphisms! Isomorphisms! All totally SFW. The cat promises.</li><li>More on units, and the rationals Q contain no primes?!</li><li>Extensions of the prime space to the positive rationals, then the non-zero rationals.</li><li>…finally culminating in a group isomorphism between an extension to the extended prime space and Q*, the multiplicative group of the rationals.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=365fd608e810" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>