News for hackers. Stuff that matters.
Re:1.5 is the midpoint between 0 and infinity in Ruby by tromp on Friday November 27, 2020 @07:55AM (#25228308)
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

Re:1.5 is the midpoint between 0 and infinity in Ruby by DavidSJ on Friday November 27, 2020 @09:28AM (#25228918)
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 multiplication. 0 is the natural "midpoint" of the reals under addition, and exp(0) = 1.

(Closely related to that last one: when dealing only with positive numbers (and their limits 0 and ∞), it's natural to think of their group operation, multiplication, for which 1 is the identity, creating a symmetry between the numbers smaller than 1 and the numbers larger than 1 under reciprocation.)

Re:1.5 is the midpoint between 0 and infinity in Ruby by blm on Friday November 27, 2020 @10:44AM (#25229533)
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 by geofft on Friday November 27, 2020 @03:31PM (#25232315)
> tan(π/8) would be halfway between 0 and 1 ie .5?

It implies that tan(π/8) would be "halfway" between 0 and 1 in this sense of what "halfway" means. In this sense, 0.5 is not halfway between 0 and 1, 0.414 is.

It's easier to visualize it. You're standing on the roof of a 1-meter-tall building on a flat earth with a perfectly clear atmosphere. If you look straight out (90°) you can see to infinity (tan 90°). If you look down (0°) you can see where you are (tan 0°). If you look halfway between those (45°), you can see 1 (tan 45°) meter straight in front of you. But if you look halfway down again, you won't see exactly 0.5 meters, will you?

Re:1.5 is the midpoint between 0 and infinity in Ruby by jacksnipe on Friday November 27, 2020 @11:19AM (#25229894)
This does not imply that tan(pi/8) is 0.5. There’s some overloaded language here that I’d like to unpack:

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.

Re:1.5 is the midpoint between 0 and infinity in Ruby by jacobolus on Friday November 27, 2020 @04:27PM (#25232726)
> tan(π/8) would be halfway between 0 and 1 ie .5?

tan(π/8) = √2 - 1, not 1/2, but the value is indeed halfway between 0 and 1 if you take the distance function to be

d(a, b) = |b - a| / (√(1 + a²)√(1 + b²)) or

d(a, b) = |b - a| / |1 + ab|

(These are chordal distance or stereographic distance, respectively, when the real number line is used to represent points on a circle under stereographic projection.)

The halfway point is 0.5 when you use the distance function d(a, b) = |b - a|.

Re:1.5 is the midpoint between 0 and infinity in Ruby by yiyus on Friday November 27, 2020 @10:54AM (#25229645)
It would only imply that if the tangent was a linear function of the angle, but it is not.
Re:1.5 is the midpoint between 0 and infinity in Ruby by alex_c on Friday November 27, 2020 @01:04PM (#25231063)
This is also consistent with the old joke that developers count like cavemen: zero, one, many!
Re:1.5 is the midpoint between 0 and infinity in Ruby by tempodox on Friday November 27, 2020 @01:56PM (#25231571)
Well, if you map the contents of the unit circle (|z| < 1) through 1/z you can reach any point |z| > 1. So there really is no need to give unique names to anything beyond 1 as it's already contained in the proverbial nutshell of the unit circle via 1/z.
Re:1.5 is the midpoint between 0 and infinity in Ruby by lisper on Friday November 27, 2020 @02:30PM (#25231857)
You don't even need the unit circle. The unit interval is enough, as is any set whose cardinality is aleph-1.
Re:1.5 is the midpoint between 0 and infinity in Ruby by alisonkisk on Saturday November 28, 2020 @10:26PM (#25242717)
Parent (who meant disc not circle) didn't give a dimension. An interval is just a 1 dimensional disc.
Re:1.5 is the midpoint between 0 and infinity in Ruby by recursive on Friday November 27, 2020 @01:09PM (#25231137)
It's also the midpoint of the positive rationals, as modeled by the Stern-Brocot tree.

https://www.cut-the-knot.org/blue/Stern.shtml

Re:1.5 is the midpoint between 0 and infinity in Ruby by Syzygies on Friday November 27, 2020 @01:18PM (#25231227)
Exactly what I came to post. This is an important model for numbers.

Traditionally one distinguishes between rational, algebraic, and transcendental numbers; e is transcendental. This tree is related to continued fraction expansions. Any number is a limit of a path in this tree, and one can talk about the pattern in the path from a CS automata theory point of view. Now e comes out one of the easier limits.

Re:1.5 is the midpoint between 0 and infinity in Ruby by Jweb_Guru on Friday November 27, 2020 @05:20PM (#25233071)
Perhaps I'm confused, but doesn't that site indicate that the midpoint of the positive rationals is 1.0? Or am I misreading it?
Re:1.5 is the midpoint between 0 and infinity in Ruby by recursive on Friday November 27, 2020 @06:05PM (#25233366)
You are not misreading. That's correct.
Re:1.5 is the midpoint between 0 and infinity in Ruby by Jweb_Guru on Friday November 27, 2020 @08:06PM (#25234183)
But the article is saying that in Ruby, it's 1.5, right? So it's not the same as here? Or were you referring to the general notion of a midpoint of an infinite range?
Re:1.5 is the midpoint between 0 and infinity in Ruby by recursive on Friday November 27, 2020 @11:46PM (#25235345)
Right again. The "also" is a reference to the parent comment.

> In surreal numbers [1], the midpoint between 0 and infinity would be the simplest number greater than 0, which is { 0 | } = 1

Re:1.5 is the midpoint between 0 and infinity in Ruby by Jweb_Guru on Saturday November 28, 2020 @06:20AM (#25236952)
Oh, I see! For some reason I didn't spot the parent comment.
Re:1.5 is the midpoint between 0 and infinity in Ruby by yiyus on Friday November 27, 2020 @09:58AM (#25229172)
That's not right. 1 is different to half the sum of 0 and infinity. Another way to look at it is that infinity minus one is larger than one minus zero (which can be easily proven using the basic definitions used to define the surreals). Moreover, what is at the right side of {0|} is not infinity, but the empty set.
Re:1.5 is the midpoint between 0 and infinity in Ruby by Viliam1234 on Saturday November 28, 2020 @07:08PM (#25241729)
> Moreover, what is at the right side of {0|} is not infinity, but the empty set.

But { 0 | ω } = 1, right?

Re:1.5 is the midpoint between 0 and infinity in Ruby by tromp on Sunday November 29, 2020 @04:42AM (#25244071)
Correct. As is { 0 | n } for any n > 1.
Re:1.5 is the midpoint between 0 and infinity in Ruby by npmisdown on Friday November 27, 2020 @08:46AM (#25228658)
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.

Re:1.5 is the midpoint between 0 and infinity in Ruby by zests on Friday November 27, 2020 @09:23AM (#25228898)
Those clerics were ahead of their time. They probably would have banned large cardinals as well (infinites so large we can't prove whether or not they exist.)
Re:1.5 is the midpoint between 0 and infinity in Ruby by user-the-name on Friday November 27, 2020 @09:37AM (#25228991)
Re:1.5 is the midpoint between 0 and infinity in Ruby by colejohnson66 on Friday November 27, 2020 @12:43PM (#25230784)
Even with the shortened URLs, I just knew this was going to be some reference to the Catholic church’s cardinals
Re:1.5 is the midpoint between 0 and infinity in Ruby by npmisdown on Friday November 27, 2020 @09:38AM (#25229002)
Not sure whether 'large cardinals' phrase in your message is intentional or accidental pun.
Re:1.5 is the midpoint between 0 and infinity in Ruby by teilo on Friday November 27, 2020 @09:32AM (#25228950)
You win the internet, sir.
Re:1.5 is the midpoint between 0 and infinity in Ruby by greggyb on Friday November 27, 2020 @10:04AM (#25229210)
Infinitesimals and infinities are nice if you're doing some sort of bucketing logic.

    tiny = infinitesimal
    huge = infinity
    N = number to be bucketed

    tiny <= N < 10  --> bucket 1
    10 <= N < 20    --> bucket 2
    ...
    X <= N < huge   --> 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 by karmakaze on Friday November 27, 2020 @12:00PM (#25230350)
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 by greggyb on Saturday November 28, 2020 @12:18AM (#25235483)
Infinitesimals tautologically exist in any finite representation of numbers. For floats, it's the smallest representable positive number. For integers of any type, it's 1.

As for how common they are, we learn about them in any introductory calculus course when defining derivatives. You come across the idea whenever discussing limits, if somewhat obliquely.

If I learned about it in high school math, and again in "real" math courses at my university, I'd say it's pretty standard.

Re:1.5 is the midpoint between 0 and infinity in Ruby by alisonkisk on Saturday November 28, 2020 @10:36PM (#25242749)
I've never heard of that, and your definition of 1 as infinitesimal is incompatible withbits properties (infinitesimal + infinitesimal + infinitesimal is greater than a non-infinitesimal 2?!) and I don't see a mention on Wikipedia, and it goes against the plain read it of "in-finite-simal".

Also, you seem to be conflating "common" with "standard". "standard" is a mathematical term. Infinitesimal are handwavy in standard analysis (epsilon-delta are the rigorous alternative), but exist rigorously in nonstandard analysis.

https://en.m.wikipedia.org/wiki/Infinitesimal

Re:1.5 is the midpoint between 0 and infinity in Ruby by greggyb on Sunday November 29, 2020 @06:41PM (#25249194)
I guess I'm using the wrong term, then. I often find it useful to have a concept of "smallest representable positive number," specifically for handling edge cases such as the one I gave up-thread. I see how that doesn't map to infinitesimal as defined in the shared link.

There are other instances where I've had a need for such a smallest positive number, where logic is simplified as opposed to checking for 0 in a special way. Whether there's an agreed upon term for that, I know where I've found value in programming tasks.

When I need such a thing, it is almost invariably in comparisons, so I am not doing arithmetic with multiple instances of that smallest representable positive number.

Re:1.5 is the midpoint between 0 and infinity in Ruby by Sharlin on Friday November 27, 2020 @02:47PM (#25232000)
The theory of infinitesimals is intimately connected to how analysis (differential and integral calculus) was first formulated. Leibniz and Newton understood that you could approximate instant rates of change, or areas under a curve, by taking smaller and smaller "slices" of a function, but they did not yet have the rigorously formalized notion of limits that modern analysis depends on. So they developed an arithmetic of infinitesimals, numbers greater than zero but less than any positive real number¹, with some rather ad-hoc properties to make them work out in calculations.

Philosophical problems surrounding the perplexing concept of infinity were already hotly debated by the ancient Greeks. Aristotle made an ontological distinction between actual and potential infinities, and argued that actual infinity cannot exist but potential infinity can. This was also the consensus position of later scholars, and became a sticking point in the acceptance of calculus because infinitesimals (and infinite sums of them) were an example of the ontologically questionable actual infinities.

As I mentioned before, standard modern analysis is based on limits, not infinitesimals, and requires no extension of real numbers. Indeed the limit definition of calculus only requires the concept of potential infinities, so philosophers should be able to rest easy! But infinitesimals still occur in our notation which is largely inherited from Leibniz, however. We say that the derivative of y(x) is dy/dx, or the antiderivative of y(x) is ∫ y(x) dx, and while acknowledging that dy and dx are not actual mathematical objects, just syntax, we still do arithmetic on them whenever it's convenient to do so! For example, when we make a change of variables in an integral, we can substitute x = f(t) for some f, and then say dx/dt = f'(t) and "multiply by dt" to get dx = f'(t) dt to figure out what we should put in the place of the "dx" in the integral.

Actual infinitesimal numbers are not dead, either, they're used in a branch of analysis called nonstandard analysis which formalizes them in the logically rigorous manner that is now expected from mathematics.

________

¹ Not that they had a rigorous theory of real numbers, either, that came in the 19th and early 20th century. In fact what we now understand as formal, axiomatized math didn't really exist before the 19th century at all!

Re:1.5 is the midpoint between 0 and infinity in Ruby by evanb on Friday November 27, 2020 @09:25AM (#25228905)
On a log scale 1 is also halfway between 0 and infinity.
Re:1.5 is the midpoint between 0 and infinity in Ruby by klodolph on Friday November 27, 2020 @11:58AM (#25230336)
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 by bollu on Friday November 27, 2020 @08:01AM (#25228340)
Can you tell me the hackenbush interpretation of this? sounds cool!
Re:1.5 is the midpoint between 0 and infinity in Ruby by coldtea on Friday November 27, 2020 @08:26AM (#25228508)