Linked Questions

3 votes
3 answers
354 views

I have code that creates several object instances (each instance having a fitness value, among other things) from which I want to sample N unique objects using weighted selection based on their ...
Sveltely's user avatar
  • 842
0 votes
3 answers
3k views

I understand the question title is vague. My apologies. I have a hashmap that has the key:value <string>:<list of lists>. For a given list, each of the items in the list has a ...
Jeremy Fisher's user avatar
1 vote
1 answer
647 views

I'm running n split tests on a website. I want to assign an evenly distributed integer user id to one of the n buckets, and deterministically so the same user always gets the same test. At this point,...
Bluu's user avatar
  • 5,645
2 votes
1 answer
945 views

I would like to generate random points on a 3D box defined by its (minx, miny, minz) and (maxx, maxy, maxz) corners. I was thinking of generating a random point inside of the box and then somehow ...
Myx's user avatar
  • 1,862
0 votes
1 answer
2k views

I have to retrieve a random object from a list based on the weights/probabilities of the objects. I've found different solutions to the problem, but I'd like to share another approach to know if it's ...
konpai's user avatar
  • 101
6 votes
2 answers
482 views

I have a weighted choice algorithm that works, but I'd like to improve it in two aspects (in order of importance): Guarantee that a minimum number from each possible choice is chosen. Reduce ...
Sybeus's user avatar
  • 1,189
2 votes
8 answers
419 views

I have a table of items with [ID, ATTR1, ATTR2, ATTR3]. I'd like to select about half of the items, but try to get a random result set that is NOT clustered. In other words, there's a fairly even ...
Steve Eisner's user avatar
  • 2,015
1 vote
4 answers
218 views

Trying to make this section of python code repeat until it gets three different results. This isn't the actual code, just a simplified version that does the same thing. roll = random.randint(1,100) ...
Matt's user avatar
  • 11
1 vote
1 answer
337 views

Couldn't find this on Google so if anyone can help. I have a dict like this: {8: 0, 5: 0, 6: 1, 4: 2, 7: 3, 9: 2, 11: 1, 10: 3} Now I need to take 3 keys out of this dict randomly but also, here is ...
MaRiNkO's user avatar
  • 187
2 votes
0 answers
421 views

In search for a faster weighted sampling without replacement, the following question came up: Is there an algorithm that implements random sampling without replacement with unequal selection ...
krlmlr's user avatar
  • 25.6k
2 votes
2 answers
199 views

There are many typical questions like https://softwareengineering.stackexchange.com/questions/150616/return-random-list-item-by-its-weight Imagine more advanced problem. You have N sources of pair (...
vladon's user avatar
  • 8,429

15 30 50 per page
1
2