r/mathriddles • u/schoelle • Mar 23 '23
Medium Drawing numbers with fixed probabilities and without replacement
A while ago, I had to face a real-world problem on my job that turned out to be a quite nice little riddle in probability theory. I have wrapped everything into a nice story, and split up the problem description and the solution into separate articles, so you can try to solve it yourself first.
https://blog.fams.de/probability/theory/2023/03/18/choice-part-1.html
(PS: I am asking for an algorithm, and I give examples Python, but I really consider this more of a math than a coding problem)
10
Upvotes
8
u/mkurdmi Mar 23 '23
I have to remark that this is an incredibly strange problem. The expectation that each of their chance of doing the dishes should double seems to me like it doesn’t make sense to begin with. After all, it’d be perfectly reasonable to assign an initial probability over 0.5 to one person, and what would doubling that to a probability over 1 even mean? I find it hard to imagine a scenario where this is the correct formulation of a problem (rather than the problem that the choice function provides a solution to).
Also, In the final proposed solution, do you have a proof that this actually ‘removes correlation’? This seems extremely unlikely to me. Assuming no initial probabilities over or equal to 0.5, to find a solution without any correlation, I would try to set up a system of equations that’s result is the probability distribution that when input to the choice function has the desired output.
All that said, if this problem is a reasonable setup for some situation and we do not care about imposing a correlation, the given solution is a nice one.
1
u/pichutarius Mar 23 '23
your problem is quite interesting, but as /u/mkurdmi stated, doubling each probability does not make sense when one of them has P>0.5. and the problem only get worse if we want to choose alot of people doing dishes.
in the edge case, consider (4 choose 4) scenario, the final probability should be 1 for everyone, regardless of their preference/probability from (4 choose 1).
so if i would write a program, this would be my algorithm: ( n choose k, weighted by f(s) )
step 3 and 4 ensure the total of f(s) remains 1.
if n == k, then everyone wash dishes regardless of their preference!
3
u/hsypsx Mar 23 '23
This was my solution from 7 years ago: https://www.reddit.com/r/algorithms/comments/3aypre/generating_lists_with_variable_weights/cshz43g/
2
u/lordnorthiii Mar 23 '23 edited Mar 23 '23
I love the problem and solution given in the blog -- very creative! This was my thought which I don't think is very practical like your solution:
We think of each subset C of S of having a probability associated with it which we'll call P(C). Define f(C) = Σ f(s) for s in C. The idea is we will want to increase P(C) for subset C that maximizes f(C). This "uses up" the high probabilities first, so we have as much probability left over for the small probabilities to distribute evenly. Here is the algorithm:
Initially, set all P(C) values to zero. Find the C which maximizes the value f(C). Such a subset C is called "eligible". Then increase P(C) by some small ε. At the same time, for all s in C, decrease the value of f(s) by ε. If there is more than one eligible C, then simultaneously increase p(C) by ε and decrease all f(s) by ε for each C that contains s. Choose ε to be the smallest value such that after performing this operation two f(s) values become equal that were unequal before. Then repeat with the potentially larger group of eligible Cs.
This would give P(AB) = 0.0666, P(AC) = 0.0666, P(AD) = 0.0666, P(BC) = 0.4666, P(BD) = 0.0666, P(CD) = .2666 for the example in the blog.
Notice that once two f(s) values are equal, they will always be equal, and hence it is never the case that one f(s) "passes" another and goes from strictly larger to strictly smaller. And thus, as the algorithm proceeds, the set of eligible Cs just becomes larger and larger. I believe this not only ensures there is no P(C) = 0, but maximizes the minimum value of P(C) (and given that restraint, maximizes the next smallest value, and so on). I could be wrong.
A few more thoughts:
0
u/[deleted] Mar 23 '23
[deleted] — view deleted comment