Dividing a whole into 2 with a dynamic ratio

27 Views Asked by At

Hi I did my best in the title but I have a question which it feels like people have surely come across before and has a known or standard way of doing it.

Basically I have a whole(a number) which I want to divide into 2 parts. Let's call these $x$ and $y$. The value of $y$ depend on $x$. In other words the bigger the $x$ is, bigger the $y$ gets. So the ratio between $x$ and $y$ is depend on how big the $x$ is.

Example: Let's call our whole $N$. So $N = x + y$ and lets say if $x < 10$ , then $x = y$ if $ 10 <= x < 20$ then $y = 2x$ and if $x >= 20$ then $y = 3x$ and so on. That is just an example and actual function between $x$ and $y$ is different and continuous. Not discrete.

So the question is, given a $N_{max}$ how can I calculate the $x_{max}$? Obviously you can do it iteratively by try and guess what the max x can be but I thought there should be a function or a known way of doing this. Also ratio doesn't have to exactly be sum up to $N_{max}$, it can be an approximation as well. So I am guessing an approximation function might also work. Thanks in advance.