Back to General discussions forum
In the first example 3.03 2778 5570.06 5627.46
, the expected answer is 0.652
.
I've simulated this 10 million times and get 0.647
(this doesn't give anything away as larger examples
cannot be simulated this way in any meaningful time).
I also get 0.647
via a completly different method.
Can I please check that 0.652
is indeed the correct answer?
Thanks for raising the question! Asked the same from Artyom, as my simulation results are more consistent with yours :) Probably we'll figure out if there is some discrepancy (it seems to be more with lesser N - i.e. checker supposedly uses assymptotic formula) and if necessary will make appropriate corrections I think. Sorry for inconvenience, but hopefully we'll be able to improve it together!
I've calculated the three values for the example. I get 0.646915973241, 0.122064092167 and 0.757535551769. My first answer seems remarkably close to the simulation so I suspect that there is something wrong with the example. The method I used to solve the problem requires degree level statistics. If this is the only way to solve the problem it does seem a little out of place in Code Abbey.
I get very similar 0.646916 0.122064 0.757535
for the examples.
Personally I think the problem is fine and interesting - researching topics is often part of the challenge, and many
programming puzzles, including here on CodeAbbey, require advanced math in some way.
Also, the more diversiy in contributors and contributions the better - welcome and thank you ecolog_veteran.
I don't have an issue with the problem. I just wonder how many people who use the site will have any idea of how to approach it. In all the problems on the site I think that there is only one where I needed to use some significant mathematics. That was Easter Eggs Advanced. If problems requiring advanced maths are to become more common then it might be an idea to give some indication of this in the problem description. I have assumed that the mathematics tag for a problem meant senior school level mathematics (at best) rather than anything beyond that.
Hi Clive and thanks for the insight!
On ideas to approach the problem, I felt, when adding it, there are at least two - either one knows whimsical stats calculations or, thanks to 3-digits precision expected, it is an opportunity to carefully create simulation experiment.
My main fault probably is that I haven't tested either way beforehand! Sorry for that!
It looks already 3 persons knows "how to approach" the first way (there were failed submissions by JesseDai
),
so probably it may enjoy some audience even here. We remember here are easier problems requiring using/knowing some
formula (e.g. even "Bicycle Race", "Triangle Area" and somewhat unexpectedly "Star Medals" and even "Josephus") and
I never knew whether problems of such kind are good for programming-related collection. So perhaps let this one also
exist, but I'll try not abuse the topic of "degree" problems in future according to your hint :)
Meanwhile, let's do this - I'll share the formulas suggested by Artyom to you and Mathias by email, so it is easier to discuss suitable amendments.
Reply in your inbox.
Danke!
Mathias suggested there is a small typo in sigma calculation and I just have updated checker according to suggestion.
In few more minutes I'll retry matching results with simulation and if all ok, will also update the example in the problem statement.
UPD: Just got email from Artyom, he also approves and thanks for this fix!
Artyom,
There are now 5 solutions to your problem. I was clearly mistaken to think that an advanced maths problem would not appeal to users of this site. In any case, I echo Mathias' thoughts. It is very encouraging to see new people providing problems for the site. Thank you for your contribution.
I am glad to hear these warming words! Hopefully, it was interesting to solve this task :)