| Download
A computation from a talk given on 4/2/16 at the Allegheny Mountain Section of the MAA annual meeting.
Project: Calculus I, Spring 2016
Views: 42If at each stage, one candy is removed from a bowl with red candies out of total candies, and a replacement candy is generated based on the resulting distribution in the bowl, the expected number of steps before we reach either or red candies can be computed as [ (N-1) \left( (N-r) \sum_{j = 1}^r \frac{1}{N-j} +r \sum_{j = r+1}^{n-1} \frac{1}{j} \right) ] The function dirComp(N, r)
below will compute this for a bowl with candies, starting with red:
Example: Here is a table of results for :
r Expected (Approximate)
+---+----------+------------------+
1 7129/280 25.4607142857143
2 5729/140 40.9214285714286
3 3553/70 50.7571428571429
4 7883/140 56.3071428571429
5 1627/28 58.1071428571429
6 7883/140 56.3071428571429
7 3553/70 50.7571428571429
8 5729/140 40.9214285714286
9 7129/280 25.4607142857143
Here's a partial table with (leaving out the exact values, which are ugly fractions here):
r (Approximate)
+----+------------------+
1 512.560374246322
2 925.120748492645
3 1287.17091865733
4 1615.20047026532
5 1917.44877187331
6 2198.85496821814
7 2462.70797307361
8 2711.35360465719
9 2946.54814928425
10 3169.65478182340
11 3381.76141436254
12 3583.75568735113
13 3776.37496033971
14 3960.24091767843
15 4135.88428365502
16 4303.76294374925
17 4464.27553241492
18 4617.77182058448
19 4764.56079168088