{"id":15840,"date":"2019-05-17T20:40:24","date_gmt":"2019-05-18T00:40:24","guid":{"rendered":"http:\/\/advancedmathyoungstudents.com\/blog\/?p=15840"},"modified":"2019-05-18T16:49:06","modified_gmt":"2019-05-18T20:49:06","slug":"logarithms-as-digit-counters-in-any-base","status":"publish","type":"post","link":"https:\/\/advancedmathyoungstudents.com\/blog\/?p=15840","title":{"rendered":"Logarithms as Digit-Counters in ANY base!"},"content":{"rendered":"\n<p>File this under \u201cmath I should have realized\u201d.<\/p>\n\n\n\n<p>Even after all these years, I still find logarithms to be challenging, compelling, and <em>surprising<\/em>.\u00a0 This post is about an idea that snuck up on me this morning.  And it snuck up even though:<\/p>\n\n\n\n<ul><li>I have written: <strong>Log<sub>2<\/sub> 8 = 3 because 2<sup>3<\/sup> = 8 <\/strong>on many whiteboards and many review sheets.&nbsp; <\/li><li>I have learned (and taught!) the classic collection of assorted log properties<\/li><li>I have read David Mermin\u2019s lovely piece \u201cLogarithms!\u201d (and blogged about it <a href=\"http:\/\/another-look-at-logarithms\">h<\/a><a href=\"http:\/\/advancedmathyoungstudents.com\/blog\/2015\/06\/05\/another-look-at-logarithms\/\">ere.<\/a>)<\/li><li>I have written a chapter on exponential functions and logarithms in \u201c<a href=\"https:\/\/www.amazon.com\/Advanced-Math-Young-Students-Algebra\/dp\/1502817330\/\">Advanced Math for Young Students<\/a>\u201d.<\/li><\/ul>\n\n\n\n<p>And yet, there is a basic idea about logarithms that I  never really thought about (until this morning).&nbsp; So here it is: <\/p>\n\n\n\n<p><strong><em>The integer part of the logarithm of an integer is one less than the number of digits the integer has when it is represented in the same base as the logarithm itself. <\/em><\/strong><\/p>\n\n\n\n<p> You could write: <\/p>\n\n\n\n<p><strong><em>Floor[Log<sub>b<\/sub> &nbsp;N] <\/em><\/strong><strong><em>+ 1 = the number of N&#8217;s digits when N is  represented in base b.<\/em><\/strong><\/p>\n\n\n\n<p>In other words, the logarithm counts the digits &#8212; and not just in base-10. You just have to round down and add 1.&nbsp; I would like to explain this, if for no other reason than to convince myself that it is true!&nbsp; <\/p>\n\n\n\n<p><strong><em>Starting with base 10:<\/em><\/strong><\/p>\n\n\n\n<p>Let\u2019s look at some common (base 10) logarithms that we can\nfind without a calculator:<\/p>\n\n\n\n<p>Log 1 = 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \u2026because\n10<sup>0<\/sup> = 1<\/p>\n\n\n\n<p>Log 10 = 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \u2026because\n10<sup>1<\/sup> = 10<\/p>\n\n\n\n<p>Log 100 = 2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \u2026because\n10<sup>2<\/sup> = 100<\/p>\n\n\n\n<p>Log 1000 = 3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \u2026because\n10<sup>3<\/sup> = 1000<\/p>\n\n\n\n<p>Log 10000 = 4&nbsp;&nbsp;&nbsp;&nbsp; \u2026because\n10<sup>4<\/sup> = 10000<\/p>\n\n\n\n<p>I think you get the idea.&nbsp; If we construct a number, say N, by writing a 1 followed by k zeroes, then the common (base 10) logarithm, log N = k.&nbsp; And the number will have k + 1 digits: the k zeroes and the 1 in front of them. So for each of these, adding 1 to the common logarithm gives you the number of digits.<\/p>\n\n\n\n<p>Now let\u2019s look at one that you do need a calculator for.\nI\u2019ll report three decimal places:<\/p>\n\n\n\n<p>Log 375 = 2.574\u00a0\u00a0 \u2026because 10<sup>2.574<\/sup> = 374.973 \u2248 375<\/p>\n\n\n\n<p>And it makes sense: 375 is more than 100 so its common logarithm is greater than 2.&nbsp; But 375 is also less than 1000 so its common logarithm is less than 3.&nbsp; It is more than the smallest 3 digit number and less than the smallest 4 digit number.&nbsp; &nbsp;&nbsp;And if you take the common logarithm, which was 2.574, round it down and then add 1, you get the number of digits.&nbsp; Nice.<\/p>\n\n\n\n<p>Let\u2019s try another (again reporting 3 decimal places): <\/p>\n\n\n\n<p>Log (8787) = 3.944 \u00a0 \u2026 because 10<sup>3.944<\/sup> \u00a0\u2248 8787 (though with a little more round-off error, but still\u2026)<\/p>\n\n\n\n<p>And this makes sense too: 8787 is more than 1000 so its\ncommon log is greater than 3.&nbsp; But it is\nless than 10000 so its common log is less than 4.&nbsp; In fact, it is closer to 10000 so its log is\nclose to 4, but still less.&nbsp; And if we\nround down 3.944 and add 1, again we get the number of digits in the number we\nstarted with.<\/p>\n\n\n\n<p>OK, I admit that I kind-of knew that already.&nbsp; But for some reason, this next step caught me by surprise\u2026let&#8217;s move away from base 10 and see what happens.<\/p>\n\n\n\n<p><strong><em>Other bases and other logarithms<\/em><\/strong><\/p>\n\n\n\n<p>On and off this year, I have been playing with James Tanton\u2019s invention, \u201cExploding Dots\u201d.&nbsp; If you have not yet seen this, you really should take a look.&nbsp; You can get started <a href=\"https:\/\/www.explodingdots.org\/\">here<\/a>. But really, Google it \u2013 those dots are not just exploding, they are proliferating!<\/p>\n\n\n\n<p>One thing that Exploding Dots teaches you almost immediately and organically is how to express numbers in other bases.&nbsp; And something interesting happens when you look at the base 2 logarithms as you look at the base 2 representations\u2026<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" loading=\"lazy\" width=\"785\" height=\"183\" src=\"http:\/\/advancedmathyoungstudents.com\/blog\/wp-content\/uploads\/2019\/05\/base2.png\" alt=\"\" class=\"wp-image-15850\" srcset=\"https:\/\/advancedmathyoungstudents.com\/blog\/wp-content\/uploads\/2019\/05\/base2.png 785w, https:\/\/advancedmathyoungstudents.com\/blog\/wp-content\/uploads\/2019\/05\/base2-300x70.png 300w, https:\/\/advancedmathyoungstudents.com\/blog\/wp-content\/uploads\/2019\/05\/base2-768x179.png 768w, https:\/\/advancedmathyoungstudents.com\/blog\/wp-content\/uploads\/2019\/05\/base2-500x117.png 500w\" sizes=\"(max-width: 785px) 100vw, 785px\" \/><\/figure>\n\n\n\n<p>&nbsp;So if a number N\nhappens to be an integer power of 2, say 2<em><sup>k<\/sup><\/em>,\nthen we know two things:<\/p>\n\n\n\n<p>1. Its base-2 logarithm, log<sub>2<\/sub> N = k<\/p>\n\n\n\n<p>2. Its base-2 representation will consist\nof k zeroes and a leading 1.&nbsp; And that\nmakes k + 1 digits.<\/p>\n\n\n\n<p>Now let\u2019s get some help from a\ncalculator.<\/p>\n\n\n\n<p>Log<sub>2<\/sub> 5 = 2.322 \u2026because 2<sup>2.322<\/sup> \u00a0\u2248 5<\/p>\n\n\n\n<p>Does it make sense? Well, since 5 is more\nthan 4, we expect its base-2 logarithm to be more than 2.&nbsp; But 5 is less than 8, so we expect its base-2\nlogarithm to be less than 3.&nbsp; So this\nlooks right.<\/p>\n\n\n\n<p>But we are not done! If we explode some dots, we can find the base 2 representation.<\/p>\n\n\n\n<p>5 = 1 0 1 and that makes 3 digits \u2013 which\nis also what we get when we round down the base-2 logarithm and then add\n1!&nbsp; <\/p>\n\n\n\n<p>OK, let\u2019s check a big number:<\/p>\n\n\n\n<p>500 expressed in base 2 is 1 1 1 1 0 1 0\n0 (which you might want to check\u2026)<\/p>\n\n\n\n<p>I see 9 digits.<\/p>\n\n\n\n<p>Log<sub>2<\/sub> 500 = 8.966 (and yes, it\nchecks out: 2<sup>8.966 <\/sup>&nbsp;\u2248 500)<\/p>\n\n\n\n<p>Round it down and add 1\u2026YES!<\/p>\n\n\n\n<p><strong><em>So if you want to know the number of digits in the base-b\nrepresentation of a number, find the base-b logarithm, round it down to its\nfloor and then add one.&nbsp; The logarithm is\nthe digit counter!<\/em><\/strong><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>File this under \u201cmath I should have realized\u201d. Even after all these years, I still find logarithms to be challenging, compelling, and surprising.\u00a0 This post is about an idea that snuck up on me this morning. And it snuck up &hellip; <a href=\"https:\/\/advancedmathyoungstudents.com\/blog\/?p=15840\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false},"categories":[1],"tags":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4uvY7-47u","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/advancedmathyoungstudents.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/15840"}],"collection":[{"href":"https:\/\/advancedmathyoungstudents.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/advancedmathyoungstudents.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/advancedmathyoungstudents.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/advancedmathyoungstudents.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=15840"}],"version-history":[{"count":11,"href":"https:\/\/advancedmathyoungstudents.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/15840\/revisions"}],"predecessor-version":[{"id":15853,"href":"https:\/\/advancedmathyoungstudents.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/15840\/revisions\/15853"}],"wp:attachment":[{"href":"https:\/\/advancedmathyoungstudents.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=15840"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/advancedmathyoungstudents.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=15840"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/advancedmathyoungstudents.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=15840"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}