I am trying to implement a program that samples from two identically distributed Bernoulli random variables, $X_1$ and $X_2$, such that they have a specific correlation coefficient, $\rho$.
I found a post that almost does what I want to do:
https://stats.stackexchange.com/a/318935
However, the parameter $p$ of the Bernoulli distributions is dependent on $\rho$, i.e., I can't leave $p$ fixed and generate samples with a desired $\rho$. In theory, I do not see any reason why this should not be possible.