In surreal numbers [1], the midpoint between 0 and infinity would be the simplest number greater than 0, which is { 0 | } = 1 [1] https://en.wikipedia.org/wiki/Surreal_number
1.5 is the midpoint between 0 and infinity in Ruby
51–60 of 125 posts
Re: 1.5 is the midpoint between 0 and infinity in Ruby
#52In surreal numbers [1], the midpoint between 0 and infinity would be the simplest number greater than 0, which is { 0 | } = 1 [1] https://en.wikipedia.org/wiki/Surreal_number
TIL: apart from infinity (number, larger than any real number in absolute value) there are infinitesimal (number, less than any real number in absolute value and not a zero). Edit: also, those infinitesimals were the subject of political and religious controversies in 17th century Europe, including a ban on infinitesimals issued by clerics in Rome in 1632.
tiny = infinitesimal
huge = infinity
N = number to be bucketed
tiny bucket 1
10 bucket 2
...
X last bucket
This removes edge cases you need to test for if you're trying to bucket positive values. This may not be something you've had to do, but I've had reason to want this before on a few occasions.Re: 1.5 is the midpoint between 0 and infinity in Ruby
#53I just use bigints wherever it's possible to transform the algorithm to work with bigints, and I "render to decimal" in views
Re: 1.5 is the midpoint between 0 and infinity in Ruby
#54In surreal numbers [1], the midpoint between 0 and infinity would be the simplest number greater than 0, which is { 0 | } = 1 [1] https://en.wikipedia.org/wiki/Surreal_number
Some other senses in which 1 can be thought of as the "midpoint" between 0 and ∞ come from the many common ways to invertibly map an interval onto (0, ∞), in which the midpoint of that interval maps onto 1. For example: • tan maps (0, π/2) onto (0, ∞), and tan(π/4) = 1. • f(x) = x/(1 - x) maps (0, 1) onto (0, ∞), and f(1/2) = 1. • exp is an isomorphism from the reals under addition to the positive reals under multipl…
If this was true:
tan maps (0, π/2) onto (0, ∞), and tan(π/4) = 1
Wouldnt it imply that
tan(π/8) would be halfway between 0 and 1 ie .5?
By my calculations it is 0.414 or √2 - 1
ALso with:
• f(x) = x/(1 - x) maps (0, 1) onto (0, ∞), and f(1/2) = 1.
wouldnt this mean that f(0.25) is supposed to be half way between 0 and 1 or .5. However f(0.25) = 0.25/0.75 = 1/3
Re: 1.5 is the midpoint between 0 and infinity in Ruby
#55Clearly we'll need to some work in TruffleRuby to be fully compatible. I really hope nobody's code depends on this. Infinity 8.988465674311579e+307 4.4942328371557893e+307 2.2471164185778946e+307 1.1235582092889473e+307 5.6177910464447366e+306 ... 32767.999999999996 16383.999999999998 8191.999999999999 4095.9999999999995 2047.9999999999998 1023.9999999999999 511.99999999999994 255.99999999999997 127.99999999999999 63…
Re: 1.5 is the midpoint between 0 and infinity in Ruby
#56Earlier quoted context omitted.
Some other senses in which 1 can be thought of as the "midpoint" between 0 and ∞ come from the many common ways to invertibly map an interval onto (0, ∞), in which the midpoint of that interval maps onto 1. For example: • tan maps (0, π/2) onto (0, ∞), and tan(π/4) = 1. • f(x) = x/(1 - x) maps (0, 1) onto (0, ∞), and f(1/2) = 1. • exp is an isomorphism from the reals under addition to the positive reals under multipl…
I have a question If this was true: tan maps (0, π/2) onto (0, ∞), and tan(π/4) = 1 Wouldnt it imply that tan(π/8) would be halfway between 0 and 1 ie .5? By my calculations it is 0.414 or √2 - 1 ALso with: • f(x) = x/(1 - x) maps (0, 1) onto (0, ∞), and f(1/2) = 1. wouldnt this mean that f(0.25) is supposed to be half way between 0 and 1 or .5. However f(0.25) = 0.25/0.75 = 1/3
Re: 1.5 is the midpoint between 0 and infinity in Ruby
#57Isn't it -1/12 actually?
I couldn't for the life of me remember the set of conditions and proof that shows this but it was interesting when reading through it a few years ago.
Re: 1.5 is the midpoint between 0 and infinity in Ruby
#58Re: 1.5 is the midpoint between 0 and infinity in Ruby
#59This all makes sense. It seems like there would be some special edge cases around the finite/NaN boundary that would be rarely exercised. I wonder if/how those are handled.
>>> import numpy as np
>>> 1 + np.Inf
inf
>>> (0 + np.Inf)/2
inf
>>>
Infinity is not a number it is a concept[1] My math teacher used to say think of infinity like a impossibly large number. An impossibly large number divided by two is still an impossibly large numberRe: 1.5 is the midpoint between 0 and infinity in Ruby
#60Earlier quoted context omitted.
Some other senses in which 1 can be thought of as the "midpoint" between 0 and ∞ come from the many common ways to invertibly map an interval onto (0, ∞), in which the midpoint of that interval maps onto 1. For example: • tan maps (0, π/2) onto (0, ∞), and tan(π/4) = 1. • f(x) = x/(1 - x) maps (0, 1) onto (0, ∞), and f(1/2) = 1. • exp is an isomorphism from the reals under addition to the positive reals under multipl…
I have a question If this was true: tan maps (0, π/2) onto (0, ∞), and tan(π/4) = 1 Wouldnt it imply that tan(π/8) would be halfway between 0 and 1 ie .5? By my calculations it is 0.414 or √2 - 1 ALso with: • f(x) = x/(1 - x) maps (0, 1) onto (0, ∞), and f(1/2) = 1. wouldnt this mean that f(0.25) is supposed to be half way between 0 and 1 or .5. However f(0.25) = 0.25/0.75 = 1/3
The original issue at hand is to talk sensibly about “half way” between 0 and infinity. But in the standard way we think about distance between numbers, there’s obviously no way to do that — you can’t add and subtract real numbers to infinity!
So, implicitly what’s happening here is that by talking about a map between a finite interval and (0,inf), we are equipping (0,inf) with a new, special definition of distance between numbers. This is called a metric.
Usually, when we talk about the distance between x and y, we mean `d(x,y) = |x-y|` — this is called the Euclidean metric (in 1 dimension).
Here, we’ve introduced a new metric on (0,inf): `d2(x,y) = |tan^-1(x) - tan^-1(y)|/(pi/8)`
The half way point between 0 and 1 under the Euclidean metric is 0.5. The half way point between 0 and 1 under our fancy new metric d2 is ~0.414.
TL;DR: You can generalize the notion of “distance between two numbers”, using distance functions called metrics. Under the typical metric, the half way point between 0 and 1 is 0.5. Under our cool new infinite-tan metric, the half way point between 0 and 1 is ~0.414.