Applications of the monte carlo method in medical physics