import random


def roll_dice(probability):
    """given a probability, generate 1 or 0"""
    randomResult = random.uniform(0, 1)
    if probability >= randomResult:
        return 1
    else:
        return 0