Julia, 17 bytes
f(n)=n==rand(1:n)
This is a function that generates a random integer between 1 and n
and tests for equality with n
. There will be a 1/n chance of returning true
.
f(n)=n==rand(1:n)
This is a function that generates a random integer between 1 and n
and tests for equality with n
. There will be a 1/n chance of returning true
.