Add baffling-birthdays exercice#779
Conversation
|
|
You can try doubling your runs from 1k to 2k. You can try widening the acceptable probability range. |
f401a42 to
a95d347
Compare
|
OK, it passes 6 times in a row (with this one) so far... |
a95d347 to
d01f64f
Compare
|
It passed 4 times in a row before i push this, and now it failed for 10 and 23 people tests! (in the php track, I ran it 10k ... but in bash it would take so much time !!) |
b77a468 to
1d4dfd3
Compare
|
re-increased tolerance for |
How much time is too much time? How slow is 3k? 4k? If it takes more than, say, 5 seconds, we probably want to widen the tolerance. |
it was about 20+ minutes for 2k - 3k before modifications... |
1d4dfd3 to
f4268c2
Compare
|
Regarding the slowness, you'll get must faster performance by using the builtin # return a random number in the range 0 <= n < $1
random_int() {
echo $(( RANDOM % $1 ))
}
february_days=$(( 1 + $(random_int 28) ))With group_size = 10 and runs = 5000, you're calling shuf 150,000 times and date 50,000 times. |
284834a to
9a564dd
Compare
11fe39c to
8bffcb9
Compare
* Co-authored-by: IsaacG * Co-authored-by: glennj
8bffcb9 to
ccc55d4
Compare
on fail: |
The "random" exercises are like that. Don't forget, once this PR is merged, it will also run for every subsequent merge (one of the GHA workflows tests all exercises). So we'd want it succeeding just about every time. |
bf5b0d0 to
f45a92f
Compare
I agree. I'll run many tests on 2 machines to see if it fails, and if it does, maybe we would increase the tolerance? so far, 8 in a row with this one Edit1: 25 runs and no fails.... stats: Edit2: I'll run with 3k runs (instead of 2k) to see results (with ranges: |
Add baffling-birthdays exercice to track.
I change difficulty from 1 to 4.
Hope everything is correct.
float with bash !
I increase the tolerance for the exercice with 10 and 23 people because, after multiple runs (many time consuming), sometimes one or the other fail when checking only respectively
11|12|13and50|51|52.or might be another way to do it more precisely ?
The other option is to increase the number of runs, but this is very time consuming in bash! (set now at 1000)
maybe I can try to parallelize the computings? or creating a file would help?
I got these result while debbuging :