Rejection sampling for Monte-Carlo basic example