How to solve it?
Guess the number of triangles in the graph of $\displaystyle f^n(x)$ as a function of n. ($\displaystyle f^n(x)$ has $\displaystyle n$ nested occurrences of $\displaystyle f$.) When you know the number of triangles, you know all the characteristics of each triangle (first the altitude and the base length, from which you can find the side lengths since the triangles are isosceles).
Based on the graphs of $\displaystyle f^n(x)$ for small values of n, make a hypothesis about the relationship between n and the number of triangles in the graph of $\displaystyle f^n(x)$. I am not sure how strictly you need to prove this hypothesis, but going from the graph of $\displaystyle f(x)$ to that of $\displaystyle f^2(x)$ should give you the idea of the proof of the hypothesis.
Hello, Mhmh96!
What a strange problem . . . bizarre!
I did a lot of sketching and muttering
. . and I think I've understood the composite functions.
If I'm wrong, my apologies for wasting your time . . .
$\displaystyle \text{Let }f\text{ be the function such that: }\:f(x) \;=\;\begin{Bmatrix}2x && \text{if }x \le \frac{1}{2} \\ 2-2x && \text{if }x > \frac{1}{2}\end{array}$
$\displaystyle \text{What is the total length of }\:\underbrace{f(f(\hdots f}_{2012\:f's} (\hdots)))\:\text{ from }x = 0\text{ to }x = 1\,?$
$\displaystyle y_1 \,=\,f(x)$ has this graph.
It is an isosceles triangle with base 1 and height 1.Code:| 1+ - - - - - - - * | * * | * * | * * | * * | * * | * * | * * - - * - - - - - - - : - - - - - - - * - - 0 1/2 1
The slanted side has length $\displaystyle \sqrt{1^2+\left(\tfrac{1}{2}\right)^2} \:=\:\tfrac{\sqrt{5}}{2}$ . . . and there two of them.
Hence: .$\displaystyle L_1 \:=\:\sqrt{5}$
$\displaystyle y_2 \:=\:f(f(x))$ has this graph.
It has two isosceles triangles with base 1/2 and height 1.Code:| 1+ - - - o - - - - - - - o | o o o o | o o o o | o o o o | o o o o | o o o o | o o o o |o o o o - - o - - - : - - - o - - - : - - - o - - 0 1/2 1
The slanted side has length: $\displaystyle \sqrt{1^2 + \left(\tfrac{1}{4}\right)^2} \:=\:\frac{\sqrt{17}}{4}$ . . . and there are four of them.
Hence: .$\displaystyle L_2 \:=\:\sqrt{17}$
$\displaystyle y_3 \:=\:f(f(f(x)))$ has this graph.
It has four isosceles triangles with base 1/4 and height 1.Code:| 1+ - * - - - * - - - * - - - * | | * * * * * * * * | | * * * * * * * * | |* * * * * * * * | - - * - - - * - - - * - - - * - - - * - - 0 1/2 1
The slanted side has length $\displaystyle \sqrt{1^2 + \left(\tfrac{1}{8}\right)^2} \:=\:\frac{\sqrt{65}}{8}$ . . . and there are eight of them.
Hence: .$\displaystyle L_3 \:=\:\sqrt{65}$
I conjecture that: .$\displaystyle L_n \:=\:\sqrt{2^{2n}+1}} $
And therefore: .$\displaystyle L_{2012} \;=\;\sqrt{2^{4024}+1} $