I am confused about how to use the *apply function for question 1d, is the output of this apply supposed to give a vector of 1s (TRUE) which we sum and divide by m afterwards to calculate the average probabilities?
Yes.
I am confused about how to use the *apply function for question 1d, is the output of this apply supposed to give a vector of 1s (TRUE) which we sum and divide by m afterwards to calculate the average probabilities?