Hacker News new | past | comments | ask | show | jobs | submit login

Well, I suppose that's true if you limit yourself to the reals, but it doesn't hold if you're dealing with the surreal numbers :-)



Could you kindly give an example of addition in the surreal numbers? I've read a chapter in one of John Conway's books about the surreal numbers, but I don't recall the rules of arithmetic for those.


The whole thing is defined recursively. All you need to know is that a surreal number consists of two sets of surreal numbers, the left set and the right set, written {L|R}; and no member of the right set is less than any member of the left set. "Less than" is defined recursively - see http://en.wikipedia.org/wiki/Surreal_numbers#Order (it's easier to write using math symbols)

Some finite examples of addition (again, wiki has a better explanation of the rules than I could give b/c they can use math symbols http://en.wikipedia.org/wiki/Surreal_numbers#Addition):

{|} + {|} = {|} == 0 + 0 = 0 (zero has the empty set on both sides; everything is built from this)

{|} + {{ | } | } = {{ | } | } == 0 + 1 = 1

{{ | } | } + {|} = {{ | } | } == 1 + 0 = 1

{{ | } | } + {{ | } | } = {{{ | } | }, {{ | } | } | } == 1 + 1 = 2

{{{ | } | }, {{ | } | } | } + {{ | } | } = {{{{ | } | }, {{ | } | } | }, {{{ | } | }, {{ | } | } | }, {{{ | } | }, {{ | } | } | } | } == 2 + 1 = 3

As you can see, the "long" forms of surreal numbers quickly become unwieldy, which is why people use roman numerals to describe surreal numbers with the same properties as the corresponding real. When dealing with transfinite numbers it's not possible to use the long form. (And yes, I wrote a program to generate those sums for me. No way I'm doing that by hand!)


that is cool and informative - mind sharing the source for generating the sums?


http://pastebin.com/m3387c4ae

It's part of a game (in the Conway sense) framework I wrote up when I was learning about surreal numbers. Games are an even more general construct, where the left side is not required to be 'less than' the right side. Anyway, to use it, fire up GHCi and `:l game`. I've pre-defined -1, 0, and 1, but you can theoretically create any number with a finite representation (of course, the data structure and algorithms used are deliberately naive and incredibly inefficient and slow, so don't try anything crazy). For example, 5+3 requires 1156 characters to display, 5+4 requires 2556, and 5+5 requires 5118. This is because my code doesn't attempt to "reduce" any of the numbers - numbers can have multiple representations, and with finite representations you can just take the largest element of the left set and the smallest element of the right set and get the same number. My code doesn't do that. Anyway, there's also a fromInteger definition so you can mix Numbers and integers in computations.

Examples:

    Prelude> :l game
    [1 of 1] Compiling Game             ( game.hs, interpreted )
    Ok, modules loaded: Game.
    *Game> zero
    { | }
    *Game> 5 :: Game
    {{{{{{ | } | } | } | } | } | }
    *Game> let half = Game [zero] [one]
    *Game> half
    {{ | } | {{ | } | }}
    *Game> half < one
    True
    *Game> half > 1
    False
    *Game> half + half == 1
    True
    *Game> half * 1 == half
    True
    *Game> half * (one + one) > 1
    False
The best resources for learning are both by Conway: "Winning Ways for your Mathematical Plays" (WW) and "On Numbers and Games" (ONAG). WW is more accessible and introduces you to numbers via games, whereas ONAG is more of a hard-core math book that explains games via numbers. WW is probably better if you don't have a strong math background, ONAG if you do.


Surreal numbers where first described in Conway's "On Number's and Games." Since then there have been numerous other articles and books about them including a very nice one by Donald Knuth called "Surreal Numbers".




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: