Does Python need a '>>>' operator?
David Eppstein
eppstein at ics.uci.edu
Tue Apr 16 02:30:42 EDT 2002
In article <a9gcmq$bmb$1 at nntp9.atl.mindspring.net>,
"Andrew Dalke" <dalke at dalkescientific.com> wrote:
> It's a set whose complement (that is, the set containing everything
> which isn't in the original set) is finite.
>
> For example, in integers the set
>
> ...-3, -2, -1, 0, 1, 3, 4, 5, 6, 7, ...
> ^^^ 2 is missing
>
> is cofinite because its complement, which is {2}, is finite.
>
> The set of even integers is not a cofinite subset of the integers
> because its complements, the odd integers, is also infinite.
>
> They are relevant here because bits can only be constructed either
> explicitly (you need to say them) or though operators. Operators
> like 'and' and 'or' don't make infinite sets, but 'not' does.
> This value cannot be represented directly as an infinite set of
> bits, but can be represented as a finite set of bits and a flag
> that says "use the complement." There is no way to construct
> a bitlist using these operators (in finite time) which is not
> either finite or cofinite, which means there is a relatively
> easy way to store these calculations on a computer.
If you did extend long integers (interpreted as finite and cofinite
bitstrings) to bitstrings that are neither finite nor cofinite, you
would end up with an interesting mathematical set known as the 2-adic
integers. Two 2-adic numbers are close to each other if their
difference is divisible by a high power of 2. The ones for which the
bitstring is periodic (except for a finite number of positions) can be
thought of as representing rational numbers with odd denominator. But
the 2-adics also contain certain irrational numbers such as a square
root of 17 (not equal to the real-number sqrt).
I imagine it wouldn't be especially difficult to implement the periodic
bitstrings. But beyond mathematical cuteness I'm not sure what good it
would be...
--
David Eppstein UC Irvine Dept. of Information & Computer Science
eppstein at ics.uci.edu http://www.ics.uci.edu/~eppstein/
More information about the Python-list
mailing list