{"id":376,"date":"2007-04-09T08:05:00","date_gmt":"2007-04-09T08:05:00","guid":{"rendered":"http:\/\/scientopia.org\/blogs\/goodmath\/2007\/04\/09\/sign-expanded-surreal-numbers\/"},"modified":"2007-04-09T08:05:00","modified_gmt":"2007-04-09T08:05:00","slug":"sign-expanded-surreal-numbers","status":"publish","type":"post","link":"http:\/\/www.goodmath.org\/blog\/2007\/04\/09\/sign-expanded-surreal-numbers\/","title":{"rendered":"Sign-Expanded Surreal Numbers"},"content":{"rendered":"<p> In addition to the classic {L|R} version of the surreal numbers, you can also describe surreals using something called a <em>sign expansion<\/em>, where they&#8217;re written as a sequence of &#8220;+&#8221;s and &#8220;-&#8220;s &#8211; a sort of binary representation of surreal numbers. It&#8217;s fully equivalent to the {L|R} construction, but built in a different way. This is a really cool, if somewhat difficult to grasp, construction.<\/p>\n<p><!--more--><\/p>\n<p> It&#8217;s based on ordinals (which we also called <em>birthdays<\/em>)  Remember, ordinals are the numbered <em>generations<\/em> of surreal numbers. Ordinal 0 contains the value 0; ordinal one adds the values +1 and -1; ordinal two adds +1\/2, -1\/2, +2, and -2. And so on.<\/p>\n<p> For each ordinal <em>x<\/em>, we can define three sets of numbers:<\/p>\n<ol>\n<li> The Made numbers, M<sub>x<\/sub>: the numbers that have been created by<br \/>\nordinal <em>x<\/em>.<\/li>\n<li> The New numbers, N<sub>x<\/sub>: the numbers that were <em>created<\/em> in ordinal<br \/>\n<em>x<\/em>.<\/li>\n<li> The Old numbers, O<sub>x<\/sub>: the numbers that were created <em>before<\/em><br \/>\n<em>x<\/em>, in earlier ordinals.<\/li>\n<\/ol>\n<p> Now, pick a number a, created in ordinal X. For each ordinal i starting at ordinal 0, pick the number A<sub>i<\/sub> which is the <em>closest<\/em> value to <em>a<\/em> which is<br \/>\npart of N<sub>i<\/sub>. If A<sub>i<\/sub>&lt;a, then the <em>i<\/em>th position of<br \/>\nthe sign-expansion form of a is &#8220;+&#8221;; if A<sub>i<\/sub>&gt;a, then the <em>i<\/em>th position of the sign-expansion form of a is &#8220;-&#8220;.<\/p>\n<p> Let&#8217;s take a simple example: 3 1\/2.<\/p>\n<ol>\n<li> Ordinal 0 contains only the number 0, so A<sub>0<\/sub>=0. 0&lt;3 1\/2, so<br \/>\nthe 0th position is &#8220;+&#8221;.<\/li>\n<li> In Ordinal 1, the closest new value to 3 1\/2 is +1, so A<sub>1<\/sub>=1. 1&lt;3 1\/2, so<br \/>\nthe 1th position is &#8220;+&#8221;; so the sign expansion so far is &#8220;++&#8221;.<\/p>\n<li> In ordinal 2, the closest new number is 2, so A<sub>2<\/sub>=2, so the sign<br \/>\nexpansion so far is &#8220;+++&#8221;.<\/li>\n<li> In ordinal 3, the closest new number is 3, so A<sub>3<\/sub>=3, so the sign<br \/>\nexpansion so far is &#8220;++++&#8221;.<\/li>\n<li> In ordinal 4, the closest new number is 4, so A<sub>4<\/sub>=4; 4&gt;3 1\/2,<br \/>\nso the expansion is &#8220;++++-&#8220;.<\/li>\n<\/ol>\n<p> So in sign expansion form, 3 1\/2 is &#8220;++++-&#8220;.<\/p>\n<p> If you followed that, it should be pretty clear that every positive integer N is written as a series of N &#8220;+&#8221;s in this form.  So 5 is &#8220;+++++&#8221;; six is &#8220;++++++&#8221;; 18 is &#8220;+++++++++++++++++&#8221;.<\/p>\n<p> When there&#8217;s a fractional part, it gets interesting. In the surreal numbers, the first integer larger<br \/>\nthan any fraction is always created before that fraction. So 1 is created before 1\/2; 4 is created before 17\/5, and so on. <\/p>\n<p> So in sign-expansion form, you always <em>overshoot<\/em> a fraction, and then come back. This leads to an important observation: since every positive number is just a sequence of &#8220;+&#8221;s, and you always overshoot fractions, then the first &#8220;+-&#8221; pair in the number is, basically, the decimal point &#8211; it&#8217;s the divider between the integral and fractional part of a number.<\/p>\n<p> Likewise, for the negatives, you always start with a sequence of &#8220;-&#8220;s for the integer part, followed by &#8220;-+&#8221;, followed by the fractional part.<\/p>\n<p> Remember that the way we end up creating things with ordinals, we always introduce a new number which is exactly half-way between previously created ordinals. So given the numbers 3 and 4, the first new number between them will be 3 1\/2; and then the generation after that, 3 1\/4 and 3 3\/4s will get added, and so on. So the signs in the fractional part are describing how to find the value of the fractional part between the two integers on either side of it in terms of&#8230;. a binary search! (And you thought that the binary search post the other day was unrelated!)<\/p>\n<p> The fractional part F of a number N is a sequence of &#8220;+&#8221;s and &#8220;-&#8220;s. At each sign, we have a range from a lower bound l to an upper bound u. At first, l is the integer part of N, and u is l+1. Each time we get another sign, we split the range between L and R in half. If the sign is &#8220;+&#8221;, then we know that N is in the <em>upper<\/em> half of the (l,r), so we increase l to (l+r)\/2. If the sign is &#8220;-&#8220;, then we know N is in the upper half, so we reduce r to (l+r)\/2.<\/p>\n<p> That tells us how to write the a fraction in surreal sign expanded form. But there&#8217;s one more trick to understanding how to <em>read<\/em> the fractional part.   The problem is, if the sign sequence is finite, and the number N belongs to ordinal i,  then the sign sequence tells us what to do <em>up to<\/em> ordinal (i-1).  So at the end of the sign sequence, we&#8217;re always missing one step: the step from ordinal (i-1) to ordinal i. It&#8217;s easy to fix: the nature of this procedure works out so that we&#8217;re always a bit too low &#8211; since we started by overshooting, and dropping back, we always wind up just below N at the last sign in the fractional part. So for computing the value of a surreal number in sign expanded form, we treat it as if it ended with an extra &#8220;+&#8221; at the end,  and that gives us precisely on the value of the fractional part. But it&#8217;s important to realize that that trailing plus is <em>not<\/em> part of the notation of the number: it&#8217;s only added as part of a procedure for calculating the value of a sign-expanded number. So, for example, 1\/4 is written &#8220;+&#8211;&#8220;. If we wanted to read that, we start by recognizing &#8220;+-&#8221; as the separator between integer and fractional parts &#8211; so the integer part is 0. For the the fractional part, we write it as a binary decimal. The first digit of the binary part is 0 (because &#8220;-&#8221; becomes 0), and then we treat it <em>as if<\/em> there were an extra &#8220;+&#8221; on the end, so we add a 1. So &#8220;+&#8211;&#8221; expands to &#8220;0+(.01<sub>2<\/sub>&#8221; = 0+1\/4 = 1\/4.<\/p>\n<p><em>(Note: the previous paragraph was originally written in a way that made it sound like you actually add the trailing &#8220;+&#8221; to the sign-expanded notation of a number &#8211; so that, for example, 1\/4 would be written &#8220;+&#8211;+&#8221; instead of &#8220;+&#8211;&#8220;. Thanks to Blake Stacey for pointing that out.<\/em><\/p>\n<p> Based on all of this, you should be able to see that there&#8217;s a trick to reading the sign expansion, to see what number it is. For positive numbers, they always start off with a series of &#8220;+&#8221;s followed by &#8220;+-&#8220;; for negatives, they always start off with a series of &#8220;-&#8220;s, followed by a &#8220;+&#8221;. So, take the first sign-switch in a sign expansion, and treat it the separator between the integer and fractional<br \/>\nparts of the number. The part <em>before<\/em> the separator is the integer part in ordinal form. If you take the part <em>after<\/em> the separator, and add a &#8220;1&#8221; to the end if it&#8217;s finite, then it&#8217;s the binary decimal for the fractional part; if it&#8217;s a positive number, then &#8220;+&#8221;s in the sign expansion count as 1s and &#8220;-&#8220;s count as 0s; and the opposite for<br \/>\nnegative numbers.<\/p>\n<p> So let&#8217;s look at our expansion of 3 1\/2: &#8220;++++-&#8220;. That&#8217;s &#8220;+++(+-)&#8221;. We add a one (+, since the number is positive) to the end: &#8220;+++(+-)+&#8221;. So the part before the separator is &#8220;+++&#8221;: unary 3. The part after the separator is binary 0.1 = 1\/2. So it&#8217;s the number 3 1\/2.\n<\/p>\n<p> Let&#8217;s try forming the sign expansion of 2 3\/8.  It starts with &#8220;++&#8221; for the integer part; then it&#8217;s got &#8220;+-&#8221; as the sign divider. Then:<\/p>\n<ol>\n<li> We&#8217;re looking at the range (2,3); so we add a &#8220;-&#8220;, because 2 3\/8 is smaller than 2 1\/2.<\/li>\n<li> Then, we&#8217;re looking at the range (2, 2 1\/2).  We add a &#8220;+&#8221;, because 2 3\/8 is larger than  2 1\/4.<\/li>\n<li> We&#8217;re looking at the rnage (2 1\/4, 2 1\/2). The number in that range from the next ordinal is 2 3\/8,<br \/>\nso we&#8217;re done.<\/li>\n<\/ol>\n<p> So 2 3\/8 would be written &#8220;+++&#8211;+&#8221;.<\/p>\n<p> This alternate form of the surreals has a pretty neat property. If you sort<br \/>\nsign-expanded surreal numbers in lexicographic order (that is, sort them as strings, where &#8220;-&#8220;&lt;&#8220;+&#8221;), it&#8217;s exactly the same as sorting them by numeric value. The strings are direct correspondences for the lexicographic position of the numbers in the total order of surreals.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In addition to the classic {L|R} version of the surreal numbers, you can also describe surreals using something called a sign expansion, where they&#8217;re written as a sequence of &#8220;+&#8221;s and &#8220;-&#8220;s &#8211; a sort of binary representation of surreal numbers. It&#8217;s fully equivalent to the {L|R} construction, but built in a different way. This [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[62],"tags":[],"class_list":["post-376","post","type-post","status-publish","format-standard","hentry","category-surreal-numbers"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4lzZS-64","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts\/376","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/comments?post=376"}],"version-history":[{"count":0,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts\/376\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/media?parent=376"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/categories?post=376"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/tags?post=376"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}