Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This comment is hidden because it contains spoiler information about the solution
Done, and also changed the tolerance of the example test cases to
+/- 1e-8
as it was still the0.01
as in the old version. Thank youSample tests whereby
length = 1
should be addedThank you!
Nice kata!
Thanks for the input, I've added more fixed tests and more random tests. I will mark the issue as resolved now.
Agreed. I changed the tests to tolerate erros of +/- 1e-8.
This comment is hidden because it contains spoiler information about the solution
I usually do whatever I can to figure out an issue, so apologies to the author for leaving a mess behind in this case. I'm travelling and only able to use a phone currently, but I will look for the problem soon.
I think we agree random testing should be as thorough as is reasonably possible. By that, yes, it may not be reasonable here. I suppose in this case it depends on what I can find, and in that case I may just write part of the generator myself.
Should the issue be closed? I will let others decide, no problem. Thanks for the feedback.
It would be nice for you to figure out the circumstances instead of leaving it to author - not more than nice, but you are doing weird things in your solution, and putting the onus on author is .. well, not nice. The edge case your solution is failing is not one he could reasonably foresee, if I understand things correctly.
I respectully disagree a random generator should always find your particular edge case. Random generators are useful to find unforeseen edge cases; if they find one, adding that particular test as a fixed one is adequate. If the edge case can actually be figured out and is a reasonable one, writing a separate additional random generator might be possible, but it might not; also, the edge case may be so weird it's not reasonable to write a random generator to catch it. Random generators with overly biased outputs are no longer useful to find all sorts of bugs - they only find the bugs they are biased towards finding.
you want this category of fail to be guaranteed to occur durng random tests, instead of just maybe, so the circumstance needs to be figured out...
I am not sure I understand the issue here, I tried running your code and I noticed it passes when (1, 5) and (1, 2) fail to show up in the random test cases for some reason.
I have now added these two test cases to the fixed "advanced tests" to make sure they always show up.
Does this solve the issue?
A probability can be expressed as a number between 0 and 1, a fraction or a percentage.
Here one of the many sources you can find online
A probability cannot be greater than 1.
while running my currently "off-by-something" code in testing, it passed when certain test cases failed to show up.
Loading more items...