Here is a clever problem:

Let us fix . Take at random, with uniform probability, a binary matrix (call it ).

Let: .

(You can think of it as taking determinant of matrix normally and asking for aprobability that it is odd number.)

Find the value of:

(It’s not **that** gamma! Although, it is still related to Euler!)

Let’s clarify it by looking into some examples.

because

and

because

A few consecutive values are:

Looks converging, doesn’t it?

For me, it is surprising that such a limit can be nontrivial, I would rather expect it to be either 1 or 0.

If we treat columns of matrix as binary vectors: ,

then iff the column vectors are *linearly independent* (in a world). So maybe we can look at this as we were taking at random binary vectors?

But, are linearly independent, iff are, **and** is not in the linear space spanned by .

So by adding another vector, we can only break independence. If after steps the vectors are still independent,

the linear space they span is of size , so we have probability of success at next step.

(Why?)

That gives us:

So.. we are sure that the limit exists (decreasing sequence bounded from below is always converging), but we have no guarantee that the constant is non-trivial. And here starts the fun part!

Lets look at the function:

(if we skip some boring first terms)

If we continue to multiply additional term (from now on), we’re unable to modify the terms earlier than . So we know, that starting terms are:

Another observation states is that most of the terms vanish to 0, and rest are 1 and -1. (There happen to be 2, but it is in the are that haven’t stabilized yet.)

The function ,

as we recall from combinatorics course, is a *generating function* of a *number of partitions without repetitions*:

Our is also a generating function of a sequence of partitions without repetitions, but the one where we count partitions into *even* number of terms as +1, and into *odd* number of terms as -1. So for example:

, so

And here real magic starts.

According to pentagonal number theorem, for almost every natural number, the number of odd and even partition is identical, so our term is 0. The proof is constructive one, shows a bijection (please click the link for pretty pictures, they enough to see the bijection). The proof fails for numbers known as *pentagonal numbers*.

Long story short (please, look at the proof at wikipedia page), we get:

where

is k-th pentagonal number (defined for both positive and negative k).So we can enumerate some more terms:

And our magic constant can be written as:

Magic!