All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Probability
Trading cards (Posted on 2002-05-03) Difficulty: 3 of 5
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

  • See The Solution Submitted by levik    
    Rating: 4.1818 (11 votes)

    Comments: ( Back to comment list | You must be logged in to post comments.)
    re(3): Simulation results | Comment 22 of 36 |
    (In reply to re(2): Simulation results by Tony)

    The rewrite did however make it easier for me to add a check for duplications within packet, by adding a packetChk array of 200, as follows:
    tot = 0: totI = 0
    REDIM c(200)
    ct = 0: ctr = 0
    REDIM packet(5) 'Individual pack
    REDIM packetChk(200)
    FOR packetCnt = 1 TO 5
    r = INT(RND(1) * 200 + 1)
    LOOP UNTIL packetChk(r) = 0 ' THIS makes sure it's not already in the packet
    packetChk(r) = 1
    packet(packetCnt) = r ' fill in each card in the pack
    FOR packetCnt = 1 TO 5 ' see if we already have a card
    r = packet(packetCnt)
    IF c(r) = 0 THEN
    c(r) = 1
    ct = ct + 1 ' ct must get to 200 each trial
    END IF
    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
    (I do hope the indentations show up this time--its hard to follow without them.)
    This time line 3085 (to match the B run) looks like
    3085 200 232.7355
    for an average of 233 packets needed to complete the set, for the A result.

      Posted by Charlie on 2003-01-29 17:01:55

    Please log in:
    Remember me:
    Sign up! | Forgot password

    Search body:
    Forums (0)
    Newest Problems
    Random Problem
    FAQ | About This Site
    Site Statistics
    New Comments (4)
    Unsolved Problems
    Top Rated Problems
    This month's top
    Most Commented On

    Copyright © 2002 - 2018 by Animus Pactum Consulting. All rights reserved. Privacy Information