Skip to content

Instantly share code, notes, and snippets.

@Frityet
Created September 12, 2022 15:05
Show Gist options
  • Save Frityet/0286b791de1e01c8d6a646153de50f17 to your computer and use it in GitHub Desktop.
Save Frityet/0286b791de1e01c8d6a646153de50f17 to your computer and use it in GitHub Desktop.

Composition of Functions

Preamble

Using the equations

$$ f(x) = {1 \over x} $$

and

$$ g(x) = {1 - x} $$

a variety of functions can be composed of composing these functions between themselves and the other, however only a finite amount of unique results can be achieved.

Procedure

To discover unique values, the expressions that the functions represent are substituted when composed.

Using this method 2 new unique results were created.

Composites

$$ (f \circ g)(x) = {1 \over {1 - x}} $$

$$ (g \circ f)(x) = {1 - {1 \over x}} \\ = {x - 1 \over x} $$

Using these new values, another unique expression can be composed and verified that a different composition, inverse with the functions used, equals the same resulting expression.

$$ (f \circ g \circ f)(x) = {1 \over {1 - {1 \over x}}}\\ = {1 \over {1 - {x - 1 \over x}}}\\ = {x \over x - 1} $$

is equivalent to: $$ (g \circ f \circ g)(x) = {1 - (x - 1) \over 1 - x} \ = {-x \over 1 - x} \ = {x \over -1 + x} \ = {x \over x - 1} $$

The signage was purposely flipped on expression #3 so it is easier to identify as already discovered against other expressions. Not having done this earlier when first solving this problem created an issue because

$$ {x \over x - 1} \ne {-x \over 1 - x} $$

would be misidentified as being true.

After getting all the other expressions, the last unique expression is found.

$$ (f \circ f)(x) = {1 \over {1 \over x}}\\ = x $$

This is equivalent to

$$ (g \circ g)(x) = {1 - (1 - x)}\\ = {1 - 1 + x}\\ = {x}$$

Verification

There are no more expressions that can be achieved, and this can be asserted due to 2 reasons. The first of these reasons is that f(f(x)) and g(g(x)) are both equal to x, meaning that trying to further compose those functions loop around to the original equations, as shown here $$ (f \circ f \circ f \circ f)(x) = (f \circ f)(x) = x $$

Secondly, by further composing the other expressions, the expressions that do not become x further evaluate the original functions, that being f(x) and g(x), as shown here. $$ (f \circ g \circ f \circ g)(x) = {1 \over 1 - {1 \over 1 - x}}\ = {1 \over {1 - x - 1 \over 1 - x}}\ = {1 \over {-x \over 1 - x}}\ = {1 \over {x \over x - 1}}\ = {x - 1 \over x} $$

To prove that these are equivalent, we can graph them out.

graph

This is the first function, f(x) We can see that it is equivalent to f(f(f(x))) as shown here

graph

Furthermore, we can observe that another unique result, g(f(x)) is equivalent to f(g(f(g(x))))

g(f(x)):

graph

f(g(f(g(x)))):

graph

Conclusion

Through this investigation, the functions $$ f(x) = {1 \over x} $$ and $$ g(x) = {1 - x} $$ were asserted to have only 4 unique solutions (excluding f(x) and g(x) themselves)

These unique solutions are: $$ \begin{array}{c|c} Composite & Expansion \ \hline\ (f \circ g)(x) & 1 \over {1 - x}\\ \hline\ (g \circ f)(x) & x - 1 \over x\\ \hline\ (f \circ f)(x) \bold or \bold (g \circ g)(x) & x\\ \hline\ (f \circ g \circ f)(x) \bold or \bold (g \circ f \circ g) & x \over x -1 \end{array} $$

Using calculations and graphing, the functions were proved using 2 methods to be equivalent, and the expansions resulted in proper functions which once graphed, showed an effect in which the values never shared the same Y value despite the 2 lines almost crossing.

The values of the graph support the theory which shows that the X values of the function continuously reach 0, without reaching it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment