Randomly select an element from an array