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(2): Simulation results | Comment 20 of 39 |
    (In reply to re: Simulation results by Charlie)

    I haven't used BASIC in a few years so please bare with me. Can you try somthing like this as your simulation and post the results?

    You can also add another loop to make sure none of the cards in 'pack' are the same. This would simulate A.
    RANDOMIZE TIMER
    tot = 0: totI = 0
    DO
    REDIM c(200)
    ct = 0: ctr = 0
    DO
    REDIM pack(5) 'Individual pack
    FOR packetCnt = 1 TO 5
    r = INT(RND(1) * 200 + 1)
    packet(packCnt) = r ' fill in each card in the pack
    NEXT
    FOR packetCnt = 1 TO 5 ' see if we already have a card from the pack
    r = packet( packCnt )
    IF c(r) = 0 THEN
    c(r) = 1
    ct = ct + 1 ' ct must get to 200 each trial
    END IF
    NEXT
    ctr = ctr + 1 ' ctr is number of purchases for a complete set
    IF ct = 200 THEN EXIT DO
    LOOP
    totI = totI + ctr ' Number of packs
    numTry = numTry + 1
    PRINT numTry, ctr, totI / numTry
    LOOP

      Posted by Tony on 2003-01-29 13:25:16

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


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

    Chatterbox:
    Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information