Skip to content

Commit

Permalink
don't let random_dist_structure return an empty distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
Autoplectic committed May 9, 2016
1 parent ed9cd5a commit 8e92ce3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dit/distconst.py
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,7 @@ def random_dist_structure(outcome_length, alphabet_size):
A uniform distribution over a random subset of joint events.
"""
bound = 2**(alphabet_size**outcome_length)
return _int_to_dist(randint(0, bound), outcome_length, alphabet_size)
return _int_to_dist(randint(1, bound), outcome_length, alphabet_size)

def _combine_scalar_dists(d1, d2, op):
"""
Expand Down

0 comments on commit 8e92ce3

Please sign in to comment.