I'm pretty sure it's supposed to be the other way around, but I don't think there is as catchy a way to say it properly. Turing complete means it can run any Turing machine. Being unable to be run on a Turing machine does not mean it isn't Turing complete. E.g. Turing machine with a halting oracle is Turing complete, but can't be simulated with a Turing machine.
I actually deleted my comment after writing it. After googling it seems that C optimizers do do this.
This is from Gemini and I haven't checked the source yet, but it seems confident:
Under the ISO C and C++ standards, if an iteration statement (loop) has no observable behavior—such as input/output operations, volatile memory access, atomic operations, or thread synchronization—the compiler is legally allowed to assume that the loop will eventually terminate
I mean we can undercut Turing and go straight to Gödel since it has fewer assumptions. If god exists in a logical system, then how can he prove the unprovable? How is he able to avoid the diagonalization argument? As far as the mythology goes, god seems to operate within normal rules of logic (although maybe not physical rules of logic). I guess Gödel still has some assumptions, but I’m pretty sure they’re prerequisites to any useful logical system.
if you want to be real pedantic, God doesn't need to prove that his answer is correct, but he does know and is obviously right. He did also decide the answer so I mean
if we take god as real is the assumption not that he wrote the rules? If not, then what is god in this case? Like obviously his existence brings up problems but i thought we were taking it for granted and not thinking about it too hard for the sake of this specific problem.
Well, I’m talking about the philosophical “god”, not the evangelical. An evangelical just says “god is all powerful, he created everything, including logic” and accepts it without much extra thought. But each of these assumptions brings several concrete logical issues— none of which with a clear resolution. I’ll ignore the other issues (e.g., all-powerful / all-good cannot coexist with evil). This is a huge topic in philosophy and has been for thousands of years: Descartes, Ockham, Lewis Carroll, etc. The idea that god created logic gives several issues: nothing can be said about anything that existed before logic— they can’t be said to do or decide anything. So if god created logic, the statement “god created logic” is meaningless. Nothing true can be said about logic. It also means that our notion of logic could very reasonably be nonsense, i.e. god could be lying to us about logic (Descartes’ evil demon). If god did not create logic, then everything works out as expected, but you have to give up a degree of what you would like to assume “all powerful” means.
If you want to look into this, pretty much all philosophy since writing has existed touches on these concepts.
It also means that our notion of logic could very reasonably be nonsense, i.e. god could be lying to us about logic (Descartes’ evil demon).
Yeah that's kind of what I think "God created logic" entails, that the way things actually work is beyond our comprehension and a real actual capital G God would be by no means bound to the rules that we are, and that we live in a simulated or limited reality under his created rules.
I just assumed that if we say "god" (especially an omniscient one) we assume that this is the evangelical depiction, in which case saying "this god violates logic and can't exist" is a separate argument
Well the idea that our logic is a lie isn’t a comfortable one to accept. It basically means that nothing we think, do, or prove has any meaning or actual truth. Even that assertion itself can’t be inferred. You’re correct that, if we’re talking about the evangelical god, then no, this isn’t a problem. But, to them, neither are the hundreds of other logical contradictions in that theology. But this is math we’re talking about, we have a higher standard :)
Gödel says you can't prove some statements about a system within that system. But you may be able to prove it in a "higher" system that adds more rules. Presumably an infinite being would be able to use an infinite number of such systems.
Yes, but “proving it in a higher system” ultimately decomposes into effectively “take this unprovable result as an axiom”, sometimes in a more clever or agreeable way (see axiom of choice with well ordering theorem). But it can never be resolved. That’s what I was saying in another comment, is that god can trivially serve as this higher-order system, but that doesn’t mean he can actually compute the result or check that it’s true. And an “infinite being can resolve an infinite sequence” only applies if that infinite regress has a resolution possible in the first place. In this case, no matter how high you go, you can never prove the consistency of a system without the higher system. So it doesn’t matter if you can do it an “infinite number of times” (while pretending that infinity can exist in a concrete way like this in this system) if each time doesn’t change anything. The limit of 1 as n goes to infinity is 1.
Gödel's incompleteness theorem is also a computability theory result. God could know all mathematical truth expressible in ZFC (or other systems), even if the collection of all true sentences isn't computable, as Gödel showed.
The question isn’t whether god could know all mathematical truth in ZFC. It’s whether he could prove it. If he can prove an unprovable truth in any (useful) logical system, then he violates logic. Unless you count god’s knowledge of the truth as sufficient proof, but that’s equivalent to me proving the consistency of ZFC in a higher system with some extra axioms (whose consistency I also can’t prove). God seems to operate within a logical system, so his all-powerful ability to prove a simple truth is problematic. This is what my comment was getting at.
Sure, but that's just a limitation of computation. If a statement is independent, and we don't have any good extra assumptions to demonstrate that independence, then that's that. Nevertheless, God's word would be the ultimate oracle, so proof by authority would be justified in this instance.
Gödel’s incompleteness theorem is not a problem in computation theory, and neither is the provability of any statement inside a logical system. They’re related of course, but computation theory has far more binding assumptions that give god an easy out, as I mentioned (e.g., god is not a Turing machine). Of course god’s contribution to this could simply be “this is true”, and that’s the proof. But that’s no different than us humans “proving” the continuum hypothesis by taking it as an axiom in a higher system. God is effectively just serving as the higher system here. I don’t find that any more satisfying than I do us knowing that Collatz is true but being unable to prove it.
I'd encourage you to read the statement of Gödel's incompleteness theorems again. The first theorem, as applied to first-order logic, reads: "any consistent r.e. theory that interprets Robinson arithmetic cannot be complete." On the other hand, ZFC proves "there is a set of true sentences of arithmetic" (because it says N is a structure). The oft-cited corollary of Gödel's first incompleteness theorem is that true arithmetic isn't r.e.
Edit: And yes, it might be that God knows something is true but can't prove it to humans, and thus must serve as a higher system. But that's not a limitation of God; that's a limitation of human belief. We think the Axiom of Power Set is true because it seems intuitive, but there are alternative systems like predicative mathematics that don't accept it.
First, this isn’t my area of maths, so my understanding is limited to a Wikipedia article I read some time ago. But it seems you’re right that this is indeed a question of computability. You can accept Th(N) as your set of axioms and everything is trivially provable, but you can’t actually check that any of them are true. So my initial comment was misguided. However, I still stand by my philosophical objection that god being able to “prove” (now corrected to mean “check/compute”) everything violates the rules of logic, and that it’s a reasonable expectation of an all-powerful god. Although it might just reduce to the same theological value as the objection “can god create an object he can’t move”.
god being able to “prove” (now corrected to mean “check/compute”) everything violates the rules of logic, and that it’s a reasonable expectation of an all-powerful god
Of course, an omniscient and omnipotent God still cannot produce a Turing machine that enumerates a complete and consistent theory of arithmetic. We know that's mathematically impossible, like a square circle. But God need not himself be a Turing machine. For example, we could say that God can, in his mind, comprehend the entirety of Th(N) as a set. In other words, he knows at once all infinite possibilities of what is true or not in arithmetic. Edit: And once you know true arithmetic, you know everything about all man-made formal systems, which are, after all, r.e. theories.
I don't think this is accurate. The whole point of the halting problem proof was to show that the oracle was, in and of itself, a mathematical contradiction. If a deity could determine whether any arbitrary machine would halt on any arbitrary input, that deity would be self-contradictory.
In ZFC, the halting oracle does exist. Just take the indicator function of the set {n∈N | n codes a halting TM}. Turing's halting problem proof shows (via diagonalization) that there isn't a Turing machine that can solve it.
Then, maybe, we should stop building Turing-Complete machines, that way we can try to build a Oracle-Complete machine that can halt the non-halting process.
That is why we don't focus on Turing Machines. Turing Complete is so restrictive, like s(0) = s(0), and dumbt things like that. But our Oracle-Oracle machine would know.
No, that proof is about inability to create a program for Turing machine (or something similar)/computable function that takes any program and answer if it stops. Look at the proof. In the "draft" version, we create a function that use haltinmg-test, and feed it to itself. Looking closely, we see a contradiction. But it is a contradiction that follows from our assumptions, including the model of computations.
Similarly, without bothering gods, there IS a function h(p,x) that for any program p and input data x returns, if the program p(x) halts. It is just a function from a pair of finite string to {0,1}. But it is not a computable function. The function exist, but a "program", an "algorithm", that can get those p and x, then compute the answer, does not.
I mean, definitions are contextual, not prescriptive. In the context you are attempting to apply, invoking logic and philosophy, many philosophers hold the definition I just stated. This is especially because the amount of people who are of the belief that logical contradictions can be actual is incredibly low, which make your definition of omnipotence essentially useless in that field. I'd agree that many would say things like "can do anything" or "all powerful" when asked what omnipotence means, but that doesnt make it the one true definition of anything.
If a almighty entity exists, it should be able to give the correct answer without knowing the question. Otherwise it wouldn’t be almighty. So O(1) should be correct.
But now we are in a highly theoretical and improbable realm 😅
He can give you the answer from the future and do the work himself later, but unless you're also omniscient beyond time you're going to have to wait for the answer to resolve.
I can change the value of pi, just assume different geometry. What's hard to me is to make physical geometry conform to my new system, but that shouldn't be all that hard to God. He made the thing, after all.
You can find the biggest number in an array in O(1), so your lower bound is not justified. The caveat is that you need n2 cores but that's an implementation detail in GodOS.
Processor (i,j) check is a_i is smaller than a__j. If it is, it report it to processor (i,0). (there we should ask what model of communication we have. Lets say it is a queue that work by magic:)). In the second cycle processors (i,0) check, if there are any reports at his input queue (it can onloy read one per cycle, but if there is none, it doens't bother us). If none, it mean a_i >= a_j for all j. It is the maximum. "Write" the result (a_i).
Edit: Can downvoting people explain why they do it? This is exactly what the guy asked for: how to find a maximum in an array in O(1) time, having O(n^2) processors.
It is just two comments above. "... The caveat is that you need n2 cores" That was the entire point of the joke Mindgaptor made. Then someone asked how to find it in O(1). Sure, he did not repeat the assumption about the cores... because it is rights there.
Realistically, you can keep track of the largest value at insertion/removal time, or you can have the array sorted and keep track of the highest indexed element. Otherwise, as they said, you can parallelize the function to run on n2 processor cores such that it technically runs in O(1), but even then it would need at least O(log n) for comparing the core's results, but regardless, this is widely impactical from the overhead alone.
Otherwise, as they said, you can parallelize the function to run on n2 processor cores such that it technically runs in O(1) time,
Ok, I'll bite. You can have N cores all read 1 value from the array, then each core spawns N-1 other threads / cores that each read 1 other value to compare to. That's all O(1).
But at the end of that you'll need to check the result of all these N-1 cores to check that they're all lower. And that requires O(n) time in naive implementation, or O(log(N)) if you do a reduction strategy.
Damn, I should've checked their claim properly. I didn't consider the time complexity of actually joining the results together, only the comparison itself. Thanks for the correction.
You just need a better algorithm. We note A the initial array. n its length. Each step is a single cpu cycle Step 1: allocate a buffer of size n, called B initialized with zeros. Step 2: for each i,j in [0, n[ with i != j if A[i] <= A[j] then write 1 in B[i]. This is O(1) because we have enough cpus, and if they write, they all write the same value. Step 3: for each i in [0, n[ if B[i] == 0 return A[i]. This is O(1) because we have enough cpus. A single value is returned by design of the algo.
Yeah I can probably solve any O(N) problem in O(1) time if I had O(N2) cores. That doesn't make the problem O(1) because as the problem increases you either need to add more cores or take more time. Which is the definition of the complexity of the algorithm.
Also you need to initialize the threads anyway. Even if you have each thread initializing threads until you have enough O(N2) threads that would still require O(log(N)) time.
Well it moves a time constraint to a resource one. Time is constant but resources needed scale at n2. Thread init is an implementation detail. It obviously won't work on a machine from the shelf, but a dedicated built could do it.
This is still O(n), as the number of ops scale linearly with the size of the input. Big-O is fundamentally a measure of an algorithm’s complexity. Saying it moves a time constraint to a resource constraint doesn’t alleviate the algorithms complexity.
You don't. You write a predefined memory address. If others write at the same time, it's only UB if a different value tried to be written. Check the original comment answers, someone else described at the same time something similar if you want a different approach.
You can also keep a sorted copy of an array alongside an unsorted array. That doesn't mean sorting is now O(1) because you can just return the sorted copy. (Also that would make appending O(N) because insertion to an arbitrary place in an array is O(N))
All I did was provide ways to access the largest number from an array in O(1), which is useful if you need that element again and again and again, but it may change inbetween uses.
Keeping track of it dynamically has some overhead, but makes getting the max O(1) since it never has to be computed to begin with.
Same for your sorting example, of course computationally sorting doesn't become O(1), but getting the sorted version, now through lookup instead, becomes O(1).
Obviously, a barebone array isn't capable of that, but that's what programming is about: creating whatever functionality you need yourself (or using another person's implementation). Even more so in OOP, where you could easily subclass an existing type or implement your own for this purpose.
Its a reference to the speed of light joke, where god is asked why he made the speed of light 299972458m/s, and god replies "huh, the speed of light is 1."
You have written this earlier, and I still do not know what do you mean by it? Our definition of what?
O(.) ? If we go with the theory that the author of the joke had omniscience in mind, it is rather problem with the author who haven't thought it through. Otherwise, as someone already pointed out, it is a O(1) problem (with n^6 CPUs :))
the 1 in O(1) doesn't even need to be the value 1, it can be any positive number. by definition O(af(n)) = O(f(n)) for any positive constant a. By convention we simplify to the simplest form the equivalence class has, so we drop the multipliers and write O(a1) as O(1)
One is one, it's a number, there no other number that is equal to one and every one are the same one for everyone.
One finger is like the digit "1", it's a way to represent one to others. God may have it's own digit to write "1" in it's own langage like "I" for romans.
From what I've seen the problem is actually k-sum and can be studied with k different from 3. So yeah, definitely voluntary from the researchers to focus on 3-sum specifically,
O(1)? you mean O(N), right? you can't sort N items without taking at least N steps unless you have a teleporter.
I'm assuming this was radix sort, which is indeed O(N) for sorting integers with fixed word length. comparison sort is proven to be O(N log N) at best because a binary tree with N leaves has N log N nodes.
528
u/BobRossTheSequel Oct 14 '26
Christian algorithms require only a single query to the oracle
750
u/cosmicomical23 Oct 14 '26
If god is omniscient, can he always know whether a process is going to terminate or not?
1.0k
u/bartekltg Oct 14 '26
\serious_mode it has to be at least O(n).
202
u/theone_2099 Oct 14 '26
This one is deep. Answer is funny on at least a couple of levels.
98
u/UlyssesTheRhinoceros Oct 14 '26
Its a reference to the speed of light joke, where god is asked why he made the speed of light 299972458m/s, and god replies "huh, the speed of light is 1."
36
u/Evening-Appeal7606 Oct 14 '26
Kind of makes sense now that Jesus states in Matthew 10:30 that our hairs are counted. It's a simple hash lookup to the Lord, apparently.
153
u/KazutoOKirigay Oct 14 '26
Why would he use our numeric system??
45
u/StructuredQuery Oct 14 '26
oh, its not about threesomes? :c
12
u/whiskeytown79 Oct 14 '26
I initially read that as 3SAT and I was like "omg someone found a polynomial solution to an NP-complete problem"
9
u/Soggy_Recognition873 Oct 14 '26
It was indeed about 3 some 🥀🥀
8
u/KitsuneFoxglove Oct 14 '26
This reminds me of the O(1) sorting algorithm in TempleOS in that one niche game that I will not name.
6
u/Traditional-Bid1746 Oct 14 '26
Yeah nah a 3sum is O(MG)
3
u/SoldRIP Oct 14 '26
If big G is on the machine, miracle sort is actually O(0).
3
u/Chronomechanist Oct 15 '26
For god, time and space are the same thing, so he just uses the space complexity and runs it on an infinite number of threads.
1
u/FlashyTone3042 19d ago
God: I use templeOS btw
1
u/crispim1411 Oct 15 '26
Oh yeah threesomes 🤤
-2
u/Huzbi Oct 14 '26
Why did I thought of that 3sun instead of programming problem 3sum. (+_+)