Live data from Hacker News

1.5 is the midpoint between 0 and infinity in Ruby

blog.peterzhu.ca

61–70 of 125 posts

Re: 1.5 is the midpoint between 0 and infinity in Ruby

#61
post #57

Isn't it -1/12 actually?

I was trying to remember the situation where in physics, under certain conditions, a proof that shows infinity can be represented numerically as -1/12 (it was some obscure fraction yet after seeing it, I think this was the value). 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.

[deleted]

Re: 1.5 is the midpoint between 0 and infinity in Ruby

#62
post #39

Finally, that settles it: ∞ = 3

And we know from the bible that π = 3, so in effect π = ∞. This should simplify many things that people have agonized over!

Better said, we know from the State of Indiana that π = 3. The biblical thing was observation; the State of Indiana codified it in law.

Re: 1.5 is the midpoint between 0 and infinity in Ruby

#63
post #57

Isn't it -1/12 actually?

I was trying to remember the situation where in physics, under certain conditions, a proof that shows infinity can be represented numerically as -1/12 (it was some obscure fraction yet after seeing it, I think this was the value). 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.

In physics, it is something related to removing divergences in bosonic string theory, I am not an expert in that. Here, however, is a fantastic article that shows how -1/12 is actually derived: https://medium.com/cantors-paradise/the-ramanujan-summation-... (spoiler: it is really easy and could be done by a high schooler).

Re: 1.5 is the midpoint between 0 and infinity in Ruby

#65

This seems inefficient especially if the answer is close to a power of two? You'll spend a lot of time bouncing between exponents instead of refining the mantissa.

It's a binary search in a 64-bit search space. Powers of two are no more inefficient than other answers, on average, if you assume the answers are uniformly distributed.

You could do an exponential search, which is a reasonable choice and makes logical sense, but the exponential search won't be any faster on average.

Re: 1.5 is the midpoint between 0 and infinity in Ruby

#66
post #41
post #29

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

On a log scale 1 is also halfway between 0 and infinity.

On a log scale, all numbers are equally distant from 0 and infinity. 1 is no more “halfway” than 10, or 13, or 1/95.

Re: 1.5 is the midpoint between 0 and infinity in Ruby

#67
post #52

Earlier quoted context omitted.

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.

Infinitesimals and infinities are nice if you're doing some sort of bucketing logic. 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.

Infinitesimals do not exist in the standard real number system. 'tiny' seems to be more related to the smallest positive representable (normal or subnormal) IEEE 754 float/double type of value which is a real number.

Re: 1.5 is the midpoint between 0 and infinity in Ruby

#68
post #57

Isn't it -1/12 actually?

I was trying to remember the situation where in physics, under certain conditions, a proof that shows infinity can be represented numerically as -1/12 (it was some obscure fraction yet after seeing it, I think this was the value). 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.

The Casimir Effect in one dimension: https://en.m.wikiversity.org/wiki/Quantum_mechanics/Casimir_...

Re: 1.5 is the midpoint between 0 and infinity in Ruby

#69
post #57

Earlier quoted context omitted.

I was trying to remember the situation where in physics, under certain conditions, a proof that shows infinity can be represented numerically as -1/12 (it was some obscure fraction yet after seeing it, I think this was the value). 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.

In physics, it is something related to removing divergences in bosonic string theory, I am not an expert in that. Here, however, is a fantastic article that shows how -1/12 is actually derived: https://medium.com/cantors-paradise/the-ramanujan-summation-... (spoiler: it is really easy and could be done by a high schooler).

That proof (and the more general statement) is not correct because it makes assumptions about infinite summation of divergent series that are not true.

There is a link between the sum of natural numbers -- namely, the analytic continuation of the Reimann Zeta function has Z(-1) = -1/12. But the Zeta function is only defined to equal the sum of inverse powers for Re(z) > 1. And under a specific definition of summation (Ramanujan summation) you can say that "the sum is equal to -1/12" but that isn't the same as normal summation.

Mathologer did a fairly in-depth video[1] into why this proof is wrong and what the actual link is between the infinite series and -1/12. The upshot is that even if you use more complicated definitions of summation, you cannot define sums of the kind 1+2+3+... to equal a finite number.

If you assume the infinite sum of 1+2+3+... converges to a finite number you can easily prove a contradictory statement using the same summation properties assumed by that proof. Namely:

  S  = 1 + 2 + 3 + ... = -1/12
  S2 = S-S = 0
     = 1 + 2 + 3 + ...
     - 1 - 2 - 3 - ... = 0
     = 1 + 2 + 3 + ...
         - 1 - 2 - ... = 0
  S2 = 1 + 1 + 1 + 1 + ... = 0
  S3 = S2-S2 = 0
     = (1-1) + (1-1) + ...
     = 1 - 1 + 1 - 1 + ... = 0
But we "derived" in the original proof that S3 is equal to 1/2, which is a contradiction. (You could derive S3 is 1/2 from S but that's what the article does in reverse.)

[1]: https://youtu.be/YuIIjLr6vUA

Re: 1.5 is the midpoint between 0 and infinity in Ruby

#70
C++ :)

  #include 
  #include 
  
  double midpoint(double first, double second) {
    auto firstAsInt = reinterpret_cast  (first);
    auto secondAsInt = reinterpret_cast  (second);
    auto mid = (secondAsInt + firstAsInt) / 2;
    return reinterpret_cast  (mid);
  }
  
  int main() {
    std::cout
       1.5 = "  inf = "  ::infinity()) 
Post reply on HN