The exercise is;
There are m functions from a one-element set to the set {1, 2, …, m}. How many functions are there from a two-element set to {1, 2, …, m}? From a three-element set? Give a recurrence for the number of T(n) of functions from an n-element set to {1, 2, …, m}. Solve the recurrence.
I've gotten to the point that I "know" there are $m^n$ options to the function $$f:\{1,...,n\}\to \{1,...,m\}$$. How do I set up a recurrence relation and solve it?
I've gotten this far; $$ T(0) = 1 \\ T(1) = m \\ T(n) = T(n - 1) \cdot m $$
Solving it; $$ T(n) = (T(n - 2) \cdot m) \cdot m \\ = ((T(n - 3) \cdot m) \cdot m) \cdot m \\ = T(n - n) \cdot m^n \\ = 1 \cdot m^n = m^n $$
But I'm unsure whether I've even done the correct thing?