#| Lucky candy in Racket Gamble. From https://brainstellar.com/puzzles/probability/5 """ Lucky Candy How do you place 50 good candies and 50 rotten candies in two boxes such that if you choose a box at random and take out a candy at random, it better be good! We need to maximize the probability of getting a good candy when selecting a random box and a random candy from it. ... Answer: Place 1 good candy in one box and all the remaining (49 good and 50 rotten candies) in the second box. Solution: Place 1 good candy in one box and all remaining (49 good and 50 rotten candies) in the second box. (1/2)*1 + (1/2)*(49/99)=74.74% """ * (lucky-candy) This is not a good model! This was my first stab at this problem. However the model seems to imply that we have a couple of optimal solutions, but that makes no sense: ((box1-total 1 box2-total 9 box1-good 1 box1-bad 0 box2-good 4 box2-bad 5 box box1 pick-one good p #t) : 1/20 (0.05)) ((box1-total 2 box2-total 8 box1-good 2 box1-bad 0 box2-good 3 box2-bad 5 box box1 pick-one good p #t) : 1/20 (0.05)) ((box1-total 3 box2-total 7 box1-good 3 box1-bad 0 box2-good 2 box2-bad 5 box box1 pick-one good p #t) : 1/20 (0.05)) ((box1-total 4 box2-total 6 box1-good 4 box1-bad 0 box2-good 1 box2-bad 5 box box1 pick-one good p #t) : 1/20 (0.05)) ((box1-total 5 box2-total 5 box1-good 0 box1-bad 5 box2-good 5 box2-bad 0 box box2 pick-one good p #t) : 1/20 (0.05)) ((box1-total 5 box2-total 5 box1-good 5 box1-bad 0 box2-good 0 box2-bad 5 box box1 pick-one good p #t) : 1/20 (0.05)) So, back to the drawing board.