import math


def get_num_words_with_entropy(bits_of_entropy, wordlist):
    """ Gets the number of words randomly selected from a given wordlist that
        would result in the number of bits of entropy specified.
    """
    entropy_per_word = math.log(len(wordlist))/math.log(2)
    num_words = int(math.ceil(bits_of_entropy/entropy_per_word))
    return num_words