Select random elements from an array