First we need to get the formula for calculating the average of two numbers which is easy because it is (x + y) / 2
So, the equation will be A = (x + y) / 2
Now all we have to do is get 'y' on one side and the rest of the equation on the opposite side and we will have our solution!
A = (x + y) / 2
A * 2 = (x + y) / 2 * 2 # This will get rid of the number 2 on the right hand side
A * 2 = x + y
A * 2 - x = x + y - x # Subtract the variable 'x' from each side.
A * 2 - x = y
And we can flip it around using the reflexive property of equality!
The answer is:
y = A * 2 - x
Hope this helps!