Monday, July 30, 2012

Infinity in an Hour

- How it Feels to study Pure Mathematics

To see a world in a grain of sand,
And a heaven in a wild flower,
Hold infinity in the palm of your hand,
And eternity in an hour.
- William Blake

I have a master in pure mathematics (it also includes a substantial amount of applied mathematics and physics). People often wonder what is it that we do? And they visualize the most complicated mathematics they know, and they try to take it to the next level mentally. But it is very hard to try to understand something you know nothing of. People who only have a minimum of mathematical knowledge guess "Oh, so you multiply really large numbers", those who had math in high school/college guess "Oh, so you differentiate and integrate difficult functions?", those who have a university education where they needed advanced mathematics guess "Oh, so you solve hard differential equations on difficult grids/spaces?". Today I will endeavor to give a picture of how I feel when doing pure math.

For inspiration, I recommend the following videos. After we have seen them, we will try to do some of this mathematics. Note that we mention Cantor several times.
(Part 2 if you're interested)

Pure mathematics is that of unlimited abstraction and precision. We define everything as precisely as humanly possible, and we try to make everything into abstract concepts. Understanding something in pure mathematics is often like walking a tightrope over an abyss, no room for small deviations or imperfect intuition.

A lot of the problems I think about when working, you would need 4 years of university education just to be able to ask. But now I will use some examples that you need almost no mathematics education to understand.

First we will look at sizes of infinity (this is very close to the paradoxes talked about in the videos above). To talk about size, we have to define it, and size of what?

Definition A set contains elements, and an element is contained in a set.

Example {1,2,3,5} is a set containing the elements 1, 2, 3, and 5.
Example 2 {a, b, car, boat, 99} is a set containing the elements a, b, car, boat and 99.

Definition 3 The size of a set is the number of elements it contains
Example 4 The size of {1,2,3,5} is 4
Example 5 The size of {a, b, car, boat, 99} is 5

Using these definitions, we could have defined a set to be infinite size if it has no finite size. But to be able to speak of different infinity sizes, we have to use a more fine tuned definition.

Definition 6 Two sets are equal if there is a bijection between them
Definition 7 A bijection is a function which maps all the elements of a set to the elements of another set, and where no two elements are mapped to the same.
To understand this last definition, you should see some examples. So look at wikipedias page bijection.
For more information, see function and Bijection-Injection-Surjection.

Now we can state the first question
Question 1 Are there as many even (positive) numbers as there are (positive) numbers in total?
Answer 1 (with proof) Yes. Let E={2, 4, 6, 8, 10, ...} be the set of even numbers, and let N={1, 2, 3, 4, 5, ...} be the set of all numbers. Then we can construct a function, f, from E to N by f(x)=x/2. This function is a bijection. Hence the size of E is the same as the size of N.

How can this be? Clearly the set N contains the set E, and then some, how can they be equal? Well we just proved that they were. The only thing we can conclude form the fact that N contains E is that the size of E is smaller or EQUAL to the size of N.

What we just did is known as Hilbert'sparadox of the Grand Hotel, with Infinitely many new guests. You should look at the link. This is NOT a paradox, this is a well established mathematical fact. What seems to be a paradox is only because our intuition is not used to the concept infinite.

Calculations with infinite
If you use a modern computer program, it often has inf (infinite) as a kind of number. It will normally give the following computations:
inf + 1000 = inf
inf – 1700 = inf
inf + inf = inf
inf*1000 = inf
inf*inf+inf^inf = inf
1/inf = 0
1/0 = inf
inf-inf = NAN
inf/inf = NAN
(-1)^inf = NAN

Here NAN means Not A Number. That is because you are not allowed to do these operations, the result is undefinable (if you chose a definition you would end up with a contradiction). The problem with inf-inf is that we don't know which inf is "largest". In some applications you may get the answer 0, in others 31, in yet others you may get inf.

Countable and Uncountable infinity
The size of the set Z (all finite numers), or the set N (all positive finite numbers), is called countable infinity (the sizes of Z and N are equal). It is easy to prove that the set of all fractions, the rational numbers Q, also has countable size (see http://www.homeschoolmath.net/teaching/rational-numbers-countable.php).

But what about the set R of real numbers (all numbers, including pi and the square root of 2, but not including imaginary numbers), is this also the same size as Z and N and Q? No. This proof is quite deep, and took me several days to understand (several years ago). If you want a challenge, see wikipedia's page on Cantors diagonal argument.


The Length of the Rationals (the set of fractions Q)
There is another very much used notion of size. This is what we use for integration, and to avoid confusing it with the size of sets from before, we call this new thing for length.

Definition The length of an interval on the real line, is the right endpoint minus the left endpoint.
Example We write [-3,7] for all the numbers between -3 and 7 including -3 and 7. The length of this interval is 7-(-3) = 10.

We can generalize this concept of length to other sets than intervals, for example to the union of intervals. Not surprisingly we get:

Theorem If one set is contained in an interval, the length of the set is smaller or equal to the length of the interval.

Supertheorem: The size of Q is countably infinite, but the length of Q is 0 (on the real line).

Proof: We have already seen that the size of Q is countably infinite. What about its length? Well, write Q as a sequence Q={q1, q2, q3, q4, ...} where all qi are fractions. Let K>0 be any arbitrary number (for example 0.000000001). Then the first fraction, q1, is contained in an interval of length K, namely [q1-K/2, q1+K/2]. The second fraction is contained in an interval of half that length (namely [q2-K/4, q2+K/4]). The third fraction q3 is contained in an interval with half that length again. Let us sum up this:
q1 contained in an interval of length K
q2 contained in an interval of length K/2
q3 contained in an interval of length K/4
q4 contained in an interval of length K/8
q5 contained in an interval of length K/16
...
So Q must be contained in the union, which will be an set with size smaller than (smaller because some of the intervals may overlap):
K + K/2 + K/4 + K/8 + K/16 + ... = 2K
How to calculate this? This is what we call a geometric series.

What do we now know? Q is contained in something of length 2K (you can choose any K>0). Hence the length of Q is smaller or equal to 2K (you can choose any K>0). The only possibility is that the length of Q is 0. QED.


-------------------------------------------------------------------------------------
Comment by Nok er Nok:



I'll keep beating the same horse as always, I guess. We have spent some time discussing these questions and generally agree, but I can't help but object to the following paragraph. I have mostly the same knee-jerk reaction to it as the Newcomb's paradox, Hangman's paradox, etcetera. On the whole, I'll even illustrate my point with an XKCD strip (gasp!),  http://xkcd.com/169/   , though I'm not sure if the miscommunication is intentional or not.

"What we just did is known as Hilbert'sparadox of the Grand Hotel, with Infinitely many new guests. You should look at the link. This is NOT a paradox, this is a well established mathematical fact. What seems to be a paradox is only because our intuition is not used to the concept infinite."

This is most certainly a paradox. The mathematical formalism you describe and which mathematicians use is consistent and useful, yes, that's not what I'm trying to deny. Using that formalism to claim there are -as many- even numbers as natural numbers, however, is dishonest; using layman's terms in that manner -creates- the paradox. Nobody protests against the bijection-wizardry which is firmly belonging to alternate math-dimension. They do, however, have issues with mathematicians redifining common English words to mean something entirely different, and then marveling at how counterintuitive it is - particularly when they a few moments later set the trap by mixing real world example, impossible mathematical constructs, normal English and indistinguishable mathematical definitions.


Let's deconstruct Hilbert's Hotel to start with, and let's pretend we are not familiar with the mathematical formalism for dealing with infinities. Hilbert then claims the following:

 - hotel with infinite number of rooms
 - infinite number of guests at the hotel
 - such that all rooms are occupied, each by a single guest
which is all fine and dandy, but sets up for the counterintuitive conclusion
 - the hotel can still house another group of guests, exactly as large as the number which currently occupies every single room

Now, if you look at that without consulting your English<->Mathematics dictionary, you will surely conclude that this is perfect nonsense. Somebody is pulling a cheap parlour trick on you, one of these words have to mean something else that is appears. You can easily construct equally (more?) valid arguments than Hilbert presents, to show that the conclusion is impossible. For instance, it is easy to visualise that no room will be left unoccupied after you swap any two guests between their respective rooms, any number of times, and even though Hilbert does this an infinite number of times, this shouldn't change anything.


The parlour trick here is, of course, that occupied does not mean occupied at all, it has to do with bijections, and infinity does not mean a number you can increment arbitrarily many times, it is instead some mathematical construct with such properties that it cannot possibly have anything to do with any actual hotel. You might say the point of Hilbert's Hotel is that infinity cannot be treated as just any large number, you claim that our intuitions are not prepared to deal with infinity, but I strongly disagree. Hilbert's Hotel only shows that the mathematical lingo he ends up translating to 'occupied' and 'infinity' has nothing to do with a normal understanding of these words.

Taken as a story to accompany the mathematical formalism, to illustrate how it handles infinities, cardinality and size as something to do with bijections, it does an okay job. Without that context, it is not the slightest bit clever or enlightening, but just a load of gibberish. Hilbert's Hotel says -nothing- -whatsoever- about how hotels of arbitrary size work; it intentionally mixes mathematical formalism with a real world example which it then -fails to describe-!


Of course, all of this comes from the same sort of people who with a straight face will call f(x) = constant  an increasing function - and a decreasing one, at the same time. Nevermind that increasing is a code word for non-decreasing, which you cannot know without consulting your Google-translate English<->Mathspeak, or being familiar with the tradition of inclusive definitions in mathematics.

I think inclusive definitions are useful, and I'm not quite decided on whether using somewhat familiar but inaccurate and misleading terms is better than inventing new, arbitrary ones. However, I'm certainly not going to give mathematicians any credit for clever paradoxes which does nothing but illustrate that the mathematicians themselevs do not understand that their redefined words cannot be inserted into common English prose without appropriate and careful translation.


As an endnote, I feel fairly certain that it would be very possible to develop a formalism in which the natural numbers, the even numbers, the prime numbers and so on and so forth were -not- the same size. Of course, these alternate defintions would not develop fruitfully into integration and cardinality, like the current one does, but this alternate mathematics would be able to present the exact same Hilbert Hotel and the exact opposite conclusion; the hotel -cannot- accomodate even one more guest, much less another infinity of them. Or perhaps they would balk the moment you suggested that every one of the infinite number of rooms is currently occupied. And if this is true, it should be all the more obvious why Hilbert's Hotel is, indeed, a paradox of sorts.  


----------------------------------------------------------------------------------------

Tuesday, July 17, 2012

Morality from Evolution


-Prisoners dilemma, tit for tat, and cheating.

Today I want to look at how the (Darwinian) Theory of Evolution can model morality from purely egoistic assumptions.

Let us quickly recap the assumptions of Darwin:
  1. There are more offspring than can survive (there would be exponential growth if everyone survived) (survive means: have offspring, not survive forever).
  2. There are differences between offspring.
  3. These differences are heritable (if your father is taller than average, we expect you to be – this only needs to be statistically true)

The conclusion then follows:
Those traits we see after many generations are the traits that is well suited to survive the environment (survive still means: have offspring). Note also that you cannot develop a complicated trait without there being several stages of beneficial traits leading up to this complicated trait.

In morality we have a principle known as "tit for tat". Tit for tat is: "Do unto another as another has done unto you". If Sam helps you, then the next time you help Sam. If Sam steals from you, then you steal from Sam.

We will discuss how this principle (tit for tat) can follow from the Theory of Evolution and purely egoistic assumptions. First let us define our environment/setup/problem, what is known as the iterated prisoner's dilemma.

The prisoner's dilemma has its name for a reason, but for reasons of clarity of exposition I will present it differently. It goes as follows. You and Joe find some food in the jungle (think about our ancestral environment). You and Joe get two options: Fight or Cooperate. You can choose different actions. Results are as follows:
  1. Both cooperate: Both get 3 (units of) food
  2. Both fight: Both get 1 food
  3. A fights while B cooperates: A gets 4 food, B gets 0 food.
Note how this is supposed to model how food is ruined (the prey escapes etc) when someone fights (in case 2 we loose 4 food, in case 3 we loose 2 food). We assume that the choice you and Joe picks are independent (you cannot wait and see what he chooses).

How is the prisoner's dilemma soled by two egoistical entities? If you and Joe are egoistic you will always choose to fight. Does this make any sense when both could have more food if both of you cooperated? Yes, as the choice is independent. No matter which choice Joe picks, it's always better for you to fight than cooperate. In that way outcome 2) is recognized as a stable Nash equilibrium (anyone seen the film "A beautiful mind"?).

Before we go on to iterate this problem, I want to take a small digression. How can we model the solution of a single prisoner's dilemma? Well, we can have utilitarianism (everyone's welfare is important) instead of egoism, but that was not our assumptions. One common solution is "kin selection". If Joe is your brother, then his survival will bring your genes (statistically about half of them) down the line. So his survival is half as important as yours: He getting 4 food has value 2 to your genes, but you getting 1 food each has value 1.5. This makes cooperating always better for your genes. (We just assumed probability of survival is linearly dependent on amount of food.) But what about your friend, they are not of your blood, can you still have kin selection? Before modern transportation it was highly likely that your children would have kids with the children of one of your friends some day. This might (with a slightly different setting, and some more assumptions) make cooperating with your friends a good strategy. From now on we assume that the two '
'prisoners' are complete strangers with nothing in common.

What its iterated prisoner's dilemma? Well, you go hunting with Joe every week for a few years. Now, every week you make a new choice, independent of Joe, whether you should fight or cooperate. But now you are allowed to remember everything that has happened up to this point. Now you are allowed to choose "Because Joe did X last time, I will do X now", which we called the tit for tat strategy. NB: you always start by cooperating. What is special about this strategy? It is essentially unbeatable. Let us disregard small deviations (like tit for tat with forgiveness or extra randomness). What does unbeatable mean? If you have a population of 100 people, each with their own strategy; some of them with the tit for tat strategy, some of them with completely different strategies then no one will get more food than you if everyone plays the iterated prisoners dilemma against everyone else (and you are using tit for tat). (This also relies on the assumption that the world is not dominated by a big number of tit for tat haters whose strategy is discovering the 'tit for tat strategy users' and killing them.)

Now the Theory of Evolution concludes that after many generations, everyone will have something close to the tit for tat strategy. Yes, this is dependent on even more assumptions. Maybe we should model this on the computer one of these days?