rejection sampling does: samples from target by accepting/rejecting proposals

How do you randomly pick a number following a strange rule?

Image: Wolfgang Thieme, CC BY-SA 3.0 de, via Wikimedia Commons

rejection sampling does: samples from target by accepting/rejecting proposals

How do you randomly pick a number following a strange rule?

Imagine you're trying to pick a random day of the year that falls on a weekend, but you want to ensure it's a Saturday. How would you do that?

Think of days as points on a circle. To find a Saturday, you randomly pick a day and check if it's a Saturday. If not, you keep looking until you find one. This process is called rejection sampling, where you keep picking until you meet the condition.

Example

If you randomly select days, you might pick Tuesday, then Wednesday, then Thursday, and finally Saturday. You keep rejecting the days that aren't Saturdays until you hit one.

Remember this

Rejection sampling is like repeatedly choosing random days until you hit the one that fits your rule.

Related concepts

Swipe through 100 ML concepts daily

Open Pocket Polymath