# Magic beans problem

by scalpmaster
Tags: beans, magic
P: 3,079
 Quote by D H As I take it, the only allowed scheme is to pick some number n between 0 and 10 inclusive, then randomly draw n beans from bag A, 10-n beans from bag B all without looking.
D H,

I have a more liberal interpretation. My interpretation would allow "crazy" strategies like "Pick 3 beans from bag A and 4 beans from bag B and put them in a third bag C. Draw your ten beans by picking 4 beans from bag A, 4 beans from bag B and 2 beans from bag C." Intuitively, no amount of remixing of the beans will improve the expected value, but I am very curious how one would rigorously prove that.

scalpmaster,

To maximize the variance of the two-bag strategy described above, use the formula for V and pick the value of n that makes V largest. I leave the arithmetic to you
Mentor
P: 14,242
 Quote by Stephen Tashi Following the formula given in the wikipedia article: http://en.wikipedia.org/wiki/Hyperge...c_distribution Let $N$ = total number of beans in the bag $n$ = number drawn, $0 < n \leq N$ $k$ = number of magic beans in the bag, $0 \leq k \leq N$ $V =$ variance of the number of magic beans drawn Then $V = n \frac{k}{N} \frac{N-k}{n} \frac{N - n}{N -1}$
That second fraction on the right should be $\frac{N-k}{N}$ rather than $\frac{N-k}{n}$, resulting in

$$V = n \frac k N \frac {N-k} N \frac {N-n} {N-1}$$

If you draw nothing (n=0), the odds of winning are 0, with zero variance ("if you don't play you can't win"). The corrected formula yields a variance of zero for n=0 and for n=N.

 Suppose we make n draws from bag A and 10-n draws from bag B. Then the total variance is $V = n \frac{3}{10} \frac{7}{n} \frac{10-n}{9} + (10-n)\frac{3}{10}\frac{7}{10-n}\frac{10-(10-n)}{9}$
Corrected: $V = n \frac 3{10} \frac 7{10} \frac{10-n} 9 + (10-n) \frac 3{10} \frac 7{10} \frac {10-(10-n)} 9$

 The variance from drawing 10 beans from a bag of 20 that contains 6 magic beans is $V = 10 \frac{6}{20}\frac{14}{10}\frac{10}{19}$
Corrected: $V = 10\frac{6}{20}\frac{14}{20}\frac{10}{19}$
Mentor
P: 14,242
 Quote by Stephen Tashi D H, I have a more liberal interpretation. My interpretation would allow "crazy" strategies like "Pick 3 beans from bag A and 4 beans from bag B and put them in a third bag C. Draw your ten beans by picking 4 beans from bag A, 4 beans from bag B and 2 beans from bag C." Intuitively, no amount of remixing of the beans will improve the expected value, but I am very curious how one would rigorously prove that.
Point taken. I too cannot see how this will change the expected value given that bags A and B have identical contents, but I too cannot see how to prove this rigorously.

I can see that these crazy strategies will change the variance compared to a simpler approach (e.g., choose n from bag A, 10-n from bag B).
Engineering
Thanks
P: 6,033
 Quote by D H Point taken. I too cannot see how this will change the expected value given that bags A and B have identical contents, but I too cannot see how to prove this rigorously.
The probablity that each bean is magic remains constant at 0.3, independent of anything that you do with that particular bean.

So if you select 10 different beans, the expected number of magic beans is 3, whatever crazy strategy you use to select them.
P: 35
 Quote by AlephZero So if you select 10 different beans, the expected number of magic beans is 3, whatever crazy strategy you use to select them.
Expected no. remains 3 but if max variance can occasionally increase the no. of magic bean selected to be 5 or 6, thats good enough.

Consider the case of a 44no.s (6+1balls) lottery. If we split it into 2 sets of 22no.s, covering all no.s, and employ 4of4, 5of5 or 5of6 wheeling systems and create variance large enough to occasionally trap 5+1 no.s or more in either side of the sets, we stand a chance to win top 3 prizes.

All the possible outcome scenerios of 2 fully hedged wheels covering all no.s.

(3,4) , (4,3) , (5,2) , (2,5) , (6,1) , (1,6) , (7,1) , (1,7)

If variance swings are large enough, there is no escape, we will win top prizes. So the key question is how to create large swings to either side?

.i.e. In stock portfolio management, we want low variance, the beta, for any given expected no.,the alpha. However, for lottery fully hedged system, we want Maximum variance.
Mentor
P: 14,242
 Quote by AlephZero The probablity that each bean is magic remains constant at 0.3, independent of anything that you do with that particular bean.
You can look at a particular bean and alter your selection based on that, and that certainly can change the expected outcome (but that is cheating).

Changing the selection strategy most certainly does change the variance. So naively, why not the expected value?

I do agree with yours and Stephen Tashi's non-rigorous (i.e., intuitive) reasoning that the expected value has to be three for any valid selection strategy. However, trusting one's intuition when it comes to probability is oftentimes a losing proposition. In any case, my take on what Stephen Tashi meant by "rigorously" is to prove that every valid selection strategy will result in a probability distribution that has an expected value of three.
Engineering
Thanks
P: 6,033
 Quote by D H You can look at a particular bean and alter your selection based on that, and that certainly can change the expected outcome (but that is cheating).
That's the key point of my reasoning. Possibly you could make the assertion appear more rigorous by wrapping it in the language of Bayesian probability theory. The "rules" exclude doing anything that changes the a-posteriori probability of a bean being magic.

 Changing the selection strategy most certainly does change the variance. So naively, why not the expected value?
Hmm.. I'm not sure if I'm too naive, or not naive enough, to feel there "ought" to be a connection between the expected value and the variance. But I don't.
P: 35
 Quote by bpet Aside: is Prob(6 found) maximized by taking 5 from each bag?
Does n=5 maximizes probability(6 found)? Not sure, but someone else responded this way:

Consider one bag:

Pick 10: 3 magic beans
Pick 9: 2 or 3 beans
Pick 8: 1, 2 or 3 beans
Pick 7: 0,1,2, or 3 beans
Pick 6: 0,1,2, or 3 beans
Pick 5: 0,1,2, or 3 beans
Pick 4: 0,1,2 or 3 beans
Pick 3:0,1,2, or 3 beans
Pick 2: 0,1,2 beans
Pick 1:0,1 beans
Pick 0: 0 beans

The expectation is maximum for the following combinations (of 2bags) :

7 and 3
6 and 4
5 and 5

in this case the expectation is:

0,1,2,3,4,5,6

These are the combinations that can offer you the maximum 6 magic beans at the risk of getting 0 beans.

If you want to play safe, you pick 10 from one bag but you have only 3 beans.
If risk aversion is not to have less than 2 magic beans then you have the following combinations:

10,0
9,1

If 1 is minimum then:

10,0
9,1
8,2

So the answer should depend on the constraint of minimum number of magic beans.
This is a boundary value constraint problem. Otherwise, it is incomplete.

 Related Discussions General Discussion 14 Calculus & Beyond Homework 1 General Discussion 7 Brain Teasers 6 General Discussion 0