Ad
  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Done, and also changed the tolerance of the example test cases to +/- 1e-8 as it was still the 0.01 as in the old version. Thank you

  • Custom User Avatar

    Sample tests whereby length = 1 should be added

  • Custom User Avatar

    Thank you!

  • Custom User Avatar

    Nice kata!

  • Custom User Avatar

    Thanks for the input, I've added more fixed tests and more random tests. I will mark the issue as resolved now.

  • Custom User Avatar

    Agreed. I changed the tests to tolerate erros of +/- 1e-8.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    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.

  • Custom User Avatar

    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.

  • Default User Avatar

    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...

  • Custom User Avatar

    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?

  • Custom User Avatar

    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

  • Custom User Avatar

    A probability cannot be greater than 1.

  • Default User Avatar

    while running my currently "off-by-something" code in testing, it passed when certain test cases failed to show up.

  • Loading more items...