Skip to content

Instantly share code, notes, and snippets.

@vjcitn
Created October 15, 2016 11:21
Show Gist options
  • Save vjcitn/f224425a527414f353a108e2dfa3d7fc to your computer and use it in GitHub Desktop.
Save vjcitn/f224425a527414f353a108e2dfa3d7fc to your computer and use it in GitHub Desktop.
simple implementation of lincoln petersen population size estimation applied to letters
lincpet = function(ssize=17) {
s1 = sample(letters, size=ssize, replace=FALSE)
s2 = sample(letters, size=ssize, replace=FALSE)
ssize^2/length(intersect(s1,s2))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment