Current Residence: Round Rock, TX Favourite genre of music: everything Favourite photographer: I have to pick? Favourite style of art: psychedelic Operating System: OS X MP3 player of choice: iPod Nano Shell of choice: /bin/tcsh Skin of choice: brownish-pink Favourite cartoon character: Crona from Soul Eater
Favourite Visual Artist
Cara Mitten, Stephanie Lostimolo, Brian Froud, Alphonse Mucha, Max Ernst
#!/usr/bin/python
# Please see this Wikipedia article
# http://en.wikipedia.org/wiki/NBA_draft_lottery#1990.E2.80.93present:_Weighted_lottery_system
def prob(v_dict, item, num_draws):
""" Find the probability of item being drawn on any of num_draws
in a weighted lottery (no replacement)."""
# probability = probability of drawing item on first + probability of not drawing
# item on first*probability of drawing item on second time
prob_item = v_dict[item]/sum(v_dict.values())
if num_draws < 1:
return 0.0
if num_draws == 1:
return prob_item
if num_draws >= len(v_dict):