We use the fact that we can get the same recurrence relation $a(n) = a(n-1) + 2^{n-1} - 1$ for both cases.
- In case of the permutations, we get this in the following way:
If n is the first element of the permutation, there must be exactly one ascent among the others. This gives us the a(n-1) term.
If n is not the first element, then the element before this is less than it. This itself adds an ascent. So there must be no other ascent. If we fix which elements come before n and which come after, their order is fixed (each of these sets must be in decreasing order). So for each of the other (n-1) elements, we choose which side of n it is on, giving $2^{n-1}$ to the count. We have to exclude the case where all of them come after, because we have already said that n is not the first element.
- In case of the binary words, we get this in the following way:
If the first element is 0, then the others must have at least two ones. This gives the a(n-1) term.
If the first element is 1, then the others can be anything except for the string with all zeros.
Now, we can use the similar way of getting the recurrence relation to get a bijection.
To get from binary words to permutations, do this:
if the first letter is 0, then in the permutation the first element is n. Now recursively go down to the (n-1) case.
if the first letter is 1, then for each of the other letters, if $a_i$ is 1 then (i-1) comes before n in the permutation. Else (i-1) comes after n in the permutation. Given this partition, the permutation is well defined.
We can easily see how to invert this.
Let me take an example for this:
Suppose I start with the binary string 011010. This will corresspond to a 6-item permutation. Let us find it.
The first letter is 0, so in the permutation the first letter is 6.
Next letter is 1. So the permutation of {1, 2, 3, 4, 5} that follows 6 is found in the following way.
Consider the string 1010. This means that:
1 will come before 5
2 is after 5
3 is before 5
4 is after 5
So the permutation of {1, 2, 3, 4, 5} is {3, 1, 5, 4, 2}.
Add 6 at the beginning to get {6, 3, 1, 5, 4, 2}