News for hackers. Stuff that matters.
Re:Gödel's Incompleteness Theorem in Bash by charcircuit on Friday February 25, 2022 @02:32AM (#30464563)
I can implement a basic behave_differently.sh

  head -c 1024 /dev/urandom
paradox.sh paradox.sh will be different than paradox.sh paradox.sh
Re:Gödel's Incompleteness Theorem in Bash by geysersam on Friday February 25, 2022 @02:44AM (#30464636)
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.
Re:Gödel's Incompleteness Theorem in Bash by tromp on Friday February 25, 2022 @02:55AM (#30464710)
One 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.
Re:Gödel's Incompleteness Theorem in Bash by geysersam on Friday February 25, 2022 @03:29AM (#30464918)
This 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.

Re:Gödel's Incompleteness Theorem in Bash by GTP on Friday February 25, 2022 @11:35AM (#30469075)
If 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
Re:Gödel's Incompleteness Theorem in Bash by geysersam on Friday February 25, 2022 @01:05PM (#30470183)
If my_program.sh runs forever - how will you obtain its output?

I think that's the problem here.

Re:Gödel's Incompleteness Theorem in Bash by GTP on Wednesday March 02, 2022 @11:00AM (#30528771)
You don't need to wait for it to terminate if you just print something and then invoke my_program.sh
Re:Gödel's Incompleteness Theorem in Bash by charcircuit on Friday February 25, 2022 @02:48AM (#30464673)
No, 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.
Re:Gödel's Incompleteness Theorem in Bash by shrx on Friday February 25, 2022 @04:57AM (#30465515)
> 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.

Re:Gödel's Incompleteness Theorem in Bash by geysersam on Friday February 25, 2022 @02:51AM (#30464687)
You'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
Re:Gödel's Incompleteness Theorem in Bash by arjvik on Friday February 25, 2022 @02:46AM (#30464657)
Ah, but determinism was implied. Remember, this argument was confirmed considering a Turing Machine.
Re:Gödel's Incompleteness Theorem in Bash by charcircuit on Friday February 25, 2022 @02:53AM (#30464700)
Also remember that we are considering a bash interpreter which implies we at least have access to $RANDOM. The section behave_differently.sh comes from is only focusing on bash. It does not mention Turing machines.
Re:Gödel's Incompleteness Theorem in Bash by BizarroLand on Friday February 25, 2022 @02:35PM (#30471291)
The thing is, the two instances do not "behave" differently. They only output different values based on the same process. Behaviorally they are identical.
Re:Gödel's Incompleteness Theorem in Bash by cornegidouille on Friday February 25, 2022 @04:46AM (#30465451)
You just brought an engineer to a scientist fight. In theory, what you're saying is wrong ; in practice, it's open to debate.