Numeric comparison with nil - Math masochists only!!

S

serialhex

[Note: parts of this message were removed to make it a legal post.]

Alright, i'm trying to do three things at once, and I'm almost succeeding.
The first thing is learn Ruby, the second thing is learn Surreal Numbers,
and the third is to make a Ruby class for Surreal numbers. :p My problem
is this: part of the definition of a surreal number is pretty much a
comparison with nil. So how would one go about this? Should I write a <=>
and mixin Comparable? What else should I include to make this easier?? Any
help & suggestions are most welcome!!

And for those of you who are interested and want more info on surreal
numbers, here are some links...
http://en.wikipedia.org/wiki/Surreal_number
http://www.tondering.dk/claus/surreal.html
http://scienceblogs.com/goodmath/goodmath/numbers/surreal_numbers/
http://www.dm.unipi.it/~fornasiero/phd_thesis/thesis_fornasiero_linearized.pdf

thats all of my links to surreal numbers... it kinda sucks that my biggest
hurdle is at the very beggining!! :p

thanks again!

-hex
 
C

Colin Bartlett

[Note: parts of this message were removed to make it a legal post.]

Alright, i'm trying to do three things at once, and I'm almost succeeding.
The first thing is learn Ruby, the second thing is learn Surreal Numbers,
and the third is to make a Ruby class for Surreal numbers. :p My problem
is this: part of the definition of a surreal number is pretty much a
comparison with nil. So how would one go about this? Should I write a <=>
and mixin Comparable? What else should I include to make this easier?? Any
help & suggestions are most welcome!!

A possibly unhelpful suggestion about nil <=> y and y <=> nil: does the nil
for Surreal *have* to be the Ruby nil of NilClass?

I think it could be (as you say, write Nil#<=> and mixin Comparable) and I
guess that it's unlikely that a SurrealNumbers class would be used with
anything else?? (But you can never be sure: another of my lecturers (see
Semi-OT below) was Ian Stewart, and in one of his 1990s (sort of) popular
books on modern mathematics he says non-standard arithmetic has been used to
devise better ways of representing images using pixels (or something like
that): basically work out the theory using "finite" "infinite" integers,
then use the results to make a practical algorithm by changing a "finite"
"infinite" integer to a large finite integer.)

So if you wanted to avoid possible clashes with other code which expects
(nil <=> other) to raise an exception you could set up

class Surreal::SurrealNil
# define appropriate methods
end
Surreal::Nil = Surreal::SurrealNil.new
Nil = Surreal::Nil # maybe

You can do:
class Surreal::SurrealNil < NilClass
but then there isn't Surreal::SurrealNil.new, presumably because there isn't
NilClass.new

I'd be interested to see what you come up with, because periodically I try
to really understand NonStandard Analysis, and the NonStandard Reals are a
subset of the Surreals.


*** Semi-OT: I followed up some links from your links, and found a name I
recognized as the lecturer who gave my first (or at least one of my first)
lectures in mathematics at the University of Warwick in October 1973, a one
term course on the Foundations of Mathematics. (Basically set theory using
Paul Halmos's Naive Set Theory.) I knew he became very interested in
mathematical education some time after I'd graduated, but I didn't know that
he was also interested in "intuitive" concepts of infinity. Following up
links and trying to find out more about David O Tall's "super-real" numbers
I found:
http://www.jonhoyle.com/MAAseaway/Infinitesimals.html (section 3.2)
A less ambitious but much more accessible approach to defining
infinitesimals is one by David Tall from the University of Warwick. His
motivation was to create a system which was more intuitive for students and
to make Calculus concepts easier to grasp. The simplicity of his approach is
very appealing, as it quickly gets to the use of infinitesimals without the
large construction found *R's construction. ...
http://www.warwick.ac.uk/staff/David.Tall/downloads.html
http://www.warwick.ac.uk/staff/David.Tall/themes/limits-infinity.html
and in particular this delightful conversation about infinity between David
Tall and his seven year old son:
http://www.warwick.ac.uk/staff/David.Tall/pdfs/dot2001l-childs-infinity.pdf
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top