Note that, like big-union, we can index over sets rather than numbers: ∑i∈{2,4,6}i = 12.
Because the sum of zero elements is defined to be 0, we can write ∑i∈∅i = 0; even a bit more generally we can write ∑i∈∅f(i) = 0, for any function f.
In fact, summing over a (possibly empty) set
can make sense of how to interpret summation indices that otherwise
seem ill-defined:
Consider that
∑i=abf(i) means
"sum over all integers in [a,b]", so:
∑i=55f(i) = ∑i∈{5}f(i) = f(5), and
∑i=54f(i) = 0.
Why on earth would you ever give an upper index which is smaller than
the lower index?
Consider
for any list data, consider ∑i=0data.length()-1f(data.get(i)) …and some smart-aleck comes along and insists on knowing what this sum means in the case that data.length() is zero (making the upper index -1).
(Adapted from Martin Gardner): Hotel Infinity has an infinite number of rooms — numbered 1, 2, 3, …. (Presumably, it's located in Vegas.)
Marie is working the front desk, listening to a nice Paul Simon album on her iPod, happy that the hotel is empty and there is no work to do. But then a bus pulls up for an ``Elvis Forever'' convention. She is mildly surprised that it's an infinitely long bus — she had no idea Elvis had so many fans. Suddenly grateful she didn't take a job at a mere finite hotel, can easily accomodate all the guests: She gets on the PA, and announces that the passenger sitting in seat#i is booked into room#i.
Note that there is no mysterious ``room #∞''; each guest has been given an honest-to-gosh room number.
(When the first guest tips her a silver half-dollar, she is suddenly excited about how much she'll make on tips from this bus. Alas, each guest tips only half of what the previous guess did. Oh well. At least they each take half the previous guest's time to find their room, so everybody is settled after a little while.)
Okay, now Marie is feeling pretty smug, having successfully booked more than two infinite busloads into the hotel. She's amused to note that at dinner time, when all the guests pile into a bus to go to the buffet, only one of the infini-buses is needed. (Each guest takes their current hotel room number, and uses that as their seat#.)
The title track of Graceland is just finishing, and she glances out the window at the hotel's infinite parking lot. To her horror, the parking lot has filled up: not only did the dinner bus return (parking in one of the spots), but an infinite number of other infini-buses have also pulled up, full of strapping young mathematicians screaming ``Viva, Las Vegas'', ready to hit the slots. (``This must be Heartbreak Hotel Infinity'', she sighs.)
Marie is unsure of how to try to book all the guests, but her
evil boss — who often seems like the devil in disguise — walks
by and glibly asks her to not only handle all these guests, but to
also keep an infinite number of rooms empty tonight,
(``just in case a Mystery Train arrives'').
What to do?
solution: Marie realizes she can't fit the busloads sequentially one after another (since bus#2,seat#1 must be assigned an actual room number, not something like ``room# $infin;+1''.) And, she can't quite try the previous trick of booking one busload at a time (each time interleaving the busload with the current guests); that would take forever! Thinking quickly, she decides to indeed try the idea of interleaving the busloads, but somehow interleaving all the busloads simultaneously.
She decides to put everybody from the first bus in to rooms 21, 22, 23, 24, …. That is, the person who arrived in bus#1,seat#i is assigned to 2i.
For the second Bus, Marie can use a similar trick, using rooms
31, 32, 33, 34, ….
That is, the person who arrived in bus#2,seat#i is assigned to
3i.
After a moment of thought, it's clear that nobody from buses #1 and #2 will
be accidentally assigned to the same room.
What about the third bus? She can't stick them into powers-of-4 rooms;
those were all already taken up by the powers-of-2 people (from the first bus).
Well, okay, she can skip powers of 4 and instead use rooms
51, 52, 53, 54, ….
That is, the person who arrived in bus#3,seat#i is assigned to
5i.
Again, it is clear that there won't be any conflicting room-assignments
among people from buese #1,#2,#3.
What is a general rule for Marie to announce on the PA, so every bus can debouch? There are several options, but Marie stumbles onto this:
The person in bus#j, seat#i will be booked into room# (the j'th prime)i.We are happy with this: It is not hard to argue that under this scheme, no two different people get assigned to the same room (by unique decomposition into primes). Indeed, this also happens to leave many rooms empty, since only perfect-powers-of-primes get booked. (e.g. empty rooms include 6=2⋅3, 15=3⋅5, etc.).
We say that Marie has shown that ``a countable union of countable sets is still countable''.
Okay, let's address these questions by being more formal than a Hotel.
Def'n: Sets A and B have the same cardinality if there is a bijection between them.My personal visualization: a set of domino tiles, with members of A written on one side, and members of B written on the others.
What is a bijection between N and 2N? Between N and Z?
f:N → Z, where f(n) = { n/2 if n even, { -(n+1)/2 if n odd
Def'n: a set is countable or
countably infinite or enumerable, if there
is a bijection with N.
This is because an enumeration of the set (counting its elements)
is tantamount to a bijection with N.
[Note: sometimes countable is used to include finite sets;
always ask if it's unclear from context.]
The cardinality of N is sometimes written aleph-null.
Countably infinite sets are those that exactly fit into Hotel Infinity —
the room-assignment is the bijection.
Note that there can be different room-assignments that don't fill up the hotel
(and room-assignments that fill up the hotel and leave some people
sleeping in their bus overnight).
But to show a set is countably infinite, you just need to show one good
bijection, ignoring lots of functions which aren't full bijections.)
Aside: sometimes we say countably-infinite sets are "isomorphic to N". isomorphic means "the same up to re-labeling". This use is appropriate if we're just considering the set, w/o considering relations on the set. If there are relations (like "<") that we want to preserve, then "isomorphic" is stronger than just "same cardinality".
Hmmm, meta-clue: this term suggests there are infinite sets that aren't countable! (Is there an aleph-one?)
Are the following sets countable (enumerable)?
Diagonalization proof that N !~ [0,1].
We'll show that any function f:N→[0,1] can not be onto.
We will construct (the decimal representation of) a number x,
such that forall i, f(i) &neq; x.
Thus, there wouldn't an i such that f(i)=x, so f isn't onto.
But, can we really make such an x?
Yes, cleverly:
Let x be made so that its i'th decimal place is
the i'th decimal place of f(i) plus 1. (Wrap-around 9+1=10 to 0).
[see Rosen]
Note one glitch:
We said, "any f(i) differs from x in the i'th
decimal, so they're different".
This seems clear, until we realize the implicit reasoning:
If two numbers have different decimal representations, they're different.
This isn't true: Consider 0.24999999…, and 0.250000….
How to fix the proof?
It turns out, the only non-unique representations stem from the
999…/000… different, so if the differing decimal-places
don't involve 9 and 0 then indeed the numbers are different.
[Math students can worry about proving this.]
So we can patch: instead of making our i'th decimal place
by the f(i)[i]+1, we can make it f(i)[i]+2 (wrapping around — "mod 10").
This is called a "diagonalization proof".
Lemma: |[0,1)| = |[0,∞)|.
We'll construct an exlicit f, and show it's 1-1,onto.
Thinking…try f(x)=(x/1-x). Yep, that'll do it:
f(x)=x/(1-x) is one-to-on and onto [0,infty):
Lemma: |[a,b)| = |[c,d)|.
Proof: left to reader.
Lemma: |[0,infty)| = |(-infty,+infty)|.
Proof: Left to reader.
Hint: partition [0,infty) into intervals,
then have each interval map to "an interval twice as wide",
alternatingly positive and negative.
One glitch: make sure 0 isn't mapping to the same thing twice!
An uncountable set: P(N).
Th'm [Cantor]: For all sets A, there is no bijection A → P(A).Proof left to the reader.
Hint: ignoring for the moment that we can't make a table, imagine:
a table with the elements of A down the left side and across the top,
and a T/F in every cell.
Each row represents a subset of A:
to see if the 3rd element of A is in a ``row'', see if the third
entry of the row is T.
(Each entry in the table is isomorphic to a real number;
and for every real number there is possible subset.)
Hint: try something like the Russel paradox "all sets not containing themselves", but somehow in terms of A and P(A).
Handy th'ms:
Continuum hypothesis: Is ℜ the smallest uncountable set?
That is, is there an uncountable set A such that |N| < |A| < |ℜ|?
This is one of Hilbert's 26 problems of 1900.
Resolution: take it or leave it; you get a consistent (sound)
system either way. (At least, as sound as the current system :-)
Looking back:
We use the term "cardinality" of sets, and have formally defined it.
Some of the results are strange.
For instance, the reals in [0,1] have the same cardinality of
the reals in [0,2] and even all R. But in other senses we
don't want to throw away the fact that somehow there do seem to
be twice as many elements of [0,2] than of [0,1]; "Measure Theory"
is the branch of math dealing with trying to recapture this notion.
That doesn't invalidate the work here, since we can compare sets over
entirely different domains (e.g. real numbers, and infinite-length-strings.)
Also, beware doing arithmetic on infinite sums, etc. Consider:
1 - 1 + 1 - 1 + 1 - 1 + …Since addition is finite-associative, we might expect it to be infinite-associative. But if it were, then compare:
(1-1)+(1-1)+(1-1)+… = 0+0+0+… = 0with
1+(-1+1)+(-1+1)+… = 1+0+0+0+… = 1with
1+1+1+1+(1-1)+(1-1)+(1-1)+… = 4+0+0+… = 4 (where we have just shifted each -1's each eight places down -- a common enough re-indexing technique).[Exercise: write the original and this version as sums indexed to infinity.]
By re-associating and re-indexing, we can easily contrive to get any integer we want as the ostensible sum of this series. The upshot of course, that this sum is not defined, even though it initially feels like it should be. The bigger picture is that finite-associate doesn't imply infinite-associate.
[an error occurred while processing this directive] [an error occurred while processing this directive]