I originally posted this to rec.puzzles in October 1992.
I subsequently solved the problem (at least I think I did...) and published an article about it in early 1993.
The article is nowhere to be found and my brain has aged significantly, so if any of you want to have a go at this....
Suppose you're given a word length of N bits. Looking at all the 2^N binary numbers you can represent with this, you're interested in the longest sequence of 1's in every binary number. After you got all this length values, you go on and compute the average.
Example: N = 4
000 -> longest sequence has length 0
001 -> longest sequence has length 1
010 -> longest sequence has length 1
011 -> longest sequence has length 2
100 -> longest sequence has length 1
101 -> longest sequence has length 1
110 -> longest sequence has length 2
111 -> longest sequence has length 3
======================================
SUM 11 / AVERAGE SEQUENCE LENGTH 1.375
It's obviously simple to write a program that computes this ASL ('average sequence length') value for any given N.
I'd be interested in a recurrence relation, i.e. a function
ASL(N) = f(ASL(N-1))
or
ASL(N) = f(N)
I was told that this problem is treated by a paper of 'von Neumann' and has some importance in information coding, but I couldn't find any hints (not even in the FAQ to rec.puzzles ;-)
The following recursive framework is a bit more complicated than what you are asking for. Nevertheless, it allows a recursive computation of your ASL function, and maybe the recursion can be simplified.
For $n \geq k \geq l$, let $$A(n,k,l)$$ be the number of sequences of length $n$ such that the longest subsequence has length $k$ and there are exactly $l$ digits 1 at the end of the sequence. Then the number of sequences of length $n$ with the a longest subsequence of length $k$ is $$A(n,k) = \sum_{l = 0}^k A(n,k,l)$$ and the average longest subsequence length among sequences of length $n$ is $$\operatorname{ASL}(n) = \frac{1}{2^n} \cdot \sum_{k = 0}^n k A(n,k).$$
For the numbers $A(n,k,l)$, there is the recurrence formula \begin{align*} A(0,0,0) & = 1, \\ A(n+1,k,l) & = \begin{cases} A(n,k,l-1) + A(n,k-1,l-1) & \text{if }k = l > 0,\\ A(n,k,l-1) & \text{if } k > l > 0, \\ A(n,k) & \text{if } l = 0. \end{cases} \end{align*}