Operator Precedence/Boolean Logic

Steven D'Aprano steve+comp.lang.python at pearwood.info
Thu Jun 23 05:17:25 EDT 2016


On Thursday 23 June 2016 18:32, Andreas Röhler wrote:

> There is a fundamental diff between zero and emptiness.

In English, "emptiness" implies a container (real or figurative). The container 
is not "something or nothing", it is the *contents* being referred to.

"This shopping bag is empty" doesn't mean the shopping bag is nothing. It means 
that the set of items in the bad is the null set, i.e. there are ZERO items in 
the bag.

"My fridge is empty" doesn't mean that the fridge is nothing. It means that the 
set of items in the fridge is the null set, i.e. there are ZERO items in the 
fridge.

"That guy's head is empty" doesn't mean his head is nothing, it means that the 
set of thoughts in his head is the null set, i.e. he has ZERO thoughts. (This, 
of course, should be read figuratively, not literally.)


> Zero is just a relation in the realm of integers. It tells being in the
> midst between positiv and negativ infinity.

No, zero is not "a relation". It is an integer, and a very special one.

- zero is neither positive nor negative;
- zero is the additive identity: n+0 == n
- zero is multiplicative nullity;  n*0 == 0
- division by zero is undefined.

It is an artifact of the way we draw the number line (a *picture*) that zero is 
halfway between positive and negative:

<----------------------+------------------------>
  -4   -3   -2   -1    0    1    2    3    4

We could have draw it like this, with zero at the extreme left hand end:


  -3 /
 -2 /
-1 /
0 +
 1 \
  2 \
   3 \

although that would make graphing look a bit weird. 

(That's what we do with the extended Reals: we bend the number line around in a 
circle, with 0 at one pole and ±infinity at the other.)

But don't confuse the concrete representation of numbers on a line with the 
abstract numbers themselves.

In practical sense, there is a difference between having zero sheep and having 
one sheep, two sheep, three sheep, ... and of course nobody has even actually 
had negative one sheep.


> Number one tells being one unit towards positiv infinity in relation to
> negativ infinity. And so on.
> 
> Whilst emptiness tells about non-existence.

We can derive arithmetic from set theory. Zero is very special: it is defined 
as the empty set:

0: {}

The successor of zero (namely, one) is the set of all empty sets:

1: {{}}

Two is the set of zero and one:

2 = {{}, {{}}}

and so forth.



-- 
Steve




More information about the Python-list mailing list