I came across the following recurrence relation when exploring properties of a certain type of randomized perfect binary tree:
$$ T(0) = \frac{1}{2} $$ $$ T(k + 1) = 1 - T(k)^2 $$
(Specifically, this is the probability that a random, complete binary tree of height $k$ with values at the leaves and where each internal node is a NAND gate will evaluate to 1.)
I was able to get values for this recurrence by writing a quick Python script and found that it quickly starts to oscillate between values very close to 0 and 1 once $k$ gets large. However, I don't have a closed-form expression for the recurrence.
I have never encountered a recurrence like this one before (most recurrences I know of come from the analysis of recursive algorithms or data structures, which rarely have squared terms arise). Is there a standard technique for solving recurrences of this sort? If so, how can I use them to solve this recurrence?
Thanks!
Nonlinear recurrences are notoriously difficult to solve and sometimes quite surprisingly complex (see logistic map).
In this case, the limiting behaviour can be guessed by writing the two-step recursion:
$$x_{n+2} = x_n^2 \, (2 -x_n^2)$$
and, because the graph $y=x^2(2-x^2)$ is strictly below $y=x$ for $x\in [0,1/2]$ the recursion goes to zero (of course, this implies that $x_n$ will tend to 1 for odd $n$).