3 ms·
Not always. ;) Specifically, if my_program.sh outputs some 1024 lines then it is still nonzero probability that your behave_differently.sh does not in fact beha
by geysersam 5y ago
Not always. ;)
Specifically, if my_program.sh outputs some 1024 lines then it is still nonzero probability that your behave_differently.sh does not in fact behave differently.
- charcircuit 5y agoNo, there's a 0% chance my implementation outputs 1 as that is only 1 byte long. If you outputted 1023 0s and then a 1 there would be a 2^-1024 chance. That probability is too small to practically happen. The heat death of the universe will happen first.
- geysersam 5y agoYou're right that my example was flawed. I've updated it. There is however still nonzero probability that ./behave_differently.sh some_peogram.sh behaves the same as ./some_program.sh
- shrx 5y ago> The heat death of the universe will happen first. No, the heat death might be _more likely_ to happen first, but it's not guaranteed.
- tromp 5y agoOne could try to guarantee unique outputs with sleep 1 date but the intended requirement of behave_differently is that it produces different output when run on a computer in exactly the same state. Or equivalently, that the program doesn't depend on the computer state, which is true in the more formal setting of universal Turing machines that start from a fixed state.
- geysersam 5y agoThis does not solve the issue. behave_different.sh has to behave different *all* the time *on every input*. Not just 99.999999% of the time. Imagine my_program.sh says: echo "2022-02-26 10:30:00" and you run your version of behave_differently.sh at 10:29:59 on the 26/2. Then the output is the same.
- GTP 5y agoIf you want something that always behaves differently, why not just concatenating something to whatever the output of the other script would be? I'm familiar with the halting problem, but considering the quick description inside this post I don't see which part of it would forbid this