The Haar functions on \([0,1)\) are defined by
$$
\begin{gathered}
H_{1}(t)=1 \\
H_{2}(t)= \begin{cases}1, & 0 \leq t<\frac{1}{2}, \\
-1, \quad \frac{1}{2} \leq t<1,\end{cases} \\
H_{2^{n+1}}(t)=\left\\{\begin{array}{cl}
2^{n / 2}, & 0 \leq t<2^{-(n+1)}, \\
-2^{n / 2} & 2^{-(n+1)} \leq t<2^{-n}, \quad n=1,2, \ldots, \\
0, & \text { otherwise }
\end{array}\right. \\
H_{2^{n+}}(t)=H_{2^{n}+1}\left(t-\frac{j-1}{2^{n}}\right) . \quad j=1, \ldots,
2^{n}
\end{gathered}
$$
It helps to plot the first five.
Let \(f(z)\) be an arbitrary function on \([0,1]\) but satisfying
$$
\int_{0}^{1}|f(z)| d z<\infty
$$
Define \(a_{k}=\int_{0}^{1} f(t) H_{k}(t) d t\). Let \(Z\) be uniformly
distributed on \([0,1]\). Show that
and
$$
f(Z)=\lim _{n \rightarrow \infty} \sum_{k=1}^{n} a_{k} H_{k}(Z) \quad \text {
with probability one, }
$$
$$
\lim _{n \rightarrow \infty} \int_{0}^{1}\left|f(t)-\sum_{k=1}^{n} a_{k}
H_{k}(t)\right| d t=0
$$