Bug in Baffling Birthdays Tests

From experience, I find that the smaller a PR, the better chance of it being accepted, but I’ll add the optimization, too.

@glaxxie My PR got auto-closed. I tried pushing up more changes, but it didn’t update the PR. Not sure what to do at this point.

1 Like

It looks like one of the tests failed, but it wasn’t one that I modified. It looks like it has something to do with a REST API test.

Yeah, it is a well known small problem. It solves itself by re-run. I opened and re-test, everything should be good now. I will add in another note that people should consider doing 5000 runs with the 2% tolerance.

1 Like

Merged. Please mark the thread as resolved. Thank you for your contribution.
There are 3 more new exercises from the spec, if I find time I will try to port them in the next 2 weeks.

1 Like

I get that, but I am saying that the example code is likely the culprit, iterating to find the probabilities, instead of using the math, or even as described in one of my messages, approximating the math by intuition, and checking distribution by percentage expected.

And I understand about the "getting to true probability. But get to within 10% and I think the exercise teaches what it is intending to teach, with probably less than 1% missing the point.

The instructions tell you to solve the exercise by generating random birthdates and checking if a collection happens, then using this to find the probability (presumably by iterating a bunch of times). Is this the best approach to calculating a probability? No. But that’s the approach laid out in the instructions. It’s the programming-first approach over the statistics approach.

1 Like

At this point I consider this solved since my PR is merged. Whether or not the approach to this exercise has problems or not is a topic for a different thread.