This is not homework, for I am not a student. This is for my general curiosity. I apologize if I am reinventing the wheel here.The function I seek can be defined as follows (language agnostic):
int getPercentageOfA(double moneyA, double workA, double moneyB, double workB)
{
// Perhaps you may assume that workA == 0
// Compute result
return result;
}
Suppose Alice and Bob want to do business together ... such as ... selling used books. Alice is only interested in investing money in it and nothing else. Bob might invest some money, but he might have no $ available to invest. He will, however, put in the effort in finding a seller, a buyer, and doing maintenance.
There are no tools, education, health insurance costs, or other expenses to consider. Both Alice and Bob wish to split the profits "equally" (A different weight like 40/60 for advanced users). Both are entrepreneurs, so they deal with low ROI/wage, and high income alike. There is no fixed wage, minimum wage, fixed ROI, or minimum ROI. They try to find the best deal possible, assume risks and go for it.
Now, let's stick with the 50/50 model. If Alice invests $100, Bob invests work, and they will end up with a profit (or loss) of $60, they will split it equally - either both get $30 for their efforts/investments, or Bob ends up owing $30 to Alice.
A second possibility: Both Alice and Bob invest 100, then Bob does all the work, and they end up splitting $60 profit. It looks like Alice should get only $15, because $30 of that profit came from Bob's investment and Bob's effort, so Alice shall have none of it, and the other $30 is to be split 50/50.
Both of the examples above are trivial even when A and B want to split it 35/65
or what have you. Now it gets more complicated: What if Alice invests $70, and Bob invests $30 + does all of the work. It appears simple: (70,30) = (30,30) + (40,0) ... but, if only we knew how to weigh the two parts relative to each other. Another complicated (I think) example: what if Alice and Bob invest $70 and $30 respectively, and also put in an equal amount of work?
I have a few data points:
If I fix things such that always workA = 0%
, workB = 100%
of the total work, then getPercentageOfA
becomes a function: height z
given x
and y
. The question is - how do you extrapolate this function between these several points? What is this function?
If you can cover the cases when workA does not have to be 0%
of the total work, and when investment vs work is split as 85/15 or using some other model, then what would the new function be?
To answer this question depends on which variable you consider to have more weight. Based on your data points, I'm going to assume that 100% of the work is equivalent to investing 100% of the money.
int getPercentageOfA(double moneyA, double workA, double moneyB, double workB)
{
// Perhaps you may assume that workA == 0
aWorkPercentage = getPercentageOfAForWork(double workA, double workB);
aMoneyPercentage = getPercentageOfMoney(double moneyA, double moneyB);
weightMoney = 1;
weightWork = 1;
result = ( weightWork*aWorkPercentage + weightMoney*aMoneyPercentage) / 2
return result;
}
Compute each variable separately and then average them together. The advantage of this formula is that if person A and person B decide to treat work as being more valuable than money or vice versa, then the "weights" could be adjusted to reflect the final percentage.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With