# R, <s>30</s> 22 bytes ###code cat(runif(1)<1/scan()) #new runif(random number 0-1) scan(get input from user) 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.