<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Maths on frankhecker.com</title>
    <link>https://frankhecker.com/tags/maths/</link>
    <description>Recent content in Maths on frankhecker.com</description>
    <image>
      <title>frankhecker.com</title>
      <url>https://frankhecker.com/%3Clink%20or%20path%20of%20image%20for%20opengraph,%20twitter-cards%3E</url>
      <link>https://frankhecker.com/%3Clink%20or%20path%20of%20image%20for%20opengraph,%20twitter-cards%3E</link>
    </image>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Sun, 12 Feb 2023 15:46:27 +0000</lastBuildDate>
    <atom:link href="https://frankhecker.com/tags/maths/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Logarithms are just orders of magnitude with a glow up, part 2</title>
      <link>https://frankhecker.com/2023/02/12/logarithms-are-just-orders-of-magnitude-with-a-glow-up-part-2/</link>
      <pubDate>Sun, 12 Feb 2023 15:46:27 +0000</pubDate>
      <guid>https://frankhecker.com/2023/02/12/logarithms-are-just-orders-of-magnitude-with-a-glow-up-part-2/</guid>
      <description>I continue to try to explain logarithms to myself.</description>
      <content:encoded><![CDATA[<p>[This post was originally published on <a href="http://web.archive.org/web/20241113190243/https://cohost.org/hecker/post/1001100-logarithms-are-just">Cohost</a>.]</p>
<p>This post continues the discussion from <a href="/2023/02/11/logarithms-are-just-orders-of-magnitude-with-a-glow-up-part-1/">part 1</a>, in which I attempt to explain the concept of logarithms to myself, in the guise of explaining it to a novice. As before, this is primarily for my entertainment and edification; other people will either not need the explanation or can find better ones elsewhere.</p>
<p>(You’re still reading this?! OK, I guess I can’t stop you, but don’t say you weren’t warned.)</p>
<h3 id="notations">Notations</h3>
<p>So far I’ve discussed orders of magnitude, including negative and fractional orders of magnitude, and defined a logarithm of a number as the (possibly negative and/or fractional) order of magnitude corresponding to that number. Now it’s time to simplify the discussion by introducing some basic mathematical notation.<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup></p>
<p>Using mathematical notation tends to freak some people out, because they see it as an entirely separate language which they don’t and can’t understand — like staring at text in Japanese if you don’t know any of the characters. But it’s better thought of as simply a shorthand way to express things that would take longer and be more cumbersome to express in conventional prose. Thus, for example, it’s easier to write 2 + 3 = 5 than it is to write “two plus three equals five,” and easier to write 10×10×10×10 or 10⋅10⋅10⋅10 (my preferred notation) than “ten times ten times ten times ten.”</p>
<p>With that in mind, let’s introduce the following notation: We represent a one order of magnitude increase as being multiplied by 10<sup>1</sup>
 = 10, a two order of magnitude increase as being multiplied by 10<sup>2</sup>
 = 10⋅10 = 100, a three order of magnitude increase as being multiplied by 10<sup>3</sup>
 = 10⋅10⋅10 = 1,000, and so on. By convention we have 10<sup>0</sup>
 = 1, i.e., a “zero order of magnitude” change or no change at all, as discussed previously.</p>
<p>Note that this notation makes it simple to see the effects of multiple increases by various orders of magnitude, using the addition rule discussed previously. For example, an increase of two orders of magnitude followed by an increase of three orders of magnitude is represented as multiplying by 10<sup>2</sup>
⋅10<sup>3</sup>
 = 10<sup>2&#43;3</sup>
 = 10<sup>5</sup>
, or an increase by a factor of 10⋅10⋅10⋅10⋅10 = 100,000.</p>
<p>What about a one order of magnitude decrease? We represent that as being multiplied by 10<sup>-1</sup>
 = 1/10 = 0.1. Similarly, a two order of magnitude decrease is represented as being multiplied by 10<sup>-2</sup>
 = 1/(10⋅10) = 1/100 = 0.01, a three order of magnitude decrease as being multiplied by 10<sup>-3</sup>
 = 1/(10⋅10⋅10) = 1/1,000 = 0.001, and so on.</p>
<p>Again the effects of combined increases and decreases by various orders of magnitude can be found using the addition rule discussed previously. For example, an increase of two orders of magnitude followed by an <em>decrease</em> of three orders of magnitude is represented as multiplying by 10<sup>2</sup>
⋅10<sup>-3</sup>
 = 10<sup>2-3</sup>
 = 10<sup>-1</sup>
, or an overall decrease by a factor of 10.</p>
<p>As a  side note, an increase by, say, two orders of magnitude followed by a decrease by two orders of magnitude is represented as 10<sup>2</sup>
⋅10<sup>-2</sup>
 = 10<sup>2-2</sup>
 = 10<sup>0</sup>
. We previously adopted the convention 10<sup>0</sup>
 = 1, and we see now that that makes sense, since in this case there was no overall change.</p>
<p>We also have 10<sup>-2</sup>
 = 1/100 = 1/(10<sup>2</sup>
). So a negative value for orders of magnitude (i.e., decreasing by one or more orders of magnitude) converts multiplication into division, as we’ve discussed previously. We also have 1/(10<sup>-2</sup>
) = 1/(1/100) = 100 = 10<sup>2</sup>
, by symmetry.</p>
<p>What about fractional orders of magnitude? We can represent an increase by half an order of magnitude as being multiplied by 10<sup>1/2</sup>
 = 3.1623 (approximately). Again the addition rule for orders of magnitude can be used: an increase by half an order of magnitude followed by another increase by half an order of magnitude is represented as being multiplied by 10<sup>1/2</sup>
 ⋅ 10<sup>1/2</sup>
 = 10<sup>1/2 &#43; 1/2</sup>
 = 10<sup>1</sup>
 = 10, as we would expect from the previous discussion.</p>
<p>Finally, how do we represent the logarithm of a number? We use the word “log,” of course: log(10<sup>3</sup>
) = 3, for example. Often the parentheses are omitted: log 10<sup>-1</sup>
 = -1.</p>
<h3 id="multiplication-by-addition">Multiplication by addition</h3>
<p>Now let’s talk about something that was very important historically but is almost a curiosity now. Suppose you don’t have access to a computer, a calculator, or even an abacus. How can you do calculations like multiplying larger numbers, like 16 times 126, without resorting to pen and paper?</p>
<p>Let’s go back to the examples of fractional orders of magnitude I used previously, that multiplying by a factor of 16 corresponds to an approximately 1.2 order of magnitude increase, and 126 corresponds to an approximately 2.1 order of magnitude increase. In our new notation we have 16 = 10<sup>1.2</sup>
 and 126 = 10<sup>2.1</sup>
. Alternately, 1.2 = log(16) and 2.1 = log(126), using the notation for logarithms.</p>
<p>Let’s also get better values for the logarithms of 16 and 126. Fortunately, way back in 1624 someone compiled a <a href="https://www.math.ksu.edu/~cjbalm/570s14/briggs.pdf">table of logarithms of numbers from 1 to 20,000 and from 90,001 to 100,000</a>; on page 35 we find that the logarithm of 16 is 1.2041 (to four digits) and on page 36 we find that the logarithm of 126 is 2.1004 (also to four digits).<sup id="fnref:2"><a href="#fn:2" class="footnote-ref" role="doc-noteref">2</a></sup></p>
<p>Using our new notation we then have 16⋅126 = 10<sup>1.2041</sup>
⋅10<sup>2.1004</sup>
. But by our rule of adding orders of magnitude we have 10<sup>1.2041</sup>
⋅10<sup>2.1004</sup>
 = 10<sup>1.2041&#43;2.1004</sup>
 = 10<sup>3.3045</sup>
.</p>
<p>So we are looking for a number X = 10<sup>3.3045</sup>
; this is equivalent to writing log(X) = 3.3045. We can look in the same table we used before to find a number whose logarithm is 3.3045, and on page 55 we find that that number is 2016. This is the value we are looking for, the number corresponding to 16 times 126.</p>
<p>Of course, it would be tedious to carry around a large book just to do multiplication. The solution was the <a href="https://en.wikipedia.org/wiki/Slide_rule">slide rule</a>. The following is a gross simplification of how it might work:</p>
<p>We have two straight rules made of wood, plastic, or metal, each with numbers marked on it, increasing left to right from one end to the other. For example, on one rule the number 16 is marked at a distance of 1.2 cm from the left end of the rule, and the number 2016 marked 3.3 cm from the left end. On the second rule the number 126 is marked at a distance 2.1 cm from the left end of that rule. In other words, in all three cases the distances in cm from the left end of the rule are the logarithms of the numbers in question.</p>
<p>If we line up the left end of the second rule with the number 16 on the first rule (i.e., 1.2 cm to the right of the left end of the first rule), on the second rule the number 126 will line up opposite the number 2016 on the first rule (since 1.2 cm + 2.1 cm = 3.3 cm). Thus we’ve found the result of the multiplication 16 times 126.</p>
<p>Of course, for such a rule to be useful it would need to have all numbers marked on it, and at the size mentioned would be too small to be useful. Actual slide rules used for multiplication contain only the numbers from 1 though 10, since any multiplication with larger numbers can be done by fiddling with the decimal places. For example, we have 16⋅126 = (1.6⋅10)⋅(1.26⋅100) = (1.6⋅1.26)⋅(10⋅100) = (1.6⋅1.26)⋅1,000. So we really only need to multiply 1.6 times 1.26, and then multiply the resulting value by 1,000.</p>
<p>This concludes the second post. I may or may not make more posts in this series.</p>
<div class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1">
<p>Since Cohost didn’t support using LaTeX, the most common way to include mathematical symbols and equations in a plain text editor, I faked it using Unicode and HTML.&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:2">
<p>The original book, <em><a href="https://www.google.com/books/edition/Arithmetica_logarithmica/mS5CUWOuuiYC?hl=en">Arithmetica logarithmica</a></em> by Henry Briggs, was in Latin. I’m using a modern reconstruction of its tables.&#160;<a href="#fnref:2" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</div>
]]></content:encoded>
    </item>
    <item>
      <title>Logarithms are just orders of magnitude with a glow up, part 1</title>
      <link>https://frankhecker.com/2023/02/11/logarithms-are-just-orders-of-magnitude-with-a-glow-up-part-1/</link>
      <pubDate>Sat, 11 Feb 2023 03:29:12 +0000</pubDate>
      <guid>https://frankhecker.com/2023/02/11/logarithms-are-just-orders-of-magnitude-with-a-glow-up-part-1/</guid>
      <description>I try to explain to myself how logarithms work.</description>
      <content:encoded><![CDATA[<p>[This post was originally published on <a href="http://web.archive.org/web/20241227032639/https://cohost.org/hecker/post/994543-logarithms-are-just">Cohost</a>.]</p>
<p>I get nervous when I write about something I don’t totally understand. As a result, I sometimes resort to writing down an explanation of that something to myself, in an effort to understand it better. While writing an upcoming post I realized that I wasn’t doing a good job of explaining what a log-normal distribution was, and in particular needed a better understanding of what a logarithm was.</p>
<p>This post is my attempt to explain the concept of logarithms to myself, which I do in my usual way by writing as if I’m explaining it to someone else with no background in the subject. If you’re already familiar with the concept of logarithms then you can skip this, and if you’re not then you can find better explanations elsewhere. In other words, nobody should read this post except me.</p>
<p>(Is everyone else gone? OK, here goes&hellip;)</p>
<h3 id="orders-of-magnitude">Orders of magnitude</h3>
<p>I think the best place to start to understand logarithms may be with the concept of “orders of magnitude,” a concept people use all the time. For example, consider the statement “there are an order of magnitude more users of Facebook than of Twitter, and two orders of magnitude more users of Twitter than of Mastodon.” Here an “order of magnitude more” means “about 10 times more,” and “two orders of magnitude more” means “about 100 times more.”<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup></p>
<p>The first thing to note is that orders of magnitude can add together: If Twitter has two orders of magnitude more users than Mastodon, and Facebook has an order of magnitude more users than Twitter, then Facebook has three orders of magnitude more users than Mastodon (2 + 1 = 3).</p>
<p>Let’s drop the “about” and for this discussion assume that “an order of magnitude more” means “<em>exactly</em> 10 times more.” Then “two orders of magnitude more” would mean (exactly) 100 times more, “three orders of magnitude more” would mean (exactly) 1,000 times more, and so on.</p>
<h3 id="adding-and-subtracting-orders-of-magnitude">Adding and subtracting orders of magnitude</h3>
<p>But we also have 100 = 10 times 10, and 1,000 = 10 times 100 = 10 times 10 times 10. So an order of magnitude increase means the original amount was multiplied by 10, a two orders of magnitude increase means the original amount was multiplied by 10 and then by 10 again (i.e., by 100), and a three orders of magnitude increase means the original amount was multiplied by 10 and then by 10 again and then by 10 once more (i.e., by 1,000).</p>
<p>In other words, the number of orders of magnitude by which the original amount was increased is the number of times you multiply by 10. If you do successive increases first by, say, two orders of magnitude, and then by three orders of magnitude, the resulting amount corresponds to an increase by five orders of magnitude, or 2 + 3.</p>
<p>Now let’s consider the case where something is an order of magnitude <em>less</em> than something else. For example, when we say “Twitter has an order of magnitude fewer users than Facebook,” we typically mean “Twitter has about one tenth the number of users of Facebook,” and when we say “Mastodon has two orders of magnitude fewer users than Twitter,” we typically mean “Mastodon has about one hundredth the number of users of Twitter.”</p>
<p>Again, let’s be exact about this. Then an order of magnitude <em>decrease</em> means the original amount was divided by 10, a two orders of magnitude decrease means the original amount was divided by 10 and then by 10 again (i.e., by 100), a three orders of magnitude increase means the original amount was divided by 10 and then by 10 again and then by 10 once more (i.e., by 1,000). In other words, the number of orders of magnitude by which the original amount was decreased is the number of times you divide by 10.</p>
<p>What about an increase followed by a decrease? Let’s suppose the number of Twitter users increases by five orders of magnitude over a period of years, and then it decreases by two orders of magnitude within a year. That means that the original amount first got multiplied by 10 five times (10 times 10 times 10 times 10 times 10, or 100,000), and then the resulting amount got divided by 10 twice (i.e., by 10 times 10 or 100). The final amount is 1,000 times the initial amount, corresponding to an overall three orders of magnitude increase. We have 3 = 5 - 2, so another way to get the final amount is to <em>add</em> the number of orders of magnitude by which the number of users increased, and then <em>subtract</em> the number of orders of magnitude by which it decreased.</p>
<p>What if something increases by (say) three orders of magnitude and subsequently decreases by three orders of magnitude; in other words it gets multiplied by 10 three times (i.e., by 1,000) and then gets divided by 10 three times (again, by 1,000). The net effect is to return to where it started. But using our rule above, an increase by three orders of magnitude followed by a decrease by three orders of magnitude nets out to an overall increase of 3 - 3 or 0 orders of magnitude. So we can equate “0 orders of magnitude” to mean “no change” or (what’s the same thing) “multiplied by 1.”</p>
<h3 id="fractional-orders-of-magnitude">Fractional orders of magnitude</h3>
<p>Here’s an interesting question: What does it mean (if it means anything at all) to say that something increased by half an order of magnitude? If something increases by half an order of magnitude, and then increases by another half order of magnitude, then overall it’s natural to say that overall there was an increase by one order of magnitude. After all, we’ve been using a rule that you add orders of magnitude when doing a first increase by a certain number of orders of magnitude followed by a second increase by another number of orders of magnitude. And one half plus one half equals one.</p>
<p>Since an increase of one order of magnitude is equivalent to multiplying by 10, an increase of one half an order of magnitude is equivalent to multiplying by some number X, such that multiplying by X and then multiplying by X again is the same as multiplying by 10. In other words, we should have X times X equal to 10.</p>
<p>Does such a number exist and, if so, how could we find it? Well, we know that 3 times 3 is 9, and 4 times 4 is 16, so X should be somewhere between 3 and 4. If we try 3.5 times 3.5, that comes out to 12.25, which is too high. Trying a smaller number, 3.2 times 3.2 is 10.24, which is still too high, but closer. 3.1 times 3.1 is 9.61, which is too low. So X should be somewhere between 3.1 and 3.2. We have 3.15 times 3.15 equal to 9.925, again too low, and 3.17 times 3.17 equal to 10.0489, again too high, but getting very close. If you do this exercise a couple more times on your phone’s calculator app you will find that 3.1623 times 3.1623 is almost exactly equal to 10. So we can say that an increase of half an order of magnitude corresponds to multiplying the original amount by (a number very close to) 3.1623.<sup id="fnref:2"><a href="#fn:2" class="footnote-ref" role="doc-noteref">2</a></sup></p>
<p>Similarly, we can imagine a third of an order of magnitude increase as corresponding to a number Y such that multiplying an initial amount by Y three times produces an order of magnitude increase. In other words, Y times Y times Y is equal to 10. We have 2 times 2 times 2 equal to 8, and 3 times 3  times 3 equal to 27. So Y must be a number between 2 and 3, and is probably closer to 2. Trying numbers out like was done above, we end up with 2.154 times 2.154 times 2.154 being almost exactly equal to 10.</p>
<p>What about an increase of tenth of an order of magnitude? This would correspond to a number Z such that multiplying an initial amount by Z ten times produces an order of magnitude increase. In other words, Z times Z times Z times Z time Z times Z times Z times Z times Z times Z is equal to 10. A little thought will convince one that Z must be between 1 and 2, and likely closer to 1. Using the same techniques as above, we end up with 1.2589 as a number that when multiplied by itself ten times is (almost exactly) equal to 10.</p>
<h3 id="from-orders-of-magnitude-to-logarithms">From orders of magnitude to logarithms</h3>
<p>Continuing from the discussion in the previous section, what does it mean to have an increase of, say, 2.3 orders of magnitude? If we follow the rule of adding orders of magnitude, we see that 2.3 is 2 plus 1/10 plus 1/10 plus 1/10, and conclude that an increase of 2.3 orders of magnitude corresponds to first multiplying by 100 (two orders of magnitude), then multiplying by (approximately) 1.2589 (one tenth of an order of magnitude), then multiplying by 1.2589 again, and then multiplying by 1.2589 once more. We have 100 times 1.2589 times 1.2589 times 1.2589 equal to (approximately) 199.5141. So a 2.3 order of magnitude increase corresponds to an increase by a factor of approximately 200.</p>
<p>We can then turn this around and say that multiplying by a factor of 200 corresponds to a 2.3 order of magnitude increase. We can do something similar for other numbers. For example, what order of magnitude increase corresponds to multiplying by a factor of 16? Multiplying by a factor of 10 corresponds to one order of magnitude, and multiplying by a factor of 100 corresponds to two orders of magnitude, so multiplying by 16 must correspond to an order of magnitude between 1 and 2.</p>
<p>Based on the discussion above, a 1.1 order of magnitude increase corresponds to multiplying by 10 (one order of magnitude) and then by 1.2589 (one tenth of an order of magnitude), or 10 times 1.2589, equal to 12.5889. This is less than 16, so the order of magnitude corresponding to multiplying by a factor of 16 is more than 1.1. What about an order of magnitude increase of 1.2? That corresponds to multiplying by 10 times 1.2589 times 1.2589, or 15.8483.  This is very close to 16, so the order of magnitude increase corresponding to a factor of 16 is likely just a bit more than 1.2. (The actual number is approximately 1.2041.)</p>
<p>We can do similar calculations for other numbers. For example, multiplying by a factor of 126 corresponds to an approximately 2.1 order of magnitude increase, multiplying by 2,500 corresponds to an approximately 3.4 order of magnitude increase, and so on.</p>
<p>We can now say what a logarithm is: <em>the logarithm of a number is the order of magnitude increase corresponding to multiplying by that number</em>.<sup id="fnref:3"><a href="#fn:3" class="footnote-ref" role="doc-noteref">3</a></sup> Thus the logarithm of 10 is 1 (one order of magnitude increase), the logarithm of 16 is approximately 1.2 (1.2 orders of magnitude increase), the logarithm of 100 is 2, the logarithm of 126 is approximately 2.1, the logarithm of 1,000 is 3, the logarithm of 2,500 is approximately 3.4, and so on.</p>
<h3 id="negative-and-zero-logarithm-values">Negative (and zero) logarithm values</h3>
<p>What about decreases by some orders of magnitude? They correspond to negative values of the logarithm. A decrease by one order of magnitude corresponds to dividing by 10, and an increase of three orders of magnitude followed by a decrease of one order of magnitude amounts to an overall increase by 3 - 1 = 2 orders of magnitude, according to the rule of adding and subtracting orders of magnitude discussed above. Since dividing by 10 is equivalent to multiplying by one tenth or 0.1, the logarithm of 0.1 is -1. Similarly, the logarithm of one hundredth or 0.01 is -2, the logarithm of one thousandth or 0.001 is -3, and so on.</p>
<p>Also, above we concluded that a “0 orders of magnitude” increase means “no change” or “multiplied by 1.” So the logarithm of 1 is 0.</p>
<p>There is no order of magnitude increase corresponding to multiplying by 0, and no order of magnitude decrease corresponding to dividing by 0 (which isn’t even defined). So the logarithm of 0 is undefined.</p>
<p>There is also no order of magnitude increase corresponding to multiplying by a number less than zero (like -1), and no order of magnitude decrease corresponding to dividing by a number less than zero. So the logarithm is also undefined for numbers less than zero (“negative numbers”).<sup id="fnref:4"><a href="#fn:4" class="footnote-ref" role="doc-noteref">4</a></sup></p>
<p>The logarithm as we have defined it is thus defined only for numbers greater than zero (“positive numbers”). For numbers greater than one the logarithm is greater than zero, for numbers between 0 and 1 the logarithm is less than zero, and for the number 1 the logarithm is exactly zero.</p>
<p>This is getting pretty long, so I’ll continue the discussion in <a href="/2023/02/12/logarithms-are-just-orders-of-magnitude-with-a-glow-up-part-2/">part 2</a>.</p>
<div class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1">
<p>For the record, <a href="https://www.statista.com/statistics/264810/number-of-monthly-active-facebook-users-worldwide/">Facebook has 3 billion users worldwide</a> and <a href="https://www.statista.com/statistics/303681/twitter-users-worldwide/">Twitter over 300 million</a>, so the “about ten times more” works out in that case. The number of users of Mastodon <a href="https://absolutelymaybe.plos.org/2022/12/05/mastodon-growth-numbers-might-not-mean-what-you-think-they-mean/">depends on how you count them</a>, but the number 2.5 million has been thrown around&mdash;close enough to 3 million, and thus 100 times less than Twitter.&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:2">
<p>If you have a calculator app on your phone that has a “scientific calculator” mode then you can compute this more exactly by entering the number 10 and then pressing the so-called “square root” key, which should look something like √. On my phone’s calculator app the resulting value is 3.162277660168379&mdash;but note that this is still just an approximation.&#160;<a href="#fnref:2" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:3">
<p>Strictly speaking, this is the so-called logarithm for base 10.&#160;<a href="#fnref:3" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:4">
<p>It’s possible to define the logarithm of a negative number by allowing the value to be a so-called “complex” number, but that’s beyond the scope of this discussion.&#160;<a href="#fnref:4" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</div>
]]></content:encoded>
    </item>
  </channel>
</rss>
