# How do I know if I'm right?

I created a puzzle about probabilities which, as it happens, is easiest to answer by running a computer simulation.

Three people have provided an answer to this question, all with differing results. They have all, however, reached the same conclusion in response to the bonus question that there is no answer to it.

The problem is that when I compare the results to my own simulations the figures from one of the respondents are close to mine for small numbers of robots, but the results diverge as the number of robots increases and my simulations do give an answer to the bonus part of the question.

I'm am quite prepared to admit that I might have made a mistake with my coding, but this isn't a code review site, so how should I proceed? Should I accept the answer of the person whose figures are close to mine, or should I enter into discussions with all the respondents about differences between their code and mine to see if we can determine the REAL answer?

• If the easiest answer is by running a computer simulation, how is it a puzzle?
– f''
Commented Nov 13, 2015 at 5:23
• @f" Given some of the answers I've seen on this site, I thought that there was a possibility that someone might have given a mathematical solution. Commented Nov 13, 2015 at 7:28

Some suggestions for you:

• Ask people to provide links to sites where they have uploaded their code. And then discuss the differences in the code. These could be due to errors, or due to different interpretations of the question. If you still get different answers after resolving these differences, it probably means that some approach is better than some other. Then you could ask a more specific question(s) on StackOverflow as to which algorithms are better.
• Format it as a coding challenge and upload the question itself to Programming Puzzles and Code Golf SE.
• Don't accept any answer that relies entirely on a computer simulation, as that doesn't make a very good Puzzling SE answer. Wait for a mathematical solution, or don't accept an answer at all. (Side note: If a mathematical solution does not exist, it usually is an indication of an off-topic puzzle)

I would personally recommend option 2. But someone else may have a better opinion.

• Please don't do option 2. Getting others to do useful coding for you is against the spirit of PPCG, and will likely neither create a good challenge nor get you useful solutions.
– xnor
Commented Nov 14, 2015 at 9:20
• @xnor The others are not doing useful coding for you, they're doing it for themselves as it is they who are going to earn all the rep. And why can't this question by written as a good code golf Q? Commented Nov 14, 2015 at 16:06
• @xnor I'm not stating that I'm right, you could be right. I'm just curious. Commented Nov 14, 2015 at 16:06
• An answer you want can be a good code golf question, but my experience has been that it rarely happens because they are optimized for different things. Also, It's good practice to have written an answer to a challenge you post so you can make sure the spec is tight, foresee ambiguities, and generate test cases. Without having written the code or knowing the answer in advance, there's a big risk of a major flaw not being caught beforehand.
– xnor
Commented Nov 15, 2015 at 7:59
• Option 2 is completely inappropriate for a simple reason. The different answers almost certainly disagree not because of bugs in the code but because the spec is insufficiently clear. So the only thing that will be accomplished by posting on PPCG is that the question will be closed as "Unclear what you're asking" - which IMO is what should have happened to the question on this site too. Commented Nov 15, 2015 at 13:48
• @xnor Okay, thanks for letting me know. Commented Nov 16, 2015 at 16:45
• @PeterTaylor There is only 1 down-vote on the question, so not many people share your opinion. Is the question really unclear? Commented Nov 16, 2015 at 16:46
• If you have four people who all think they're implementing the same spec, but who all get different results, I think it's more likely that they're interpreting the spec differently than that they're all interpreting it identically but introducing different bugs. And I personally wouldn't attempt to implement it without first asking for some detailed clarification. Commented Nov 16, 2015 at 17:07