Let $X_1$ and $X_2$ be two Bernoulli random variables, with $P(X_1=1)=p_1$ and $P(X_2=1)=p_2$. The following discussion showed how to generate a pair of correlated Bernoulli variables with correlation coefficient $\rho$. I want to do the same but for 3 variables $X_1$, $X_2$, $X_3$ with respective probability $p_1$, $p_2$ and $p_3$ and identical correlation coefficient $\rho$ between $X_1$ and $X_2$, $X_1$ and $X_3$ and $X_2$ and $X_3$. Intuitively, it seems that this has multiple solutions depending on the higher order association between $X_1$, $X_2$, $X_3$, which I would then fix to 0. Is there a way to generate such distributions of Bernoulli variables (i.e. find the probability of each combination of the three variables)? Can it be generalized to more than 3 variables (assuming null association between more than two variables)?