import random


def choose_between_by_p(l1, l2, p, count):
    """
    Choose `count` elements from `l1` (w/ prob `p`) and `l2` (w/ prob `p`-1).
    """
    assert 0 <= p
    assert p <= 1
    return [random.choice(l1) if random.random() <= p else random.choice(l2) for _ in range(count)]