Created
December 21, 2022 02:36
-
-
Save kazuho/eede3269e73ba2e03bb9e9d068cd30df to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n = 200 | |
m = 63 | |
q = 16 | |
c = 0 | |
1_000_000.times do | |
buckets = Array.new(m, 0) | |
n.times do | |
slot = rand(m) | |
buckets[slot] += 1 | |
if buckets[slot] > q then | |
c += 1 | |
break | |
end | |
end | |
end | |
puts c |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment