Comparing two colour-weight schemes

A game selects one colour using the following Python code. Assume random has already been imported.


Python
colours = ["red", "blue", "green"]
result = random.choices(colours, weights=[2, 5, 3], k=1)


The developer then considers replacing the weights with [4, 10, 6], keeping the colour order unchanged. The figure compares these two schemes.


A grouped bar chart shows original and doubled selection weights for red, blue, and green.


Complete the table with the probability that the single selected colour is each listed colour. Enter exact decimals between 0 and 1, rather than percentages.

Selected colourProbability with original weightsProbability with doubled weights
Red
Blue
Green

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: