Created
December 8, 2018 23:47
-
-
Save vsmelov/fa9ad4f7e0a7228fcae01eca8706eece to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
N_EXPERIMENTS = 10000 | |
N_SWIPES = 250 | |
A_REAL_RATE = 66 / 250 | |
B_REAL_RATE = 70 / 250 | |
def experiment(): | |
""" observable rate for A and B """ | |
a = sum(random.random() < A_REAL_RATE for i in range(N_SWIPES)) | |
b = sum(random.random() < B_REAL_RATE for i in range(N_SWIPES)) | |
return a, b | |
experiments_resuls = [experiment() for i in range(N_EXPERIMENTS)] | |
error_rate = sum(a > b for a, b in experiments_resuls) / N_EXPERIMENTS | |
print(f'error_rate = {error_rate}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment