As a functional programmer, I can’t help but notice that invisible global state like random destroys the referential transparency of these programs and that they cease to be functions. If the random number generator’s seed were passed in as an argument, restoring purity, would termination be restored?
(Offhand, I don’t think it would. Even if program A used each digit to decide whether to defect or cooperate, program B could just follow the same strategy but choose the reverse and simulate one more step.)
As a functional programmer, I can’t help but notice that invisible global state like
random
destroys the referential transparency of these programs and that they cease to be functions. If the random number generator’s seed were passed in as an argument, restoring purity, would termination be restored?(Offhand, I don’t think it would. Even if program A used each digit to decide whether to defect or cooperate, program B could just follow the same strategy but choose the reverse and simulate one more step.)