import math


def num_action_type_bits(num_actions):
    """For a table with `num_actions` different actions that can be
    performed, return the number of bits to do a straightforward
    encoding of these as separate unique ids."""
    assert(num_actions >= 0)
    if num_actions == 0:
        return 0
    return int(math.ceil(math.log(num_actions, 2)))