# How to assign weights to a set of ordered objects?

I have been trying to assign weights to set of objects. The problem that I have is as following.

I have a set of objects ordered either ascending or decending. . Each object shall be provided a weight that is in between 0 and 1, either ascending or decending corresponding to the order of the objects. . The weights cannot be repeated . Sum of the weights shall be 1

I would appreicate infos with regards to algorithms and methods that I can look into.

• Why not generate numbers uniform on (0,1), normalise them to add to 1 and then sort them? I suspect I have completely missed the point of what you are doing which is why this is only a comment not an answer. Commented Mar 7, 2022 at 13:39
• Literally any set of distinct positive numbers will work: divide each by their sum to make the resulting weights sum to unity; sort them; and assign them, in order, to your sorted objects. Since this clearly has nothing to do with any property of the objects (other than their count), its utility or applicability to any form of data analysis is obscure. Would you mind telling what you hope this will achieve?
– whuber
Commented Mar 7, 2022 at 13:42
• @Whuber, perfect! This gives exactly what I want. I would assign objects a number from 1 to N and divide by the sum of the values give me what I would be looking for. This is to assign the weights in a set of objects. Each set can have same objects but their weights differ by the time they have arrived into the set. In the end I would like to sum the weights of the objects over many sets to decide the ranking of the objects. Does it make any sense? Commented Mar 7, 2022 at 19:00
• @mdewey, i am not sure if understand you correctly. Commented Mar 7, 2022 at 19:08
• Mathematically it works, but it is difficult to see what it actually accomplishes, since the result depends arbitrarily on how you determine the weights--and, as we have seen, there are a great many ways to do that.
– whuber
Commented Mar 8, 2022 at 19:23