A trading card series has 200 different cards in it, which are sold in 5card packages.
Each package has a random sampling of the cards (assume that any card of the 200 has an equal chance of being in a package).
On the average, how many packages will need to be bought to collect the complete series if...
A: all the cards in a package will always be different
B: a package can have repeats
(In reply to
re: a method of solving problem B by Charlie)
This is the program that implements Steve Hutton's algorithm, as modified:
DEFDBL AZ
DIM p(1, 200)' second subscript is # of unique cards gained
' first is 0 for old generation (# of cards drawn) and 1 for
' next generation of # of cards drawn
p(0, 1) = 1 ' generation 1 where m = 1
FOR m = 2 TO 15000
FOR n = 1 TO m
IF n > 200 THEN EXIT FOR
p(1, n) = p(0, n) * n / 200 + p(0, n  1) * (201  n) / 200
p(0, n  1) = p(1, n  1)
NEXT
p(0, n  1) = p(1, n  1)
s = INT(m / 5)
expVal = expVal + s * (p(1, 200)  prevProb)
prevProb = p(1, 200)
NEXT
PRINT expVal, p(1, 200)

Posted by Charlie
on 20030205 08:57:29 