Which model of computation is "the best"? - MathOverflow most recent 30 from http://mathoverflow.net 2013-05-24T18:30:26Z http://mathoverflow.net/feeds/question/44558 http://www.creativecommons.org/licenses/by-nc/2.5/rdf http://mathoverflow.net/questions/44558/which-model-of-computation-is-the-best Which model of computation is "the best"? Tatiana Starikovskaya 2010-11-02T13:57:46Z 2010-11-11T01:24:31Z <p>In 1937 Turing described a Turing machine. Since then many models of computation have been decribed in attempt to find a model which is like a real computer but still simple enough to design and analyse algorithms.</p> <p>As a result, we have dozen of algorithms for, e.g., SORT-problem for different models of computation. Unfortunately, we even cannot be sure that an implementation of an algorithm with running time $O(n)$ in a word RAM with bit-vector operations allowed will run faster than an an implementation of an algorithm with running time $O(n \cdot \log{n})$ in a word RAM (I am talking about "good" implementations only, of course).</p> <p>So, I want to understand which of existing models is "the best" for designing algorithms and I am looking for an up-to-date and detailed survey on models of computation, which gives pros and cons of models and their closeness to reality. </p> http://mathoverflow.net/questions/44558/which-model-of-computation-is-the-best/44636#44636 Answer by Mark Sapir for Which model of computation is "the best"? Mark Sapir 2010-11-03T02:22:34Z 2010-11-03T10:13:32Z <p>Kolmogorov, apparently, asked the same question. Here is a paper, where he tried to answer it (with Uspenskii): Kolmogorov, A. N.; Uspenskiĭ, V. A. On the definition of an algorithm. (Russian) Uspehi Mat. Nauk 13 1958 no. 4(82), 3–28. I do not know if there were followup articles, but the idea of Yu. Gurevich' "Abstract state machines" is somewhat similar. Both Kolmogorov and Gurevich tried to "simulate" actual real life algorithms. Here is one of the (many) papers on abstract state machines: Blass, Andreas; Gurevich, Yuri Abstract state machines capture parallel algorithms: correction and extension. ACM Trans. Comput. Log. 9 (2008), no. 3, Art. 19, 32 pp. This is not the foundational paper on the subject, but it gives a definition and has references to more foundational papers. Also look at <a href="http://en.wikipedia.org/wiki/Abstract_state_machines" rel="nofollow"> this Wiki article. </a></p> http://mathoverflow.net/questions/44558/which-model-of-computation-is-the-best/44638#44638 Answer by Joel David Hamkins for Which model of computation is "the best"? Joel David Hamkins 2010-11-03T02:53:06Z 2010-11-03T02:59:36Z <p>Since you've asked the question here at MathOverflow rather than a CS theory site, let me try to give the perspective from <a href="http://en.wikipedia.org/wiki/Computability_theory" rel="nofollow">computability theory</a> rather than <a href="http://en.wikipedia.org/wiki/Computational_complexity_theory" rel="nofollow">computational complexity theory</a>. Thus, I give in a sense a math answer rather than a CS answer, although I realize that this is not the answer you seek.</p> <p>From the perspective of computability theory, the most important fact about all the dozens or hundreds of varieties of computational models is precisely the fact that <em>they are all equivalent</em>. There is no "best" model.</p> <p>It really is quite remarkable that all the models of computation that have been proposed give rise to exactly the same class of computable functions and decidable sets.</p> <ul> <li>Turing machines, Turing machines with multiple tapes, single tape, big alphabets, multi-heads, etc., register machines, register machines with expanded instruction sets, machines with stacks, recursive functions, $\Sigma_1$-definable functions in arithmetic, etc. etc. and even game of life viewed as computation, group theoretic word problems, post correspondence computations, tiling problems viewed as computational models...</li> </ul> <p>The fact that all the proposed models of computability are equivalent in this way indicates that this concept of computability is a highly robust mathematical idea. Indeed, the equivalence of the models is usually taken as strong or even decisive evidence for the <a href="http://en.wikipedia.org/wiki/Church%E2%80%93Turing_thesis" rel="nofollow">Church-Turing thesis</a>, the philosophical claim that any of these definitions of computability captures the notion of what is computable-in-principle.</p> <p>It is easy to imagine, after all, that things might have turned out differently, and that there would be a hierarchy of computability, where having a stronger machine model would allow you to decide more sets and to compute a larger class of functions. But instead, we have a low-level threshold phenomenon, where once you attain a certain very primitive power of computability, then all the models can simulate all the other models.</p> <p>Thus, from this computability theory point of view, there is no "best" model, and it doesn't matter at all which model you use. The purpose of the models in computability theory is not to design computers or to design algorithms, but to help us understand the power of computability and especially its limitations. Most computability theorists do not rely on a single model of computability, and prefer to fall back on abstract definability characterizations, which center on the idea of unbounded search, at the essence of computability.</p> <p>I am reminded of conversations I've often had with students, who upon seeing the Turing machine model want to extend it by adding extra power to the machines, allowing the machine to do in one step what used to take several or augmenting the machine with registers and so on, in order to make a "better" Turing machine. Such efforts are completely pointless, because the purpose of the Turing machine model is not to program with it, but rather to have a theoretical model that is simple, yet fully powerful. We want a weak-seeming model, because we want to use the model to show that things are <em>not</em> computable, rather than that they are.</p> <p>But I realize that this is probably not your perspective. It is sometimes said that the difference between computability theory and computational complexity theory is that the computability theorist is fundamentally interested in studying the <em>non</em>-computable, the hierarchy of Turing degrees, while the complexity theorist studies what <em>is</em> computable.</p> <p>The equivalence between the models extends deeply down into complexity theory, in the sense that to my knowledge, all of the standard models of computability offer polynomial time simulation in each other. That is, any model can simulate any other model within a polynomial time factor.</p> <p>Thus, the differences between the models arise only when one cares about the particular polynomial, as you indicate you do in your question. And this is a concern that takes one out of computability theory and into computational complexity.</p> http://mathoverflow.net/questions/44558/which-model-of-computation-is-the-best/44651#44651 Answer by sleepless in beantown for Which model of computation is "the best"? sleepless in beantown 2010-11-03T05:44:53Z 2010-11-11T01:24:31Z <p><strong>The best model depends upon the hardware being considered.</strong></p> <p>I agree with Joel David Hamkin's answer and with Mark Sapir's answer. The point of computability models, such as Turing machines, regular languages, push-down automata with stacks, etc., is to show the equivalence of these models. THe reason for the big-O notation order of complexity is to show that, within a small additive constant, complexity can be defined in terms of a linear, polynomial, or exponential (or otherish) relation to a particular characteristic factor of the input (usually the size of the input). The only thing that changes for that computation on different systems is a multiplicative factor, or the additive constant.</p> <p>Kolmogorov talks about quantitating this type of complexity based on abstract state machines, and coming up with a minimal-descriptor length type of explanation of complexity, and prefix-complexity.</p> <p>Complexity can refer to </p> <ul> <li><p>space-complexity, how much memory (RAM, lengths and numbers of tapes of Turing machines, how much space on a 2-d grid for a 2-d turing machine, how much of the stacks for push-down stack automata) is required to perform the calculation, as a function of the size or characteristic of the input</p></li> <li><p>time-complexity, how much time (number of computation steps, number of movements of the read-head + number of movements of the write-head, number of clicks of the clock = crystal-oscillator for the CPU circuits for synchronous logic circuitry)</p></li> <li><p>logic complexity (~? algorithmic complexity ?) - how many gates (AND, NOT, OR, XOR, NOR, flip-flops, latches, multiplexors, demultiplexors, line traces) are required to build the circuit (e.g. how can you implement a shift-bit-adder with silicon logic using only NPN transistors or only TTL logic), how many transistors, how many relays and wires, how much "surface area" for a 2-d instantiation of a circuit on a LSI / VLSI large-scale-integration very-large-scale-integrated circuit chip, how much "volume" for a 3-d multi-layer VLSI circuit chip, how many traces of the FPGA (field programmable gate array) are required to implement the algorithm in hardware, i.e. <em>how large is the program to describe/implement the algorithm</em></p></li> </ul> <p>However, the computer science courses that talk about computability theory are talking about these concepts abstractly, even when they talk about it for a particular algorithm, or even for a particular circuit (like a bit-adder with carry-over shifting) in electrical engineering circuit design classes.</p> <blockquote> <p>The best model depends upon the hardware being considered.</p> </blockquote> <p>A model for data-flow in the Connection Machine with a 10-dimensional hyper-cube network architecture for its 1024 processors and single-bit processing is not going to be an adequate model for data-flow in a TCP/IP 10-gigabit ethernet network connected Beowulf cluster with 1024 nodes consisting of hex-core 64-bit processors, or for a Tilera cluster of 16 chips with 64 cores per chip with multiple orders of communication latency difference between intra-chip <em>vs.</em> inter-chip communication time delays.</p> <p>Or a model for SIMD (single instruction multiple data) type of parallelization is not going to be reasonable for a model of GPU (graphical processing unit) computation using the GPU as a co-processor.</p> <p>It is not reasonable to speak of a "best model" without specifying the hardware, or at least the architecture, and the limits of the amount of RAM available (at the different levels of use and speed, level I cache, level II cache, ..., RAM dedicated to one CPU, RAM shared between multiple CPUs, RAM that will be swapped out to disk/hard drive, external NAS=network attached storage), and the algorithms and processes which are to be optimized and analyzed for complexity.</p> http://mathoverflow.net/questions/44558/which-model-of-computation-is-the-best/44655#44655 Answer by Andrej Bauer for Which model of computation is "the best"? Andrej Bauer 2010-11-03T06:23:33Z 2010-11-03T06:23:33Z <p>While it is the case that many models of computation agree on which functions $\mathbb{N} \to \mathbb{N}$ are computable, I would like to point out that this is <em>not</em> the case when we think of higher-order functions. (I am making this remark not to answer the question but to supplement the existing answers.)</p> <p>For example, in Gödel's T (simply typed $\lambda$-calculus with booleans, natural numbers and <em>primitive</em> recursion) there is no universal quantifier $all : (\mathbb{N} \to 2) \to 2$, i.e., a map such that $$all(f) = \begin{cases}1 &amp; \text{if \forall n . f(n) = 1} \\ 0 &amp; \text{otherwise.}\end{cases}$$ But we <a href="http://math.andrej.com/2007/09/28/seemingly-impossible-functional-programs/" rel="nofollow">can write such a quantifier</a> in <a href="http://en.wikipedia.org/wiki/Programming_language_for_Computable_Functions" rel="nofollow">PCF</a> (simply typed $\lambda$-calculus with booleans, natural numbers and <em>general</em> recursion). Once we have a candidate program $all$, we still have to worry whether it works. The answer again depends on the model of computation.</p> <p>If we use as the underlying model Kleene's number realizability, i.e., Turing machines which accept and output finite strings of bits, then $all$ does not work because of <a href="http://math.andrej.com/2006/04/25/konigs-lemma-and-the-kleene-tree/" rel="nofollow">the Kleene tree</a>. If we use as the underlying model Kleene's function realizability, i.e., Turing machines which accept as input and output infinite strings of bits, including non-computable ones, then $all$ works.</p> <p>As a second example, let me mention (exact) real number computation. There are two ways to models reals:</p> <ol> <li><p><em>Intensionally</em> as a datatype $R_I$ of Cauchy sequences in which each real is represented by (fast) Cauchy sequences of rationals converging to it. In particular, a program may inspect the representation of a real.</p></li> <li><p><em>Extensionally</em> as an abstract datatype $R_E$ of real numbers where we cannot inspect the representation of the reals. An example of such a language is <a href="http://www.cs.bham.ac.uk/~mhe/papers/RNC3.pdf" rel="nofollow">RealPCF</a>. </p></li> </ol> <p>It has been known that $R_I$ and $R_E$ represent the same reals, that $R_I^{R_I}$ and $R_E^{R_E}$ represent the same maps, and that $R_I^{R_I^{R_I}}$ and $R_E^{R_E^{R_E}}$ represent the same rank 2 functionals. But recently Matthias Schröder proved that at the next level we have a disagreement between $R_I^{R_I^{R_I^{R_I}}}$ and $R_E^{R_E^{R_E^{R_E}}}$!</p> <p>Higher-type computation can be quite intriguing, and there it's definitely not the case that "all models of computation are equivalent".</p> http://mathoverflow.net/questions/44558/which-model-of-computation-is-the-best/44922#44922 Answer by Gerhard Paseman for Which model of computation is "the best"? Gerhard Paseman 2010-11-05T05:12:25Z 2010-11-05T05:12:25Z <p>I suggest that "best" be changed to "projected". For development and prototyping, many systems are designed and simulated on machines with a small number of processors. With cloud computing here and swarm computing not so far away (and possibly quantum computing being realized once the physicists solve the hard problems), your best model of today and of yesteryear may soon be superceded by an adequate model of tomorrow. Even just understanding massively parallel processing well is a worthy goal and likely to be applicable to the upcoming shifts in technology.</p> <p>Gerhard "Ask Me About System Design" Paseman, 2010.11.04</p>