0

So it was said that Turing showed there are 6 primitives . i could think them as essentials needed to make programs.

  • So the move left/right command makes sense because while writing code we might need to go back to rewrite or add something more. Similarly forward too .
  • Erase is necessary for preventing any wrong term used in code. all this makes sense but why scan/print is needed now for making a program is it because to get if any code is wrong in the program we wrote? and print for running the code in the console?

Also does the basic operations like addition/sub.. comes already under those 6 primitives or the basic operations + strings + booleans are separate from those(i.e. other than those 6 primitives which Turing said that is present in python)?

joanis
  • 10,635
  • 14
  • 30
  • 40
Paracetamol
  • 101
  • 1
  • 1
    A Turing machine is a strange beast, with a tape in lieu of memory. Scan is how how you read data from the tape. Without it, there is no point in having anything on the tape in the first place. Print is how you write information on the tape. Again, without it, the tape is useful. While they're called scan and print, your can think of them as read and write. – joanis Jul 06 '22 at 18:38
  • 1
    Yes, all operations we can can be implemented using a Turing machine with these six primitives. That's the whole idea of Turing completeness. Now, a Turing machine is not efficient, far from it. It's just *able* to compute everything. – joanis Jul 06 '22 at 18:41
  • so those primitives contains those operations , so operations help primitives in working they are not same thing? and can you once please tell the definition of primitive briefly @joanis – Paracetamol Jul 07 '22 at 04:32
  • "primitive" is kind-of a loose concept here. In the Turing machine model, "primitive" is used to mean the most basic of operations. Yes, they are themselves operations. No, they don't contain other operations. Rather, other operations -- indeed all operations and computations -- can be expressed, or implemented, or programmed, by using just those primitives. – joanis Jul 07 '22 at 12:03
  • One useful way to think of "primitive" in the context of a Turing machine is, take the set of all possible operations. Among them, which ones cannot be expressed in terms of other simpler ones? Those *are* the primitives. – joanis Jul 07 '22 at 12:05
  • yeah that i understood , i mean when we say the primtives of turing machine will we say read , write , right left, erase,nothing as the only primitives or we will say the primitives will be basic operations like add , subtract etc ? for a turiung machine and any other machine @joanis – Paracetamol Jul 08 '22 at 06:10
  • or i think there is a difference between when we say **primitives** of a machine and **primitive operations** of a machine ? former one is the read , write stuff and the later includes the basic operations? so only 6 primitives in a turing machine but there can be many primitive operations ? – Paracetamol Jul 08 '22 at 06:12
  • I'm using "primitive" and "primitive operation" as exact synonyms here. – joanis Jul 08 '22 at 12:55
  • Now, I just went back to your question and you ask about Python. That's a jarring question, in way. Yeah, you could theoretically implement a Python interpreter on top of a Turing machine, but it would be horribly inefficient, none of the runtime complexities would be what you expect. We assume adding two numbers takes O(1) time because we assume we're working on a Von Neumann architecture with RAM and a CPU. – joanis Jul 08 '22 at 13:00
  • 1
    Attempting to wrap my brain around programming a Turing machine is a near impossible task! I mean, how would you even start approaching the implementation of addition? – joanis Jul 08 '22 at 13:02
  • 1
    I recommend you accept a Turing machine as purely mathematical construct. It was useful to Alan Turing for the halting problem and the computability problem, two theoretical questions of computing, But it has no practical use whatsoever outside theoretical computer science. – joanis Jul 08 '22 at 13:06
  • oh i see now i think i got it primitives if someone ask for languages like python etc we will answer by saying booleans ,strings etc . while the turing machine was a construction on how the languages etc might work in future from the basic idea it was having . for that primtives were read... etc . only it was not given a specific instruction to carry out a job like add etc . hence primitive operations what it can do (turing machine) doesnt make sense . but with programming languages we say primitives as synonymous to primitive operations, am i right? – Paracetamol Jul 08 '22 at 13:46
  • Not quite. The Turing machine was not about how things might work in the future. It was for doing proofs about computing theory. It was never intended to be built or used for computing, although I'm sure someone's either built or simulated one for the heck of it. For modern programming languages you might describe the fundamental data structures as primitive data structures (e.g.https://www.codesansar.com/python-programming/fundamental-or-primitive-data-types.htm) or you might talk about basic/fundamental/primitive operators. – joanis Jul 08 '22 at 14:18
  • But "primitive" is not actually a technical term here! It's just another word for "basic" or "fundamental" or whatever you want to call the first things you define in order to define/build/program other things on top of them. – joanis Jul 08 '22 at 14:19
  • now i finally understood thanks joanis – Paracetamol Jul 11 '22 at 09:03

0 Answers0