Re: Weighted Random Ordering

From: Jonathan Fry (jon_at_NOSPAM.spss.com)
Date: 11/08/04


Date: Mon, 8 Nov 2004 15:32:59 -0600


"Arsen V." <av2000@gmail.com> wrote in message
news:ceb1d8a4.0411080936.3c371ee3@posting.google.com...
> Hello,
>
> I have a list of items with some weights (let's say price), and I want
> to shuffle this list into a random order but give extra chances for
> items with heigher price to appear first.
>
> In other words, I want the more expensive items to have higher
> probability of getting the top positions in the resultant random
> ordered list.
>
> What is the best distribution to use for this? Could you provide some
> pseudo-code examples?
>
> Thanks,
> Arsen
--------------------
Try sorting the items by the product of price times a uniform random number
drawn for that object. If you want price to have less effect, use its
logarithm or square root in its place; if you want price to have more
effect, use its square, its cube, or even its exponential function.

Jonathan Fry
SPSS Inc.



Relevant Pages

  • Re: Weighted Random Ordering
    ... > I have a list of items with some weights, ... > to shuffle this list into a random order but give extra chances for ... > items with heigher price to appear first. ... logarithm or square root in its place; if you want price to have more ...
    (sci.stat.math)
  • Re: Gym Room.
    ... Low row foot brace ... Set Olympic weights ... Sure we could do a nice price for a job lot. ...
    (uk.rec.bodybuilding)
  • Re: Imperial units in the future
    ... > learnin' in weights and measures came from the store and a desire to ... Because it usually turns out that two are a ... Isn't that what's the "normalized" price is for? ... price in litres, when it's a fluid. ...
    (rec.arts.sf.written)
  • Weighted Random Ordering
    ... I have a list of items with some weights (let's say price), ... to shuffle this list into a random order but give extra chances for ...
    (sci.stat.math)
  • Weighted Random Ordering
    ... I have a list of items with some weights (let's say price), ... to shuffle this list into a random order but give extra chances for ...
    (sci.stat.edu)