A trading card series has 200 different cards in it, which are sold in 5-card 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(2): Simulation results
I've corrected a couple of typos (pack vs packet for the array name, packCnt vs packetCnt for the iteration variable/subscript) so it looks like
tot = 0: totI = 0
ct = 0: ctr = 0
REDIM packet(5) 'Individual pack
FOR packetCnt = 1 TO 5
r = INT(RND(1) * 200 + 1)
packet(packetCnt) = r ' fill in each card in the pack
FOR packetCnt = 1 TO 5 ' see if we already have a card (but this doesn't check from the pack)
r = packet(packetCnt)
IF c(r) = 0 THEN
c(r) = 1
ct = ct + 1 ' ct must get to 200 each trial
ctr = ctr + 1 ' ctr is number of purchases for a complete set
IF ct = 200 THEN EXIT DO
totI = totI + ctr ' Number of packs
numTry = numTry + 1
PRINT numTry, ctr, totI / numTry
but this still does not have a check for non-duplication within packet. The 3085th line is
3085 296 233.7284
for an average of 234 packets per trial.
Posted by Charlie
on 2003-01-29 17:00:45