Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct for bias towards first character in chars #9

Merged
merged 1 commit into from
Apr 3, 2015

Conversation

argusdusty
Copy link
Contributor

Currently the first character in chars has a 1/clen + 1/(maxrb+1) chance of being selected. In the case of StdChars the first character is ~25% more likely to be picked than any other character. This change gives a 1/clen chance to all characters, and is based on math/rand's Int31n(n).

Currently the first character in chars has a 1/clen + 1/(maxrb+1) chance of being selected. In the case of StdChars the first character is ~25% more likely to be picked than any other character. This change gives a 1/clen chance to all characters, and is based on math/rand's Int31n(n).
dchest added a commit that referenced this pull request Apr 3, 2015
Correct for bias towards first character in chars
@dchest dchest merged commit d7c89a5 into dchest:master Apr 3, 2015
@dchest
Copy link
Owner

dchest commented Apr 3, 2015

Thank you!

dchest added a commit that referenced this pull request Feb 12, 2016
Successfully detects bias fixed by PR #9.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants