Skip to main content
6 of 7
added 64 characters in body
Mutador
  • 1.4k
  • 10
  • 15

R, 30 22 bytes

###code cat(runif(1)<1/scan()) #new f=function(N)cat(runif(1)<1/N) #old

It generates a number from a uniform distribution (0 to 1) and should evaluate to true 1/n of the times.

Mutador
  • 1.4k
  • 10
  • 15