Select randomly accordingly to a gradient or distance

I'm looking for a tool to select accordingly to a gradient ramp or a distance.
For example, I need to select leaves of a tree, all leaves at the top, no leaves at the bottom.
In the middle ( 50% ) just half of elements are randomly selected and so on.
It would be very helpfull... :-)