I used statistical language R to fit probability distribution to acquired data. Instead of doing it by hand I relied on code. I wrote something like "probability density function was computed using programming language R (for more details see appendix A)". And appendix A has exact code to compute this. I also put reference to R package documentation. Is it bad to rely external tools for proof?
From what I can guess about the context, I would avoid putting the code in your paper unless:
- the code is really short (say no more than half a column);
- the code is interesting in itself;
- and you know that your average reader understands the language R.
Otherwise, it would probably better to omit the code altogether and write, in a note, something like:
To those interested, the authors can provide the R code employed to compute the probability density functions described in this work.
It's very common to include code when code was used. That being said, it's not clear whether you should think of this as "proof" of something in a rigorous mathematical sense, or whether is constitutes evidence in your argument. How accepted this is will depend on the community you are trying to convince.
It is fine to put it in your appendix / supplemental info, but it's not really necessary. Computing something as simple as a PDF should be easy for anyone. It's along the lines of including your work to convert from atomic units to Joules. However, enough people have forgotten to normalize correctly so there's nothing bad about including it.
You can put the source code in the appendix but it is not necessary.
1). For it to really matter that there is code in the appendix the read would need to have a basic understanding of programming to at least get the general idea.Other wise as soon as they see something like randomCode = NSString.format"string here"; they are so lost they'll skip over it.
2).If the length of the code is short and doesn't take up much space then even if the reader doesn't understand it you could use it as a "Hey this is the code" and not take up too much space for something the reader may have no understanding of. If the code is lengthy and takes up too much room (this is all dependent of the overall length of all of the other content) then even if the reader is a code junkie it's just too much.
3). You could post the code or at least parts of it and then explain what it actually means for example "This algorithm above is what takes all of the students grades and compiles them from a numeric value into a letter grade.