Monte Carlo Simulations for Ultramarathon Lotteries

I've entered the lotteries for both Hardrock 100 and Western States 100 for several years, without any luck so far. Both races hold lotteries in December to draw the "lucky" winners that get to run their races. Both end up posting the odds that everyone has based on how many tickets you have in the lottery. They do this by running a Monte Carlo simulation several thousand (or millions) of times. Out of curiosity, this year I decided to write a program to do the simulation myself. Now I can find out my odds before the races officially post them! But I didn't really do it for that but just as an exercise to do as programmers are wont to do.