[an error occurred while processing this directive] Finish functions: Briefly — A few summations. See a quick review [pdf]. Rosen (3.2) has some common sums (though I wish he'd have used b as the base of the exponent rather than x.) The sums that are important to commit to memory are:

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).

Cardinality

("Some infinities are bigger than others") Reading: Rosen 3.2.

Hotel Infinity

(Adapted from Martin Gardner): Hotel Infinity has an infinite number of rooms — numbered 1, 2, 3, …. (Presumably, it's located in Vegas.)

More Formally

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.
The proof can't quite be the same as our proof for N vs ℜ:
Why not? Consider showing there's no bijection in ℜ→P(ℜ).
We can't talk about the i'th row of the table (f(i)), because we've already shown ℜ uncountable.

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+… = 0
with
1+(-1+1)+(-1+1)+… = 1+0+0+0+… = 1
with
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]