I am a programmer first, mathematician second - or farther down than that :). I asked a question about probability today, which the general consensus was "write a simulation"... which, of course, is right up my alley and I wrote rather quickly.

I then provided the results of my simulation in a TeX array.

My question is: would providing the source code to such a simulation be valuable / on-topic for Math.SE? I'm happy to do it... if it's on topic. A programming answer to a math question.

  • $\begingroup$ "If a question leads to code, should I provide the code?" Ideally. $\endgroup$ – Andrés E. Caicedo May 15 '14 at 17:46
  • $\begingroup$ If you are not shy about sharing your code, then you could place it on your web page and give a link. That way those who want so see it can, and those who don't won't be irritated by having a lot of code on the screen. $\endgroup$ – Jyrki Lahtonen May 15 '14 at 18:27
  • 3
    $\begingroup$ @JyrkiLahtonen That doesn't seem to agree with the ♦ answer; plus, I doubt that the "standard policy" for an SE site is for me to be redirecting traffic to my own personal webpage. $\endgroup$ – durron597 May 15 '14 at 19:17
  • $\begingroup$ Code is tangential to the primary purpose of this site, which is mathematics, so I don't think it's undesirable to link to code on your own webpage. If you were putting the mathematical content of the answer on your own page and only posting links to it here, then that would be a problem. $\endgroup$ – user856 May 16 '14 at 22:14

If you provide an answer containing only data, I don't think it's inappropriate to include the code that generated the data as an appendix. However, you should be careful about such "data-only answers," as they are really only acceptable as heuristics for when an exact answer cannot be found. Data is better than nothing, but it is not exactly mathematics.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .