Get the ratio of a products uses and price per use.

55 Views Asked by At

Not sure I am going to ask this well or even if the title is correct.

say you have a dataset like:

  • 59 uses - price per use £0.09p
  • 43 uses - price per use £0.06p
  • 59 uses - price per use £0.04p
  • 66 uses - price per use £0.12p
  • 62 uses - price per use £0.1p

Obviously visually I can see which one in this small example has the best price to use ratio.

How do I write a formula that will result in a ratio for each item in the dataset?

I would also ask you keep you answer as simple as possible as I am not great at Math.

thanks


Above was confusing and imcomplete so I will add more hopefully it will help - I may be after the perctage im not sure. Also adding missing data.

[
    {
        "weight" : 215,
        "price": 5.24,
        "weightPerUse": 3.65
    },
    {
        "weight" : 130,
        "price": 2.54,
        "weightPerUse": 3.04
    },
    {
        "weight" : 500,
        "price": 2.17,
        "weightPerUse": 8.5
    },
    {
        "weight" : 120,
        "price": 7.72,
        "weightPerUse": 1.83
    },
    {
        "weight" : 500,
        "price": 5.99,
        "weightPerUse": 8.12
    }
]

This dataset results in

  • weighting 215 - number of uses 59 with a price per use of 0.09
  • weighting 130 - number of uses 43 with a price per use 0.06
  • weighting 500 - number of uses 59 with a price per use 0.04
  • weighting 120 - number of uses 66 with a price per use 0.12
  • weighting 500 - number of uses 62 with a price per use 0.1

I would like to know based on the information provided which has the best price to weight.

really sorry I am unable to explain myself better.

1

There are 1 best solutions below

1
On BEST ANSWER

What I would do is create a heuristic that increases as number of uses given increases, and decreases as price increases. The simplest one is $\dfrac{uses}{price}$.

If you add exponents to the numerator and denominator, you can change the "weight" you give each value. E.g., $\dfrac{uses}{(price)^3}$ will say a choice is very unfavourable even if the price is a little high and $\dfrac{uses^3}{price}$ will say a choice is very favourable even if you can get only a few more uses.

There is another technique, that I will not explain (you might not understand it) in great detail. We create something called a "loss function" that only looks at factors unfavourable to the problem. The task then is finding the minimum of this loss expression, invoking some calculus and even linear algebra.

E.g., if all you had a number of entries all of which offered the same number of uses, but at different prices, the loss function is easy $loss = {weightage} \times {price}$ (loss increases as price increases). Finding the minimum price here doesn't need any calculus or linear algebra, one merely has to look for the lowest price. In certain cases, the loss function that we arrive at is a curvy line than something that steadily increases or decreases: we use higher mathematical ideas there.