“what is sqrt(6+sqrt(6+… ?”

It is an instance of a rather popular kind of exercises in calculus.

Letting f(x) = sqrt(6 + x), the question asks

“what is f(f(… ?”

The solution is to first ensure that the sequence s0 = some starting point, s1 = f(s0), s2 = f(s1), … converges, then find out what it converges to, by solving x = sqrt(6+x), i.e., x = f(x).

I think it illustrates a strong analogy between calculus fixed points and programming fixed points, including the self-application part “what is f(f(… ?”

]]>I’m not sure how much of this is semantics and how much is content, but:

When I refer to self-application, I meant taking a type like Pair a b and using Pair a b again for b: Pair a (Pair a b). Perhaps self-application isn’t the right term for that. I think it mostly comes from when I was first learning about fixpoints, this “self-application” leap was what made it slip into focus for me. I couldn’t figure out how fix could take an arbitrary function and find a fixpoint of it while I was thinking about it from the f(x) = x viewpoint.

I do understand the point about a_n converging to 0, and thinking about the constant functor definitely improved my understanding.

]]>