If an answer is written in a language that deliberately prevents the programs written with it from doing the same output/calculations/etc. every time by introducing randomness, should it be deleted anyway?
1 Answer
\$\begingroup\$ \$\endgroup\$
5 No, it is not OK
If allowed, in an hypothetical probabilistic language that simply executes a random program without even looking at its source code, the empty program would be a solution to all code golf challenges.
On top of that we already reached consensus that all answers must work with probability 1, for every possible input.
- 1\$\begingroup\$ "Probability 1" is even still too loose - we require that every possible (valid) input results in a correct output. A solution could have an infinite set of inputs that work and a finite set of inputs that don't, and would still have probability 1 of working. \$\endgroup\$user45941– user459412016-06-21 20:06:07 +00:00Commented Jun 21, 2016 at 20:06
- \$\begingroup\$ Good point. I should have said probability 1 for every possible input. \$\endgroup\$2016-06-21 22:33:10 +00:00Commented Jun 21, 2016 at 22:33
- \$\begingroup\$ An answer with probability 1 can still be incorrect for every possible input. en.wikipedia.org/wiki/Almost_surely \$\endgroup\$noɥʇʎԀʎzɐɹƆ– noɥʇʎԀʎzɐɹƆ2016-06-22 15:23:23 +00:00Commented Jun 22, 2016 at 15:23
- \$\begingroup\$ @uoɥʇʎPʎzɐɹC That distinction is only meaningful if you execute the program an infinite number of times. \$\endgroup\$2016-06-23 18:02:18 +00:00Commented Jun 23, 2016 at 18:02
- \$\begingroup\$ @Dennis A simple example: Print nothing and halt. Then write a program to quit with 1/2 probability in an infinite loop. \$\endgroup\$jimmy23013– jimmy230132016-06-25 10:56:48 +00:00Commented Jun 25, 2016 at 10:56