Created
February 11, 2024 18:56
-
-
Save romanmichaelpaolucci/803b569709cabe65524289958b6206a7 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 numpy as np | |
day2 = [] | |
for i in range(10000): | |
# Randomly select coin 1 or 2 on day 1 | |
X = np.random.randint(0, 2) | |
# Flip either coin and append the outcome to day2 vector | |
if X == 1: | |
day2.append(np.random.choice([0, 1], p=[.3, .7])) | |
else: | |
day2.append(np.random.choice([0, 1], p=[.4, .6])) | |
print(np.mean(day2)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment