# Arup Guha
# 3/30/2020
# Collecting Baseball Cards (Exercise 3 from COP 2930 March 30, 2020)

import random

NUMTRIALS = 1000
NUMCARDS = 792

def turnsToCompleteSet(n):

    mine = set()
    turns = 0

    # Keep on going until we have n unique numbers.
    while len(mine) < n:

        # Generate a random number 1 to n.
        num = random.randint(1,n)

        # Add it to the set.
        mine.add(num)

        # Update turn counter.
        turns += 1

    # Total number of turns.
    return turns

def main():

    # Run the appropriate trials adding total # of turns.
    total = 0
    for i in range(NUMTRIALS):
        total += turnsToCompleteSet(NUMCARDS)

    # Prints the average.
    print("Average # of turns = ", total/NUMTRIALS)
    
main()

    
