Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • 2
    Bear in mind that if you want a 1 in N odds of running C1, you must probably use (( RANDOM % N == 0 )) rather than (( RANDOM % N )). It's only the in special case of N=2 that these have identical probability. Commented Jul 8, 2015 at 3:25
  • 2
    Plainly put, of what practical use would be RANDOM % $N without == 0? IMO, for example with N=100, it is much more pragmatic to want a 1 in 100 odds (delivered with == 0) than a 99 in 100 odds (delivered without == 0). Commented Jul 8, 2015 at 20:41