simulate correct number of random Bernoulli trials with prob Pij and arrange in the correctly-sized matrix