Inverse of a piecewise function including max including max

123 Views Asked by At

Doing a hobby project of mine i have determined the following function. $a$ and $b$ are always known, and $p,a,b$ are all non-negative.

$t(p) = p + \max(\max(p-a, 0) \cdot 1.05-b, 0)$ if $(p-a) \leq 82800$

$t(p) = p + \max(82800 \cdot 1.05 + (p-a-82800) \cdot 1.5 - b, 0)$ if $(p-a) > 82800$

I have to write a program that can calculate the inverse $p(t)$, and i have to say that i'm lost. I'm very interested how someone would go about doing this.

1

There are 1 best solutions below

0
On BEST ANSWER

Step 1: Rewrite your function to the form $t(p)=$

$\begin{cases} p & \quad\textrm{if }\left(p-a\leq82800\land(p-a)\cdot1.05-b\leq0\right)\\ & \lor\left(p-a>82800\land82800\cdot1.05+(p-a-82800)\cdot1.5-b\leq0\right)\\ p+(p-a)\cdot1.05-b & \quad\textrm{if }p-a\leq82800\land(p-a)\cdot1.05-b>0\\ p+82800\cdot1.05+(p-a-82800)\cdot1.5-b & \quad\textrm{if }p-a>82800\land82800\cdot1.05+(p-a-82800)\cdot1.5-b>0 \end{cases} $

Step 2: Calculate the inverse functions of the three expressions!

Step 3: Calculate the three candidates for $p$ by using the inverse functions from step 2!

Step 4: Check your three candidates from step 3 with the if-expressions, to know if your candidate is a solution!

Please note: The inverse doesn't need to be unique: You can get one, two or three solutions.