Guest User

Untitled

a guest
Mar 6th, 2019
247
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import random
  2.  
  3. lands = 4*['B'] + 3*['U'] + 3*['G'] + 3*['W'] + 3*['UG'] + 1*['UW'] + 1*['WB']
  4. num_simulations = 500000
  5.  
  6. lands_drawn = [3, 4, 5, 6]
  7. for num_lands in lands_drawn:
  8.     counts = [0] * 5
  9.     for _ in range(num_simulations):
  10.         lands_drawn = random.sample(lands, num_lands)
  11.         colors = []
  12.         for card in lands_drawn:
  13.             colors += list(card)
  14.         colors = set(colors)
  15.         counts[len(colors)] += 1
  16.     print('{}: {}'.format(num_lands, [count / num_simulations for count in counts]))
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×