On Wed, Oct 19, 2011 at 11:09 AM, David Vaughan
<[email protected]> wrote:
> In this case there were 3 turns, and 2 b's were chosen vs 1 r, so that is a 
> success. The probability of taking more b's than r's is the probability of 
> taking 3 b's = %24 plus the probability of taking 2 b's and 1 r = 24%~1+2+3 
> which gives 7r24. Though I'm not actually sure my idea for the general case 
> is totally correct.

Note: the number of r's does not depend on previous results.

So your bags look like:

   1+0,.i.4
1 1
1 2
1 3
1 4

And your odds at each stage look like:

   (%+/"1)1+0,.i.4
     0.5      0.5
0.333333 0.666667
    0.25     0.75
     0.2      0.8

Or, if you prefer exact results:

   (%+/"1)x: 1+0,.i.4
1r2 1r2
1r3 2r3
1r4 3r4
1r5 4r5

Thus, the odds of getting n r's for 3 tries is:

   +//.@(*/)/ (%+/"1) x:1+0,.i.3
1r24 1r4 11r24 1r4

(the number of r's is the index into this result)

And, the odds of getting n items for 4 tries is:
   +//.@(*/)/ (%+/"1) x:1+0,.i.4
1r120 1r12 7r24 5r12 1r5

FYI,

-- 
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to