{"id":404,"date":"2007-04-30T21:42:33","date_gmt":"2007-04-30T21:42:33","guid":{"rendered":"http:\/\/scientopia.org\/blogs\/goodmath\/2007\/04\/30\/surreal-nimbers-no-thats-not-a-typo\/"},"modified":"2007-04-30T21:42:33","modified_gmt":"2007-04-30T21:42:33","slug":"surreal-nimbers-no-thats-not-a-typo","status":"publish","type":"post","link":"http:\/\/www.goodmath.org\/blog\/2007\/04\/30\/surreal-nimbers-no-thats-not-a-typo\/","title":{"rendered":"Surreal Nimbers: No, that&#039;s not a typo!"},"content":{"rendered":"<p><em>(A substantial part of this post was rewritten since it was first posted. I managed to mangle things while editing, and the result was not particularly comprehensible: for example, in the original version of the post, I managed to delete the definition of &#8220;mex&#8221;, which continuing to use mex in several other definitions. I&#8217;ve tried to clear it up. Sorry for the confusion!)<\/em><\/p>\n<p> This is actually a post in the surreal numbers series, even though it&#8217;s not going to look like one. It&#8217;s going to <em>look<\/em> like an introduction to another very strange system of numbers, called <em>nimbers<\/em>. But nimbers are a step on the path from<br \/>\nsurreal numbers to games and game theory.<\/p>\n<p> Nimbers come from a very old game called <em>Nim<\/em>. We&#8217;ll talk more about Nim later, but it&#8217;s one of the oldest strategy games known. The basic idea of it is that you have<br \/>\na couple of piles of stones. Each turn, each player can take some stones from one of the piles. Whoever is left making the last move loses. It seems like a very trivial game. But it turns out that you can reduce pretty much every impartial game to some variation of Nim. <\/p>\n<p> Analyzing Nim mathematically, you wind up finding that it re-creates the concept of ordinal numbers, which is what surreals are also based on. In fact, creating nimbers <em>can<\/em> end up re-creating the surreals. But that&#8217;s not what we&#8217;re going to do here: we&#8217;re going to create the nimbers and the basic nimber addition and multiplication<br \/>\noperations.<\/p>\n<p><!--more--><\/p>\n<p> The trick to creating nimbers is going to be using an ordinal process where we don&#8217;t distinguish between left and right sets in the nimbers, but we use the idea of the corresponding surreals to define things like &le;.  And using this non-distinguishing<br \/>\nordinal process, we&#8217;re going to create numbers that form a (peculiar) field. In fact, we&#8217;re going to get the number field with characteristic 2 &#8211; meaning a number field where<br \/>\neach number is its own additive opposite.<\/p>\n<p> So we start with ordinal 0. Obviously, ordinal 0 defines the number 0 &#8211; the additive identity. After that, for successive ordinals, we&#8217;ll just play around with a definition of addition based on the idea of the minimum excluded ordinal: the smallest ordinal which is not yet a part of our set.  The sum of two of two ordinals can&#8217;t exist before the ordinals themselves &#8211; and we&#8217;ll exploit that.  So we&#8217;ll define things in terms of the <em>minimum exluded ordinal (mex)<\/em> the minimum ordinal number which isn&#8217;t yet part of the set of nimbers.<\/p>\n<p> So we&#8217;ve got zero. And we can&#8217;t add any new numbers using addition &#8211; because 0+0=0. So we look for the mex of the set of defined ordinals: mex({0}). That&#8217;s 1. So now we have two numbers, 0 and 1.<\/p>\n<p> Now, for successive generations, we&#8217;re going to use nimber addition. Given two nimbers A and B, A+B = mex({A&#8217;+B : A'&lt;A} &cup; {A+B&#8217;: B'&lt;B}).  Using that, we get a set of new nimbers defined from the sums of existing nimbers. Each time we&#8217;ve exhausted the new numbers that can be generated using sums, we&#8217;ll create a new nimber by taking the mex of the nimbers that we&#8217;ve defined so far.<\/p>\n<p> Nimber addition, as defined above, is strange. Let&#8217;s take a moment and look at why. In nimber addition, what&#8217;s 1+1?  It&#8217;s 0: 1 is its own additive inverse.  In fact, we&#8217;ll find that <em>every<\/em> nimber is its <em>own<\/em> additive inverse: N+N=0 for all N. And if we work through from there, we&#8217;ll find that we can treat every number as its binary expansion, and cancel pairs of the same power of two. So, for example, we can take thu nimber sum of 7 and 9:  7=4+2+1; 9=8+1; so 7+9=(4+2+1)+(8+1) = 8+4+2+1+1; cancel the pair of ones, and it equals 8+4+2 = 14.  For another example, we can take the nimber sum of 15 (8+4+2+1) and 6 (4+2) = 8+4+4+2+2+1; cancel the pair of 4s and the pair of twos, and we get 8+1=9.  So 15+6=9.   So for any two nimbers A and B, the addition operation is really bitwise exclusive-or of the binary expansion of the number. <em>(The first addition example in this paragraph originally contained a typo: when I re-arranged the additive expansion terms, I changed a 1 to a 2. Thanks to alert commenters who noticed and pointed that out.)<\/em><\/p>\n<p> What about multiplication? Well, it&#8217;s similar to addition:  A&times;B = mex(A&#8217;&times;B + A&times;B&#8217; : A'&lt;A and B'&lt;B). The nimber product of any two nimbers ends up being the nimber sum of numbers of the form 2<sup>2<sup>n<\/sup><\/sup>. Those numbers are called <em>Fermat 2-powers<\/em>. In nimber multiplication, the nimber product of two distinct Fermat 2-powers is their product in the normal surreal number field. The nimber-product of any Fermat 2-power N with itself it 3N\/2.<\/p>\n<p> So what&#8217;s 4&times;4? 6. 4&times;6? Well, 6=4+2, so 4&times;6=4&times;(4+2)=4&times;4 + 4&times;2. We know 4&times;4=6, so that&#8217;s 6+(4&times;2) = 6+8=14.<\/p>\n<p> How about 4&times;10? Well, 10=8+2. 8=4&times;2. So 10=4&times;2+2. So 4&times;10 =<br \/>\n4&times;(4&times;2+2) = 4&times;4&times;2 + 4&times;2 = 6&times;2 + 8 = (4+2)&times;2 + 8 = 8+3+8=8+8+3=0+3=3. <\/p>\n<p> All of this works out to give us a new field of ordinal numbers. Yes &#8211; this crazy stuff actually <em>does<\/em> work out to be a field. And these operations actually <em>do<\/em> make sense, in a strange way. When you start analyzing games, any impartial game is equivalent to a game of Nim for some set of piles. And given a game of Nim two piles of size A and B, there&#8217;s an <em>equivalent<\/em> game of Nim with one pile &#8211; and the size of that pile is the nimber sum A+B.<\/p>\n<p> There&#8217;s a similar reason why the product makes sense. But we&#8217;ll get back to that<br \/>\nsome other time.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>(A substantial part of this post was rewritten since it was first posted. I managed to mangle things while editing, and the result was not particularly comprehensible: for example, in the original version of the post, I managed to delete the definition of &#8220;mex&#8221;, which continuing to use mex in several other definitions. I&#8217;ve tried [&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-404","post","type-post","status-publish","format-standard","hentry","category-surreal-numbers"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4lzZS-6w","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts\/404","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=404"}],"version-history":[{"count":0,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts\/404\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/media?parent=404"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/categories?post=404"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/tags?post=404"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}