Skip to main content
3 of 4
I hadn’t tested enough.
Stephen Kitt
  • 481.4k
  • 60
  • 1.2k
  • 1.4k

If you want to do this only using commonly-available tools (at least on Linux distributions), the most efficient way is probably to ask shuf:

shuf -i 1-139 -n 1519 -r

This produces 1519 numbers randomly chosen between 1 and 139.

To ensure that each place gets one person, shuffle 139 numbers first without repeating:

shuf -i 1-139
shuf -i 1-139 -n 1380 -r
Stephen Kitt
  • 481.4k
  • 60
  • 1.2k
  • 1.4k