Calculating percentages of two inputs

80 Views Asked by At

I'm pulling a blank on how to find how much of stream 1 to stream 2 is added to get stream 3 value

I have two inputs (.60 and .20) with and out put of .50

I'm trying to remember the equation in order to find out how much of .60 is added and how much of .20 is added to get .50

2

There are 2 best solutions below

2
On

If there are only two inputs, I suggest you label the amount of the 0.6 input $x$ and the amount of the 0.2 input $1-x$. Or if you want to find the percentage, $100-x$. You then set up your equation $0.60x + 0.2(1-x)=0.5$.

Solving for $x$, you get $x=0.75$. This means that you need 75% of your input to be 0.6, and the rest to be 0.2 (i.e 3 parts to 1).

You can verify this: $0.75 \times 0.6 + 0.25 \times 0.2 = 0.5$.

0
On

General Case

For the general problem (which sounds more what you need) consider several inputs $i_1$, $i_2$, $i_3$, etc. If you use a proportion $p_1$, $p_2$, $p_3$, etc of each then the output, $o$, will be:

$$o=i_1\times p_1+i_2\times p_2+i_3\times p_3+\cdots$$

Also $p_1+p_2+p_3+\cdots=1$ as the parts must add up to a whole.

Two Inputs Case

For only two inputs you will get $p_2=1-p_1$ which leads to:

$o=i_1\times p_1+i_2\times(1-p_1)$

If you know 3 out of 4 of $o$, $i_1$, $i_2$, $p_1$ then you can determine the fourth by rearranging the mathematics. $p_2$ can be found from $p_1$.