What is the algorithm/formula for natural leaf decay?

Solution 1:

Once every game tick, 3 random blocks in every 163 block section close to you are assigned "block ticks". On blocks that support them, random activities such as plant growth and leaf decay occur on these block ticks.

Do note that block ticks only occur on blocks near you (that is to say, anywhere in a 15x15 chunk square centered on the chunk you're in). This means being just far enough away from leaves so that the chunks they are part of are still rendered, but are not candidates for block ticks, might mean they never decay until you return.