When I create a new opal, I want to randomly assign it one of many possible features. However, I want some qualities to be more common than others. I have a hash with possible features and their relative probability (out of a total of 1). 

How do I choose a feature at random, but weighted according to the probability?

```
'possible_features': 
    {
        'white_pin_fire_green': '0.00138', 
        'white_pin_fire_blue': '0.00138', 
        'white_pin_fire_yellow': '0.00144', 
        'white_pin_fire_purple': '0.00144', 
        'white_pin_fire_pink': '0.00036',
        'white_straw_green': '0.01196', 
        'white_straw_blue': '0.01196', 
        'white_straw_yellow': '0.01248', 
        'white_straw_purple': '0.01248', 
        'white_straw_pink': '0.00312', 
        'white_ribbon_green': '0.01196', 
        'white_ribbon_blue': '0.01196', 
        'white_ribbon_yellow': '0.01248', 
        'white_ribbon_purple': '0.01248', 
        'white_ribbon_pink': '0.00312',  
        'white_harlequin_green': '0.0069', 
        'white_harlequin_blue': '0.0069', 
        'white_harlequin_yellow': '0.0072', 
        'white_harlequin_purple': '0.0072', 
        'white_harlequin_pink': '0.0018',
        'white_no_fire': '0.06', 
        'black_pin_fire_green': '0.00552', 
        'black_pin_fire_blue': '0.00552', 
        'black_pin_fire_yellow': '0.00576', 
        'black_pin_fire_purple': '0.00576', 
        'black_pin_fire_pink': '0.00144',
        'black_straw_green': '0.04784', 
        'black_straw_blue': '0.04784', 
        'black_straw_yellow': '0.04992', 
        'black_straw_purple': '0.04992', 
        'black_straw_pink': '0.01248', 
        'black_ribbon_green': '0.04784', 
        'black_ribbon_blue': '0.04784', 
        'black_ribbon_yellow': '0.04992', 
        'black_ribbon_purple': '0.04992', 
        'black_ribbon_pink': '0.01248', 
        'black_harlequin_green': '0.0276', 
        'black_harlequin_blue': '0.0276', 
        'black_harlequin_yellow': '0.0288', 
        'black_harlequin_purple': '0.0288', 
        'black_harlequin_pink': '0.0072',
        'black_no_fire': '0.24'
    }

```

For example, if I randomly generate 100 opals, I'd like for approximately 24 of them to have the "black\_no\_fire" feature. 

Thank you for any help!