import random

def monte_carlo():
    
    s = 10 * '0' + 10 * '1'
    L = list(s)
    count_in_church = 0
    RUNS = 10000


    for _ in range(RUNS):
        random.shuffle(L)
    
        # check if bride steps into church by checking if
        # the number of ones exceeds the number of zeros
        cnt_0 = 0
        cnt_1 = 0
              
        for c in L:
            if c == '0': cnt_0 += 1
            else: cnt_1 += 1

            if cnt_1 > cnt_0:
                count_in_church += 1
                break    


    total_permutations = RUNS
    print("number of times bride entered church: ", count_in_church)
    print("total permutations:", total_permutations)
    print("probability:", count_in_church / total_permutations)


monte_carlo()