Recall that the Cantor set `K` is the space of infinite bit sequences, topologized as the product of countably many copies of `2`. Let `L` be the space of arbitrary functions `K -> 2`, and let `N*` be the one-point compactification of `N`, i.e., the closure of `N` as a subset of the real projective line. Define a map `w : L -> N*` as follows:
* If `f : K -> 2` is continuous, then `w(f)` is the smallest natural number `n` such that the value of `f(x)` is completely determined by the first `n` bits of `x`. (It is easy to see that `f` is continuous if and only if such an `n` exists.)
* If `f : K -> 2` isn't continuous, then `w(f)` is infinity.
Today, my favorite function is `w`.
**EDIT:** Fixed typo.