Two simple commented codes to understand the accept/reject sampling method when dealing with pdfs with bounded and unbounded support