Sampling tokens with repeated labels

A workshop represents six physical activity tokens using this Python list. Each list entry represents a separate token, even when its label repeats. Assume random has already been imported.


Python
tokens = ["art", "art", "art", "music", "music", "drama"]
picked = random.sample(tokens, k=4)


Across all possible results of this call, determine the smallest and largest possible number of art tokens in picked. Also determine the smallest and largest possible number of different activity labels in picked. For example, two music tokens contribute two tokens but only one different label.


Enter all four counts as exact whole numbers.

Your answers

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More The random Module Questions: