from random import *

def simul(p):
    if uniform(0, 1) < p:
        return 1
    else:
        return 0
