more efficient approach for random selection
not strictly equivalent to the previous one
Authored by: thibautd 2013-12-17
Parent: [r27218]
Child: [r27220]