How do I find the combination of composite functions to reach a given output?

56 Views Asked by At

Say I have three functions: $$f(x) = 2x + 1$$ $$g(x) = x - 1$$ $$h(x) = 8x + 3$$

I want to find what combination of $f(x)$ and $g(x)$ can be combined to create $h(x)$

In this example, the answer would be $$h(x) = f(f(g(f(x))) = 8x + 3$$ I chose these functions just as examples, so my question refers to how I would do this with any function besides just this example. Thanks!

1

There are 1 best solutions below

0
On BEST ANSWER

For general functions, there is no way to do this. In fact, for most selections of $f, g, h$, it would be impossible. For instance, if $f$ and $g$ are linear functions such as in your example, then so is their composition: $$f(x) = ax + b\\g(x) = cx + d\\f\circ g(x) = (ac)x + (ad + b)$$

It does not matter how many times you compose them, or what order. You will always get a linear result. So if $h(x) = x^2$, there is no way to get $h$.

In the special case when $f, g, h$ are all linear, it is still not always possible. Note that if you change your example to $$f(x) = 2x + 1\\g(x) = x + 1\\h(x) = 8x - 3$$ It wouldn't work. Any series of compositions involving that $f$ and $g$ will give you a positive constant term, but $h$ has a negative constant term, so it cannot be reached.

More generally, when you compose $m$ copies of $f(x) = ax + b$ with $n$ copies of $g(x) = cx + d$, no matter what order you compose them in, the result will have $a^mc^n$ as the coefficient of $h$. Only the constant term changes with the order. So it will only be possible to get $h(x) = px + q$ if $p = a^mc^n$ for some $n$. When $a,c, p$ are integers, you can figure out if this is possible, and what $m, n$ would have to be, by factoring. But then you would still have to play around with the ordering of the $m$ copies of $f$ and $n$ copies of $g$ being composed, to figure out whether the constant term of $h$ can be built in this way.

For the $f, g, h$ in your example, $a = 2, c = 1, p = 8 = 2^3$. So any compositions to get $h$ must have $3$ copies of $f$ - no more, no less. On the other hand, any number of $g$ could be included, since multiplying by $1$ has no effect on the leading coefficient. But your solution is not the only one. One thing you can do in this case is first compose the three $f$s together: $$f\circ f\circ f(x) = 8x + 7$$ then start composing $g$ to bring the constant term down to match that of $h$: $$h(x) = g(g(g(g(f(f(f(x)))))))$$ There are other solutions as well, but they have to be found by experimenting.