all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* org-table-sort-lines (numerically) leaves 0 separated
@ 2022-07-01  5:31 Uwe Brauer
  2022-07-03 18:26 ` [more absurd] (was: org-table-sort-lines (numerically) leaves 0 separated) Uwe Brauer
  0 siblings, 1 reply; 17+ messages in thread
From: Uwe Brauer @ 2022-07-01  5:31 UTC (permalink / raw)
  To: emacs-orgmode


Hi

I have the following table
| name  | marks |
|-------+-------|
| Auser |   0.5 |
| Buser |     2 |
| Cuser |     0 |
| Duser |     2 |
| Euser |     0 |
| Fuser |     3 |
| Guser |       |
| Huser |     0 |
| Iuser |       |
| Juser |     6 |

If I sort the second column numerically I obtain

| name  | marks |
|-------+-------|
| Cuser |     0 |
| Euser |     0 |
| Guser |       |
| Huser |     0 |
| Iuser |       |
| Auser |   0.5 |
| Buser |     2 |
| Duser |     2 |
| Fuser |     3 |
| Juser |     6 |

Which is bizarre, why is 0 not connected to the rest of the numerical entries?



-- 
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 



^ permalink raw reply	[flat|nested] 17+ messages in thread

* [more absurd] (was: org-table-sort-lines (numerically) leaves 0 separated)
  2022-07-01  5:31 org-table-sort-lines (numerically) leaves 0 separated Uwe Brauer
@ 2022-07-03 18:26 ` Uwe Brauer
  2022-07-03 19:11   ` Bruno Barbier
  0 siblings, 1 reply; 17+ messages in thread
From: Uwe Brauer @ 2022-07-03 18:26 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 690 bytes --]

>>> "UB" == Uwe Brauer <oub@mat.ucm.es> writes:

> Hi

> I have the following table
> | name  | marks |
> |-------+-------|
> | Auser |   0.5 |
> | Buser |     2 |
> | Cuser |     0 |
> | Duser |     2 |
> | Euser |     0 |
> | Fuser |     3 |
> | Guser |       |
> | Huser |     0 |
> | Iuser |       |
> | Juser |     6 |

Consider 

| 2 |
| 1 |
| 1 |
| 0 |
|   |
|   |

(org-table-sort-lines nil nil nil nil t) (numerically 'n' gives)


| 0 |
|   |
|   |
| 1 |
| 1 |
| 2 |


But 
(org-table-sort-lines nil nil nil nil t) (numerically 'N') 

gives

| 2 |
| 1 |
| 1 |
| 0 |
|   |
|   |

So no empty lines, what the hell is going on here?

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [more absurd] (was: org-table-sort-lines (numerically) leaves 0 separated)
  2022-07-03 18:26 ` [more absurd] (was: org-table-sort-lines (numerically) leaves 0 separated) Uwe Brauer
@ 2022-07-03 19:11   ` Bruno Barbier
  2022-07-03 19:29     ` [more absurd] Uwe Brauer
  0 siblings, 1 reply; 17+ messages in thread
From: Bruno Barbier @ 2022-07-03 19:11 UTC (permalink / raw)
  To: Uwe Brauer, emacs-orgmode


Uwe Brauer <oub@mat.ucm.es> writes:

> Consider 
>
> | 2 |
> | 1 |
> | 1 |
> | 0 |
> |   |
> |   |
>
> (org-table-sort-lines nil nil nil nil t) (numerically 'n' gives)
...
>
> So no empty lines, what the hell is going on here?


The reason is probably that the function 'string-to-number' return 0 for
anything that cannot be converted to a number.

Thus, as far as sorting is concerned, "not a number cells" and "cells
containing zeros" are the same and can be put in any arbitrary order.

Maybe org should handle NaN cells in a better way.

Bruno








^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [more absurd]
  2022-07-03 19:11   ` Bruno Barbier
@ 2022-07-03 19:29     ` Uwe Brauer
  2022-07-03 19:44       ` Bruno Barbier
  0 siblings, 1 reply; 17+ messages in thread
From: Uwe Brauer @ 2022-07-03 19:29 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1227 bytes --]

>>> "BB" == Bruno Barbier <brubar.cs@gmail.com> writes:

> Uwe Brauer <oub@mat.ucm.es> writes:

>> Consider 
>> 
>> | 2 |
>> | 1 |
>> | 1 |
>> | 0 |
>> |   |
>> |   |
>> 
>> (org-table-sort-lines nil nil nil nil t) (numerically 'n' gives)
> ...
>> 
>> So no empty lines, what the hell is going on here?


> The reason is probably that the function 'string-to-number' return 0 for
> anything that cannot be converted to a number.

> Thus, as far as sorting is concerned, "not a number cells" and "cells
> containing zeros" are the same and can be put in any arbitrary order.

I am confused:

https://en.wikipedia.org/wiki/Natural_number 

States that Some definitions, including the standard ISO 80000-2,[3][a] begin the natural numbers with 0, so I thought this is standard emacs/org uses. This seems not to be the case, am I right
the funny thing is if I chose 
(org-table-sort-lines nil nil nil nil t) alphabetically

It does the right thing, bizarre.

Uwe 









-- 
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [more absurd]
  2022-07-03 19:29     ` [more absurd] Uwe Brauer
@ 2022-07-03 19:44       ` Bruno Barbier
  2022-07-03 19:58         ` Uwe Brauer
  0 siblings, 1 reply; 17+ messages in thread
From: Bruno Barbier @ 2022-07-03 19:44 UTC (permalink / raw)
  To: Uwe Brauer, emacs-orgmode

Uwe Brauer <oub@mat.ucm.es> writes:
>
> I am confused:
>
> https://en.wikipedia.org/wiki/Natural_number 
>
> States that Some definitions, including the standard ISO
> 80000-2,[3][a] begin the natural numbers with 0, so I thought this is
> standard emacs/org uses.

I don't know, sorry.

> This seems not to be the case, am I right
> the funny thing is if I chose 
> (org-table-sort-lines nil nil nil nil t) alphabetically
>
> It does the right thing, bizarre.

Does it ?

    |  2 |
    |  1 |
    |  1 |
    | 02 |
    |    |
    |    |

Not for me:

    |    |
    |    |
    | 02 |
    |  1 |
    |  1 |
    |  2 |

Bruno

>
> Uwe 
>
>
>
>
>
>
>
>
>
> -- 
> I strongly condemn Putin's war of aggression against the Ukraine.
> I support to deliver weapons to Ukraine's military. 
> I support the ban of Russia from SWIFT.
> I support the EU membership of the Ukraine. 


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [more absurd]
  2022-07-03 19:44       ` Bruno Barbier
@ 2022-07-03 19:58         ` Uwe Brauer
  2022-07-03 20:14           ` Bruno Barbier
  0 siblings, 1 reply; 17+ messages in thread
From: Uwe Brauer @ 2022-07-03 19:58 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 952 bytes --]

>>> "BB" == Bruno Barbier <brubar.cs@gmail.com> writes:

> Uwe Brauer <oub@mat.ucm.es> writes:
>> 
>> I am confused:
>> 
>> https://en.wikipedia.org/wiki/Natural_number 
>> 
>> States that Some definitions, including the standard ISO
>> 80000-2,[3][a] begin the natural numbers with 0, so I thought this is
>> standard emacs/org uses.

> I don't know, sorry.

>> This seems not to be the case, am I right
>> the funny thing is if I chose 
>> (org-table-sort-lines nil nil nil nil t) alphabetically
>> 
>> It does the right thing, bizarre.

> Does it ?

>     |  2 |
>     |  1 |
>     |  1 |
>     | 02 |
>     |    |
>     |    |

> Not for me:

>     |    |
>     |    |
>     | 02 |
>     |  1 |
>     |  1 |
>     |  2 |

I am confused what is 02 supposed to mean?

     |   2 |
     |   1 |
     |   1 |
     | 0.2 |

gives

     | 0.2 |
     |   1 |
     |   1 |
     |   2 |

Which is right.

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [more absurd]
  2022-07-03 19:58         ` Uwe Brauer
@ 2022-07-03 20:14           ` Bruno Barbier
  2022-07-03 20:24             ` Uwe Brauer
  0 siblings, 1 reply; 17+ messages in thread
From: Bruno Barbier @ 2022-07-03 20:14 UTC (permalink / raw)
  To: Uwe Brauer, emacs-orgmode

Uwe Brauer <oub@mat.ucm.es> writes:
>
> I am confused what is 02 supposed to mean?

That's a leading 0 digit, that can be ignored.

   (string-to-number "02") => 2

Alphabetical sorting will see the "0" though and sorts differently.

Bruno








^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [more absurd]
  2022-07-03 20:14           ` Bruno Barbier
@ 2022-07-03 20:24             ` Uwe Brauer
  2022-07-04  4:31               ` tomas
  0 siblings, 1 reply; 17+ messages in thread
From: Uwe Brauer @ 2022-07-03 20:24 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 411 bytes --]

>>> "BB" == Bruno Barbier <brubar.cs@gmail.com> writes:

> Uwe Brauer <oub@mat.ucm.es> writes:
>> 
>> I am confused what is 02 supposed to mean?

> That's a leading 0 digit, that can be ignored.

>    (string-to-number "02") => 2

> Alphabetical sorting will see the "0" though and sorts differently.

But 02 seems to me a wired mathematical notation to say the least. I
wouldn't use it for sure.

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [more absurd]
  2022-07-03 20:24             ` Uwe Brauer
@ 2022-07-04  4:31               ` tomas
  2022-07-04  5:10                 ` Uwe Brauer
  0 siblings, 1 reply; 17+ messages in thread
From: tomas @ 2022-07-04  4:31 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 606 bytes --]

On Sun, Jul 03, 2022 at 10:24:34PM +0200, Uwe Brauer wrote:
> >>> "BB" == Bruno Barbier <brubar.cs@gmail.com> writes:
> 
> > Uwe Brauer <oub@mat.ucm.es> writes:
> >> 
> >> I am confused what is 02 supposed to mean?
> 
> > That's a leading 0 digit, that can be ignored.
> 
> >    (string-to-number "02") => 2
> 
> > Alphabetical sorting will see the "0" though and sorts differently.
> 
> But 02 seems to me a wired mathematical notation to say the least. I
> wouldn't use it for sure.

Think bigger: 1024 would sort alphabetically /before/ 22. Do you
really want this?

Cheers
--  
t

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [more absurd]
  2022-07-04  4:31               ` tomas
@ 2022-07-04  5:10                 ` Uwe Brauer
  2022-07-04  6:23                   ` tomas
  0 siblings, 1 reply; 17+ messages in thread
From: Uwe Brauer @ 2022-07-04  5:10 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1223 bytes --]

>>>   <tomas@tuxteam.de> writes:

> On Sun, Jul 03, 2022 at 10:24:34PM +0200, Uwe Brauer wrote:
>> >>> "BB" == Bruno Barbier <brubar.cs@gmail.com> writes:
>> 
>> > Uwe Brauer <oub@mat.ucm.es> writes:
>> >> 
>> >> I am confused what is 02 supposed to mean?
>> 
>> > That's a leading 0 digit, that can be ignored.
>> 
>> >    (string-to-number "02") => 2
>> 
>> > Alphabetical sorting will see the "0" though and sorts differently.
>> 
>> But 02 seems to me a wired mathematical notation to say the least. I
>> wouldn't use it for sure.

> Think bigger: 1024 would sort alphabetically /before/ 22. Do you
> really want this?
Do you mean 

| Sort |
|------|
|    0 |
|    1 |
|    1 |
| 1024 |
|   22 |
|------|
|      |
|      |

That really su... (My use case only concerned numbers from 0-10).

So it boils down to the question: why isn't 0 considered as natural numbers, as, according to the Peano axioms, it is?

Uwe 



-- 
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine’s military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine.
https://how-to-help-ukraine-now.super.site/

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [more absurd]
  2022-07-04  5:10                 ` Uwe Brauer
@ 2022-07-04  6:23                   ` tomas
  2022-07-04  6:46                     ` Martin Steffen
  0 siblings, 1 reply; 17+ messages in thread
From: tomas @ 2022-07-04  6:23 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1388 bytes --]

On Mon, Jul 04, 2022 at 07:10:27AM +0200, Uwe Brauer wrote:

[...]

> That really su... (My use case only concerned numbers from 0-10).
> 
> So it boils down to the question: why isn't 0 considered as natural numbers, as, according to the Peano axioms, it is?

I don't know whether you're serious or making fun (Poe's Law and
all that), but actually, Peano's axioms couldn't care less: as
far as they are concerned, natural numbers could well start at
23 or something.

Actually it seems to be some kind of "cultural question" whether
mathematicians start counting at 0 or at 1; my observation is
that they tend to agree across one faculty at one university.
I know positively one that tends to count from 1 (HU Berlin),
another that counts from 0 (Freiburg), both in Germany.

Something for mathematical ethnologists (do those exist?) to mull
over.

I once asked a maths prof and he said foundational folks (set
theorists, math logicians -- that's the typical environment
where you'd tend to stumble upon Peano) tend to favour starting
at 0.

Historically, Peano himself seems to have been a one-counter:

  "Peano's original formulation of the axioms used 1 instead
  of 0 as the "first" natural number,[6] while the axioms in
  Formulario mathematico include zero."  as quoted in [1].

Cheers

[1] https://en.wikipedia.org/wiki/Peano_axioms
-- 
t

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [more absurd]
  2022-07-04  6:23                   ` tomas
@ 2022-07-04  6:46                     ` Martin Steffen
  2022-07-04  7:42                       ` Uwe Brauer
  2022-07-04 12:12                       ` tomas
  0 siblings, 2 replies; 17+ messages in thread
From: Martin Steffen @ 2022-07-04  6:46 UTC (permalink / raw)
  To: emacs-orgmode

>>>>>   <tomas@tuxteam.de> writes:

    > On Mon, Jul 04, 2022 at 07:10:27AM +0200, Uwe Brauer wrote:

    > [...]

    >> That really su... (My use case only concerned numbers from 0-10).
    >> 
    >> So it boils down to the question: why isn't 0 considered as
    >> natural numbers, as, according to the Peano axioms, it is?

    > I don't know whether you're serious or making fun (Poe's Law and
    > all that), but actually, Peano's axioms couldn't care less: as far
    > as they are concerned, natural numbers could well start at 23 or
    > something.

    > Actually it seems to be some kind of "cultural question" whether
    > mathematicians start counting at 0 or at 1; my observation is that
    > they tend to agree across one faculty at one university.  I know
    > positively one that tends to count from 1 (HU Berlin), another
    > that counts from 0 (Freiburg), both in Germany.


In some sense that's defendable (that what could call natural numbers is
a cultural question or historical, like looking at what Peano did nor
did not define).

On the other hand, one normally does not just deals with the numbers as
such, one does something with it (like comparing them or calculating
with them). If one takes the reservoir of numbers (in decimal notation,
{0,1,2,3 .....} indeed it is irrelelvant where to start, 0,1, or
23. Also if one does nothing else than comparing them (that would be
considering them as "ordinals", one has one single smallest number, and
again it's it's irrelevant if that's ``called'' nor notated $0$, "zero"
or "1", or "23".

Now, if one starts doing simple calculations (addition, multiplication),
the natural numbers including 0 is simply more "elegant" or ``richer''
than without. One has laws like n+0 = n, n*0=0 (one then says, 0 is a
neutral element wrt. +, there is terminology for all than, and it's
simply that N with 0 has nicer ``algebraic'' characteristics than
without. It's quite analogous to the choice between defining lists as to
include the empty list '() as a ``natural'' list, or insist on that
``natural'' lists must have 1 or more elements. 


    > I once asked a maths prof and he said foundational folks (set
    > theorists, math logicians -- that's the typical environment where
    > you'd tend to stumble upon Peano) tend to favour starting at 0.


Foundational folks can elaborate on that analogy between lists and nats,
but as you say, in both cases they favor to include 0 to nats and the
empty list to lists (and there are more examples) and it's favored for
good reasons (at least to them).

best, Martin



    > Historically, Peano himself seems to have been a one-counter:

    >   "Peano's original formulation of the axioms used 1 instead of 0
    > as the "first" natural number,[6] while the axioms in Formulario
    > mathematico include zero."  as quoted in [1].

    > Cheers

    > [1] https://en.wikipedia.org/wiki/Peano_axioms -- t



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [more absurd]
  2022-07-04  6:46                     ` Martin Steffen
@ 2022-07-04  7:42                       ` Uwe Brauer
  2022-07-04 12:16                         ` tomas
  2022-07-04 12:12                       ` tomas
  1 sibling, 1 reply; 17+ messages in thread
From: Uwe Brauer @ 2022-07-04  7:42 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2239 bytes --]




> In some sense that's defendable (that what could call natural numbers is
> a cultural question or historical, like looking at what Peano did nor
> did not define).

> On the other hand, one normally does not just deals with the numbers as
> such, one does something with it (like comparing them or calculating
> with them). If one takes the reservoir of numbers (in decimal notation,
> {0,1,2,3 .....} indeed it is irrelelvant where to start, 0,1, or
> 23. Also if one does nothing else than comparing them (that would be
> considering them as "ordinals", one has one single smallest number, and
> again it's it's irrelevant if that's ``called'' nor notated $0$, "zero"
> or "1", or "23".

> Now, if one starts doing simple calculations (addition, multiplication),
> the natural numbers including 0 is simply more "elegant" or ``richer''
> than without. One has laws like n+0 = n, n*0=0 (one then says, 0 is a
> neutral element wrt. +, there is terminology for all than, and it's
> simply that N with 0 has nicer ``algebraic'' characteristics than
> without. It's quite analogous to the choice between defining lists as to
> include the empty list '() as a ``natural'' list, or insist on that
> ``natural'' lists must have 1 or more elements. 




> Foundational folks can elaborate on that analogy between lists and nats,
> but as you say, in both cases they favor to include 0 to nats and the
> empty list to lists (and there are more examples) and it's favored for
> good reasons (at least to them).

That is the first time I remember that on this list, questions of the
foundation of mathematics are discussed 😉

Back to the point, maybe I am too conservative, but I would include 0
within the natural numbers, and the example I started with, needs to
cover that case (student marks range between 0 to 10 both included), so
sorting should work (for me) in that case.

I don't see, so far any benefit for not considering 0 in that sorting
process.












-- 
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [more absurd]
  2022-07-04  6:46                     ` Martin Steffen
  2022-07-04  7:42                       ` Uwe Brauer
@ 2022-07-04 12:12                       ` tomas
  2022-07-04 13:18                         ` Martin Steffen
  1 sibling, 1 reply; 17+ messages in thread
From: tomas @ 2022-07-04 12:12 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 885 bytes --]

On Mon, Jul 04, 2022 at 08:46:11AM +0200, Martin Steffen wrote:

[...]

> In some sense that's defendable (that what could call natural numbers is
> a cultural question or historical, like looking at what Peano did nor
> did not define).
> 
> On the other hand, one normally does not just deals with the numbers as
> such, one does something with it (like comparing them or calculating
> with them) [...]

Yes, since Uwe mentioned Peano, that's why I pointed out that
Peano doesn't care (you have to get to algebra, i.e. "up" in
the conventional foundational ladder) for 0 to have a special
role.

About the cultural thing... you seem to be a zero-counter (as
I am, too): there, too, I think that "our" position isn't in
any way "better" -- some theorems look better this way, some
that way; some inductions are easier to start at 1, some at
0.

Cheers
-- 
t

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [more absurd]
  2022-07-04  7:42                       ` Uwe Brauer
@ 2022-07-04 12:16                         ` tomas
  2022-07-04 13:59                           ` Uwe Brauer
  0 siblings, 1 reply; 17+ messages in thread
From: tomas @ 2022-07-04 12:16 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 986 bytes --]

On Mon, Jul 04, 2022 at 09:42:01AM +0200, Uwe Brauer wrote:

[...]

> That is the first time I remember that on this list, questions of the
> foundation of mathematics are discussed 😉

Such things happen :)

> Back to the point, maybe I am too conservative, but I would include 0
> within the natural numbers,

If you really were, you wouldn't. Peano himself didn't ;-)

> and the example I started with, needs to
> cover that case (student marks range between 0 to 10 both included), so
> sorting should work (for me) in that case.

See? I went to school in Spain, so I know about that 0..10 scale.
But then I went to school in Germany, so I also know about the
6..1 scale. Go figure :)

> I don't see, so far any benefit for not considering 0 in that sorting
> process.

But your concrete problem isn't a sorting process at all, just a
conversion process: empty space gets translated to zero. As someone
else found out in this thread.

Cheers
-- 
t

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [more absurd]
  2022-07-04 12:12                       ` tomas
@ 2022-07-04 13:18                         ` Martin Steffen
  0 siblings, 0 replies; 17+ messages in thread
From: Martin Steffen @ 2022-07-04 13:18 UTC (permalink / raw)
  To: emacs-orgmode

>>>>>   <tomas@tuxteam.de> writes:


    > About the cultural thing... you seem to be a zero-counter (as I

I guess I am, by maybe have not been a zero-counter from the start, but
a 1-counter. I vaguely remember to have learnt (at school? beginning at
university?) that ``THE natural numbers'' (the ones Kronecker claimed to
have been created by God) start with $1$. There are referred to by
$\mathbb{N}$, and then there's also some versions, written
$\mathbb{N}_0$ (THE natural numbers ``extended'' by 0), they can be
handy too, sometimes.


From a constructivistic point of view (and as a computer scientist, one
is obliged to have a constructivist view), for me 0 belongs to the most
natural way of defining natural numbers.

The fact that some theorems or facts are stated better this way or the
other is minor (as long as it's not that the vast majority of math on
Nats gets simpler without 0 (or with 0). One would also not work with
Nats starting at two like Nat ={2, 3,4,...}, for the extravagant
advantage to avoid stating clumsily a special-case condition ``a prime
number is a natural number larger or equal 2 and only divisible by 1 or
itself'' (if one thinks 1 and 0 are better not included in the prime
numbers, as most would do).

Constructing the nats from first principles seems to me a Nat is either
0, or the successor of a nat (succ n). Also for lists (and in complete
analogy): Lists are either empty () or built from cons-ing an element to
a list.

An analogous construction would of course also work using 1 as base
case resp. a one-element list as basic constructor. But it ``feels''
less natural for me in the meantime.


[talking about programming and data structures: while I think from a
practical (and aesthetic) point of view, lists should include the empty
list, and not start with lists of length 1 (likewise that functions
should be allowed to have a 0-length input parameter list), I found it
interesteding that _internally_, lists and similar data structures are
often usefully implemented with some ``sentinel'' node, i.e., the empty
lists is represented by some ``dummy cell'' in memory (not by
``nothing''), and a list of length n has additionally one such dummy
cell at the end, say, to make walking through the list, resp. checking
for the end more smooth and uniform, sometimes.]















    > am, too): there, too, I think that "our" position isn't in any way
    > "better" -- some theorems look better this way, some that way;
    > some inductions are easier to start at 1, some at 0.

    > Cheers -- t



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [more absurd]
  2022-07-04 12:16                         ` tomas
@ 2022-07-04 13:59                           ` Uwe Brauer
  0 siblings, 0 replies; 17+ messages in thread
From: Uwe Brauer @ 2022-07-04 13:59 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1731 bytes --]

>>>   <tomas@tuxteam.de> writes:

> On Mon, Jul 04, 2022 at 09:42:01AM +0200, Uwe Brauer wrote:
> [...]

>> That is the first time I remember that on this list, questions of the
>> foundation of mathematics are discussed 😉

> Such things happen :)

>> Back to the point, maybe I am too conservative, but I would include 0
>> within the natural numbers,

> If you really were, you wouldn't. Peano himself didn't ;-)

Well, as far as I remember my university first course, he did, and
according to wikipedia https://en.wikipedia.org/wiki/Peano_axioms or you
mentioned German

https://de.wikipedia.org/wiki/Peano-Axiome

He did!

But I have no access right now to his original work
>> and the example I started with, needs to
>> cover that case (student marks range between 0 to 10 both included), so
>> sorting should work (for me) in that case.

> See? I went to school in Spain, so I know about that 0..10 scale.
> But then I went to school in Germany, so I also know about the
> 6..1 scale. Go figure :)

Well, but Germany switched to the 0-15 scale a long long time ago, at least for high school....


>> I don't see, so far any benefit for not considering 0 in that sorting
>> process.

> But your concrete problem isn't a sorting process at all, just a
> conversion process: empty space gets translated to zero. As someone
> else found out in this thread.

Ah right, ok so that seems then a but to me, the whole point of my
sorting is to find empty fields.

Uwe 

-- 
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5671 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2022-07-04 14:33 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-01  5:31 org-table-sort-lines (numerically) leaves 0 separated Uwe Brauer
2022-07-03 18:26 ` [more absurd] (was: org-table-sort-lines (numerically) leaves 0 separated) Uwe Brauer
2022-07-03 19:11   ` Bruno Barbier
2022-07-03 19:29     ` [more absurd] Uwe Brauer
2022-07-03 19:44       ` Bruno Barbier
2022-07-03 19:58         ` Uwe Brauer
2022-07-03 20:14           ` Bruno Barbier
2022-07-03 20:24             ` Uwe Brauer
2022-07-04  4:31               ` tomas
2022-07-04  5:10                 ` Uwe Brauer
2022-07-04  6:23                   ` tomas
2022-07-04  6:46                     ` Martin Steffen
2022-07-04  7:42                       ` Uwe Brauer
2022-07-04 12:16                         ` tomas
2022-07-04 13:59                           ` Uwe Brauer
2022-07-04 12:12                       ` tomas
2022-07-04 13:18                         ` Martin Steffen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.