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

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.

• What is "price to use ratio"? Shouldn't we choose the one with the least "price per use", in this case, the one with £0.04p? If you are given the price and the number of uses, the "price per use" would be equal to 'price' $\div$ 'uses'. Commented Dec 3, 2020 at 13:34
• I don't understand what you want. You have shown us the price-per-use ratio, that's clear. But then you say that you need "formula that will result in a ratio for each item in the dataset" - do you mean a formula for how these numbers (that you showed) were obtained? Commented Dec 3, 2020 at 13:34
• For example, the first item has 59 uses and price per use is 0.09p. That means that the price of the item was $59 \cdot 0.09 = 5.31$. That's sort of "hidden information" for us. But the calculation was $$\frac{\text{price}}{\text{number of uses}} = \frac{5.31}{59} = 0.09$$ Is this what you mean? Or do you want to calculate something else? Commented Dec 3, 2020 at 13:36
• @MattiP. Im not sure, is that the percentage? I have got a feeling that I may be looking for the pencatage and not a ratio. Commented Dec 3, 2020 at 13:56
• @BobLee let me guess. You want an optimal choice: get most uses at the least total cost. Am I correct? Commented Dec 3, 2020 at 13:57

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.
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.