Skip to content

Conversation

@MasonProtter
Copy link
Contributor

Someone asked a question on Slack recently and my answer involved using shuffle! on a BitMatrix. I ran the code a few times and the bits ended up in the bottom right of the matrix each time which freaked me out, but then I did an actual statistical test and found that it was a fluke.

@StefanKarpinski suggested that I might as well stick it in the testsuite as a regression test, so here is that PR.

@MasonProtter MasonProtter changed the title Explicit test that shuffle! behaves correct on BitArrays Explicit test that shuffle! behaves correct on BitArrays Apr 22, 2021
@MasonProtter MasonProtter changed the title Explicit test that shuffle! behaves correct on BitArrays Explicit test that shuffle! behaves correct on BitArrays Apr 22, 2021
@kshyatt kshyatt added randomness Random number generation and the Random stdlib test This change adds or pertains to unit tests labels Apr 22, 2021
@mbauman
Copy link
Member

mbauman commented Apr 22, 2021

What are the odds this fails?

@MasonProtter
Copy link
Contributor Author

MasonProtter commented Apr 22, 2021

Should be zero because I set the random number generator explicitly, but I just ran the test 15_000 times using different RNGs each time and got one failure. So I think the bounds are somewhat appropriate

@MasonProtter MasonProtter requested a review from dkarrasch May 28, 2021 02:44
@dkarrasch dkarrasch merged commit 61701d7 into JuliaLang:master May 28, 2021
@MasonProtter MasonProtter deleted the patch-3 branch May 28, 2021 20:34
shirodkara pushed a commit to shirodkara/julia that referenced this pull request Jun 9, 2021
johanmon pushed a commit to johanmon/julia that referenced this pull request Jul 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

randomness Random number generation and the Random stdlib test This change adds or pertains to unit tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants