Joel H.

asked • 01/29/18

Help Please! Practical equation solving for work


Hello! I am at work and trying to find a formula for calculating the number of shares of a stock to buy, after the price has fluctuated from your original buy in, to give you your chosen average price per share. I think I am close in coming up with this equation: y=(ab+cx)/(a+x). All variables are known except for x. x is the solution, but I cannot find out how to solve for x.
 
Here are additional details I have constructed with a sample problem I worked out the long way:
 
numbers from sample problem in bold
 
these variables are known at the onset
a = initial number of shares bought = 100
b = initial price of each share = 13
c = fluctuated price of share = 10
y = goal average price = 10.5
 
these variables are unknown. We are searching for x
m = total spent on all shares  = 6,300
n = total shares bought 600
x = number of shares to buy 500
 
correlations already found:
  • y=m/n
  • n=m/y
  • m=y*n
 
  • a=n-x
  • n=x+a
  • x=n-a
 
  • m=ab+cx
  • ab=m-cx
  • a=(m-cx)/b
  • b=(m-cx)/a
  • cx=m-ab
  • c=(m-ab)/x
  • x=(m-ab)/c
 
this one is the most promising and noted in original description
  • y = (ab+cx)/(a+x)
  • This will solve for x and draw a vertical line on a graphing calculator at that number if you plug in the variables as so:
  • 10.5=(1300+10x)/(100+x)
 
When we can solve for x, I will most likely incorperate this into an xcell sheet. I have not been in an advanced math class in about five years and am struggling at this point. Please help!

Joel H.

With further work, I've found it. If interested, the solution to the problem is x=(a(b-y))/(c-y). I notice that this only works if is a value between b & c. Which makes sense, because the average can only be a number between the initial and new price.
 
I found this answer with an online calculator, Mathway, which was extremely helpful, but I do not know how the solution was arrived at. If somebody could explain the process, I would enjoy the refresher. My math muscle hasn't been worked like this in a while!
 
It would be neat to know if these equations apply to anything else in the real world. Bring on the knowlege if you have it! 
 
Thanks!
 
Joel
Report

01/29/18

1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.