3 ms·
Even better would be to sort by deviance: SORT SQRT(ups*downs)/MAX(ups+downs,1) ASCENDING
by sesqu 13y ago
Even better would be to sort by deviance: SORT SQRT(ups*downs)/MAX(ups+downs,1) ASCENDING
- philsnow 13y agoWhat ? Take a moment to convince yourself that sorting by sqrt(f(up,down)) will produce the same ranking as sorting by just f(up,down) (provided that f(up,down) is non-negative, as this particular function is ) Consider a set of points in the X/Y plane. If you want to find the one closest to the origin, you don't have to find min(sqrt(x^2+y^2)), only min(x^2+y^2), which is much cheaper.
- sesqu 13y agoYou're ignoring the divisor. For example, √(2·3)÷(2+3) < √(2·2)÷(2+2) but (2·3)÷(2+3) > (2·2)÷(2+2).
- deleted 13y ago[deleted]