r/computerscience • u/RicotaSuicida • Oct 26 '26
A question about Turing Machines
I have a question that popped in my mind about Turing Machines and the Busy Beaver function.
So, from the knowledge I have, programming languages are Turing complete, meaning they can do everything a Turing Machine can, which would mean that there is a way to translate a Turing Machine program to any Turing complete programming language, right?
Following from that, let's say we have a really simple program in any programming language that loops from 1 to 108 and do some computation inside that loop
Since the number of steps this program takes is higher than 107, does it mean it can't be translated to a 4 states 2 symbol machine, since BB(4) is 107?
How does the translation from a simple loop with N steps work?
12
u/finedesignvideos Oct 26 '26
That intuition is correct, The naive translation would involve having a counter and stopping when the counter reaches 108. Just checking if a counter is 108 would naively require as many states as there are bits in 108 (written in binary), which is 7.
1
u/claytonkb Oct 26 '26
It can't be translated to such a machine that halts, because no such machine exists (by definition of the Busy Beaver number for 4,2 Turing machines). So for any given halting Turing machine, there is some "biggest number" which that machine can handle, and that biggest number just is the Busy Beaver for that machine's state,symbol class. Every natural number larger than that BB number is "beyond" the capability of such machines, which halt, to ever touch.