def weighted_combination(weights, distributions):
    """
    Returns a new distribution which is weighted combination of input distributions.
    weight0 corresponds to distribution0, weight1 to distribution1 and so on ...
    """

    sum_weights = sum(weights)
    newd = {}
    ndist = len(distributions)

    cues = distributions[0].keys()

    for cue in cues:
        weighted_sum = 0
        for i in range(ndist):
            weighted_sum += (weights[i] * distributions[i][cue])
        newd[cue] = weighted_sum / sum_weights

    return newd