def likelihood(pList, nList):
    """
    The likelihood for probabilities `pList` of a die,
    given `nList` counts for each outcome.
    """
    output = 1.
    for i, pVal in enumerate(pList):
        output *= pVal**nList[i]
    return output