Add baffling-birthdays exercise - #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. |
11fe39c to
8bffcb9
Compare
|
I don't think this is 'hoops', this is just that I need learning more and more :) |
|
new stats with runs=2k |
|
The fact that this requires so much work and learning to get working in a reasonable amount of time indicates to me that this may not be a great fit for the bash track 😄 Thoughts on marking this foregone, @glennj ? |
We have:
I think we can proceed. We'll probably see monstly 1 and 3 submitted. An instructions.append.md file would be useful to gently steer people along. Approaches articles might help too. |
Solutions that take long to run will fail the test runner. The approaches article can only be viewed after passing tests. We'd want to provide a fair bit of guidance in the append file to help students get this to pass on the test runner. |
|
How about this approach:
|
baffling-birthdays exercicebaffling-birthdays exercise
|
What's the status on this PR? |
* Co-authored-by: IsaacG * Co-authored-by: glennj
* Co-authored-by: IsaacG
…cism#784) update comments in bats-extra.bash files author: glennj
Safe tolerance adjustment for 2k runs
12cba5f to
9eca3bd
Compare
Co-authored-by: Glenn Jackman <glenn.jackman@gmail.com>
|
@IsaacG I think this is ready to merge. The exercise status is "wip". |
|
fixes at #893 |
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 :