World's most popular travel blog for travel bloggers.

Can every self-modifying algorithm be modelled by a non-selfmodifying algorithm?

, , No Comments
Problem Detail: 

If we have any arbitrary computer program that can modify its instructions, is it possible to simulate that program with a program that cannot modify its instructions?


Edit:

I am new to stackexchange so not sure if I'm allowed to ask a NEW question here, but here goes: Ok so the proof that it is possible is actually really simple as you guys have shown. Now, I am wondering: Are there problems for which it is more efficient (and to what extent) to use the most efficient self-modifying algorithm to solve the problem, versus the input-output-equivalent most efficient non-selfmodifying algorithm?

Asked By : Programmer2134

Answered By : David Richerby

Yes, it's possible. You can simulate the program by using an interpreter for the language it's written in. Now, the program (the interpreter) is fixed and the thing that used to be a self-modifying program is now the interpreter's data.

In particular, you could perfectly well have a universal Turing machine that allowed the TM it's simulating to modify its own description. (The description of the simulated machine, I mean; not the UTM.)

Best Answer from StackOverflow

Question Source : http://cs.stackexchange.com/questions/62275

0 comments:

Post a Comment

Let us know your responses and feedback