Created
March 31, 2020 08:17
-
-
Save eustin/44f436fe679fad020e5a66cab29096ee 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
def calc_prop_matching_pairs(trial_results): | |
num_matching_pairs = sum([1 for x in results.values() if x[0] == x[1]]) | |
num_total_pairs = len(results.values()) | |
# of all the pairs we have drawn, what proportion were matching pairs of socks? | |
prop_matching_pairs = num_matching_pairs / num_total_pairs | |
print(f"\nprop valid pairs over {NUM_TRIALS:,} trials: {prop_matching_pairs:.2f}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment