[x86-64/baffling-birthdays] Concern regarding statistics test

My implementation generates random birthday evenly across day of year; i.e. i generates integer [0, 365) and convert into month-day.

However, my submission failed on test_generate_requested_number_of_birthdates, with message Expected 59532 to be less than or equal to 37367.

It is very likely that the test strictly expects to generate evenly across month value [1, 12].

As this is birthday quiz, I believe that random evenly across day of year is more “statically correct”.

I believe you’re correct. I’d have to take a closer look, but the test seems to expect the same frequency for each month. Can you please share your code here in codeblocks so we can reproduce the error?

It’s past midnight here, but I’ll take a look tomorrow.

Note 1) that I used rdrand for generating random number. Therefore, the test is very likely to be flaky.

Note 2) I didn’t implement estimated_probability_of_shared_birthday yet.

Yes, your code looks correct. Once the tests account for the different number of days in each month, I think it’ll pass.

I’ll check the test tomorrow.

1 Like

fix `baffling-birthdays` by oxe-i · Pull Request #495 · exercism/x86-64-assembly · GitHub should fix the test. A note was also added to the instructions explaining what is tested and how.

Thank you for reporting the problem. If you find any remaining issue, please report it.

1 Like

It is unfortunate that previous submissions are now marked as invalid.

However, as current exercise explicitly describes what and how is tested, anyone can write code which could pass statistics test.

Thanks for examining this issue.

1 Like

This happens fairly often as tests get updated.