On 12/30/19 2:10 AM, Chris Angelico wrote:
On Mon, Dec 30, 2019 at 3:52 PM Andrew Barnert <abarn...@yahoo.com> wrote:
On Dec 29, 2019, at 18:50, Chris Angelico <ros...@gmail.com> wrote:
On Mon, Dec 30, 2019 at 1:40 PM Andrew Barnert <abarn...@yahoo.com> wrote:
On Dec 29, 2019, at 18:20, Chris Angelico <ros...@gmail.com> wrote:
Counting numbers are intuitively numbers. So are measures. And yet, they’re 
different. Which one is the “one true numbers”? Who cares? Medieval 
mathematicians did spend thousands of pages trying to resolve that question, 
but it’s a lot more productive to just accept that the intuitive notion of 
“number” is vague and instead come up with systematic ways to define and 
compare and contrast and relate different algebras (not just those two).

That's what I said. You cannot use intuition to define numbers unless
you're willing to restrict it to counting numbers.
I was agreeing with you in general, but I think the truth is even stronger than 
you’re claiming.

You can also use intuition to define numbers if you’re willing to restrict it 
to measures. In fact, Steven is doing so in at least half his arguments. And 
anyone who tries to make their intuition rigorous by starting off with “numbers 
are elements of fields that…” is using the measures intuition, not the counting 
intuition. And that’s the real problem: even counting numbers are not “the 
numbers”; we really do have conflicting intuitions, and there really is no way 
around that.

Gotcha. And yeah, it's hard to come up with any sort of intuition
about numbers that doesn't break down *somewhere*. I mean, what does
"equal" mean? Is it true that a 100mm stick is "equal" in length to
another 100mm stick? And if you cut a stick 100mm long, then cut
another stick the same length as it, and keep taking the most recent
stick and cutting another stick the same length, are they all equal?
(If you say "yes", then I encourage you to try it.) Similarly, is it
valid to say that the infinite sum 1+2+4+8+16.... is "equal" to -1?
Perhaps the intuitive understanding of numbers includes a finite but perhaps arbitrary precision, but if anything that makes it a better test for what is a number in the case of the float type, since it is a finite approximation. In the case of comparing two 100mm sticks, conceptually, it is simple, align one end of them together, then look at the other end and see which is longer. Intuitively simple. Yes, if we actually try to do this, we are constrained by the limits of precision of out senses, perhaps augmented by tools, and by the quantization of reality. Perhaps it is better to say that the mathematical concept of 'Real Numbers' is what is off, and no such thing can actually exist
And the same is true of the debate about float("nan"). You cannot use
intuition to figure out whether this is a number or not, because
intuition has ALREADY failed us. "Commonsense tests" such as Steven
put forward are not a valid way to debate the edge cases, because they
fail on what we would consider clear cases.
Agreed.

There actually is an important place for common sense tests, but that place is 
in coming up with new systems, not in deciding which system is “right”. 
Obviously complex numbers are numbers. Obviously numbers can be ordered. 
Complex numbers don’t have a natural order. Which one of those intuitions was 
wrong? Neither; they’re both right, and therefore we just found a new way to 
distinguish between two useful classes of “number” structures. We’re farther 
from ever from knowing which things are “really numbers”, but who cares?

3blue1brown discussed this as regards the term "vector". What IS a
vector? Is it an ordered tuple of numbers representing N-dimensional
coordinates? A point in N-dimensional space? An arrow pointing from
somewhere to somewhere else? Or is it, instead, "a thing that you can
scale by a unitless value, and which you can add to another vector to
produce a vector"?

But the question is: What should the statistics module do with a nan?
This can only be answered by understanding what "nan" means in a
statistical context, which is only tangentially related to the
question of whether nan is a number. And I think this thread has
proven that there is no single obvious meaning for a nan. It could
mean missing data. It could mean out-of-bounds or illogical data. It
could mean something different entirely.

ChrisA

My first answer is that to statistics in general, NaN is meaningless. statistics as a Science, deals in the domain of Real Numbers (as in Numbers that really exist), it is a Science to help us measure and understand reality from those measurements. As such, a value like 'NaN' has no meaning.

Historically, based on the history of using languages like Fortran, some statistical packages have used it as a convenient indicator for no data. Originally, to handle this case, an application would use some absurdly out of bounds value for this, to allow the package to filter them out later. Due to language constraints, you had to use some floating point value as this marker. When the IEEE format came out, and had this strange value, it became a somewhat natural choice, as not being a number, it couldn't really be part of the statistics. This did break the ability to use the generation of NaNs as a way to detect calculation errors, but statisticians were used to having to do analysis ahead of time to avoid those avoidable loss of precision that NaN caught when the hit the extremums, so losing its diagnostic value wasn't that bad, and you could still test for them being generated before adding them to the list to confirm things.

Personally, I don't think the simple statistics package needs to support this usage, as if you really want to use it, you really should understand the meaning of the NaN, and how to program with it, and can the either handle it yourself before passing to the statistics package, or use a higher grade package that is built with that interpretation built in. It also likely gives better control over how the values are computed.

--
Richard Damon
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/MPXVVENMJSZ52UCOPM2232IWPCNYFYBQ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to