Artificial intelligent assistant

Formula to map a variable to another? For example, I have a variable $x$ that contains the value $100$, and assume I also have a variable $y$ that contains the value $300$ is there a method to decrement $x$ by some amount and have $y$ be lowered by an amount proportional to $y$ so that when $x = 0$, $y = 0$ I brute forced this crude method, I'm wondering if there is a better way. $x * 200 / 176 = y$ so when I subract from $x$, $y$ is subtracted a proportionate amount.

Sure. What you need to do to get both $x$ and $y$ to $0$ is subtract $100$ from $x$ and subtract $300$ from $y$. The ratio between the two is $\frac {100}{300} = \frac 1 3$. In other words, for every $1$ unit you remove from $x$, you need to remove $3$ from $y$. Then you can get both to equal $0$ after $100$ subtractions (decrements).

You can then adjust this to the size of your decrement for one of the variables. Suppose you want to remove $0.5$ from $x$ on every decrement. Then you need to remove $3 \cdot 0.5 = 1.5$ from every $y$ decrement.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy b7e438991b1d4f7ea38898e93fef402d