In question2, it loops for 3 time to get 3 different array X, but there are sometimes just two log-likelihood curves appears. How it happened? Thank you.
it is because there is a non zero probability (you can compute it, the probability is not so small) that you sample exactly the same sample for two of the curves. Then, the curves of the likelihood would be the same and would supperpose.