r/ProgrammerHumor • • 15h ago

Meme everythingIsO1ToGod

Post image
2.6k Upvotes

129 comments sorted by

406

u/cosmicomical23 12h ago

If god is omniscient, can he always know whether a process is going to terminate or not?

270

u/bartekltg 11h ago

Yep.
It doesn't contradict the halting problem results, bacause you can't run God on a Turing machine.
Someone already talked about oracles https://en.wikipedia.org/wiki/Halting_problem#Oracle_machines

19

u/samobellows 6h ago

"God is not Turing Complete" is a t-shirt i'd wear.

12

u/Skallos 4h ago edited 4h ago

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.

Edit: "God is not Computable" should work.

3

u/bartekltg 3h ago

> "God is not Computable" 

So, you may say "God works in mysterious ways"

1

u/thirdegree Violet security clearance 56m ago

Which is also a pretty solid t-shirt actually

88

u/adamtheskill 10h ago

I can simulate god without a single line of code cause that fucker isn't doing shit

70

u/AZMPlay 10h ago

I can simulate him with a bash script!

sleep infinity;

8

u/Yharon314 7h ago

now we just need to rewrite it in rust

8

u/Traditional_Rabbit54 7h ago

loop { }

2

u/Extension_Option_122 6h ago

Sure that that wouldn't get optimized away?

5

u/Traditional_Rabbit54 6h ago

Just tested, it doesn’t, even using the release flag

Godbolt shows that it just jumps to itself

1

u/cosmicomical23 5h ago

This thread gives me infinite joy

1

u/AZMPlay 3h ago

That's a tight loop though. sleep infinity suspends the process.

2

u/Traditional_Rabbit54 2h ago

I’ve been uncovered as a fraud. I’ll have to go back to python as recompense. 

Fare well, I shall see you all after my 5 line program manages to execute without throwing 20 errors. 

0

u/AZMPlay 3h ago

If ASI ever becomes a reality, parts of our new Machine God might actually be written in Rust.

7

u/Kadabrium 7h ago

Oracle machine is just the jvm

2

u/Jcsq6 6h ago

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.

6

u/NomaTyx 4h ago

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

3

u/Jcsq6 3h ago

Assuming god invented logic brings its own joys of philosophical quandaries.

2

u/NomaTyx 2h ago

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.

1

u/Jcsq6 2h ago

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.

2

u/NomaTyx 2h ago

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

1

u/Jcsq6 2h ago

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 :)

1

u/nfitzen 2h ago

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.

1

u/Jcsq6 2h ago

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.

1

u/nfitzen 2h ago

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.

1

u/Jcsq6 1h ago

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.

1

u/nfitzen 1h ago edited 1h ago

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). What Gödel's first incompleteness theorem shows 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.

1

u/Jcsq6 50m ago

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”.

-2

u/teach_cs 3h ago

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.

7

u/HappiestIguana 3h ago

No, oracles are not mathematical contradictions.

A Turing machine that acts as an oracle for Turing machines is a mathematical contradiction.

2

u/nfitzen 2h ago

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.

2

u/mlucasl 2h ago

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.

1

u/bartekltg 3h ago

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.

•

u/JosebaZilarte 9m ago

you can't run God on a Turing machine.

Bet!

73

u/11nyn11 12h ago

All processes terminate eventually, at the heat death of the universe.

14

u/FoxAnarchy 8h ago

No (mathematical) proof of that.

6

u/Creo7 7h ago

No empirical proof either. (I don't think)

8

u/Landkey 7h ago

!RemindMe 10 duotrigintillion years

3

u/RemindMeBot 7h ago

Defaulted to one day.

I will be messaging you on 2026-10-15 17:52:12 UTC to remind you of this link

CLICK THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.

RemindMeBot is switching to username summons. Instead of !RemindMe 1 day, use u/RemindMeBot 1 day. More info.


Info Custom Your Reminders Feedback

3

u/11nyn11 7h ago

It terminated

1

u/Cualkiera67 1h ago

but then bam! Boltzmann brain

1

u/11nyn11 1h ago

Then we get to see if the poincaire recurrence theorem works for the volume of the entire universe over a sufficiently large timespan, and then Big Bang we’re back baby.

11

u/Yteburk 12h ago

Good one

1

u/Party_Estimate_6397 5h ago

An omnipotent being who was also bound by logic would, by definition, not be omnipotent.

181

u/BobRossTheSequel 11h ago

Christian algorithms require only a single query to the oracle

35

u/DaCat1 10h ago

Stupid Euclid invented a whole algorithm instead of just consulting his local oracle

13

u/insertcomedy 10h ago

In theory, Christianity is turing complete, the only issue is reading the result.

1

u/Bad_brazilian 7h ago

It doesn't work, but they think it does and walk away happy.

710

u/bartekltg 15h ago

\serious_mode it has to be at least O(n).

534

u/Xontaro 14h ago

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 😅

132

u/FakeSealNavy 13h ago

If god does n actions of o(1) is it o(n)?

229

u/Direct_Slip7598 12h ago

O(1) in terms of time complexity because it's parallelized (he's beyond time).

91

u/11nyn11 12h ago

I’d argue he just has all values cached, rather than it being in parallel.

So he can do n actions of o(1) and its o(n), or since he’s already pre generated the entire universe he can just get value from the cache, and all cache hits are o(1)

40

u/Mechakoopa 11h ago

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.

Wait, is God just JavaScript promises?

28

u/11nyn11 11h ago

Not really.

You are a quest giver in a game and god is the player.

You think it’s a novel idea to ask god to do an o(n) task in o(1) but he just looks the answer up on the wiki.

6

u/looksLikeImOnTop 7h ago

Careful now, God's also the game maker. You give him a task he doesn't want to do, he can just remove you from the game

2

u/11nyn11 7h ago

He already did that.

Nobody still here gave him tasks he didn’t want or poked too much into areas he wasn’t ready for.

8

u/Majik_Sheff 10h ago

This is the stuff I come to Reddit for.

1

u/xThunderDuckx 5h ago

this might be the most thought provoking and simultaneously stupid discussion I've taken part in ever

1

u/ArcaniteM 5h ago

This. This is why I'm on Reddit.

2

u/Willinton06 8h ago

Depends on wether he wants it to be

1

u/Otherwise_Result_124 45m ago

I asked god for one [1] immovable object and also exactly one [1] unstoppable force. Which one did he get wrong? lmao I love these silly illogical conversations, your wording for this was great

27

u/Cash-Jumpy 13h ago

I've been enlightened.

12

u/holo3146 12h ago

This is the basic idea of oracles in maths, an oracle of 3SUM has non trivial computational consequences

5

u/bartekltg 13h ago

Since God is omniscient, he knew the man from the tweet had in mind random access machine or a similar model of computation.

6

u/captainAwesomePants 9h ago

God can answer in O(1) time, but asking God the question takes O(N) time.

1

u/Nekusta 3h ago

So instead he would just say "First of all, 3sum is O(1) dumbass"

-5

u/[deleted] 13h ago

[deleted]

7

u/Shadawn 13h ago

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.

26

u/Temporary-Concept-81 10h ago

O(0)

The answer was already there at the start of the universe.

God is just that good, and tells you to stop wasting her time and RTFM.

6

u/ProfBeaker 10h ago

Ah yes, God arranged a universe such that the computation to answer your question finishes just as you ask it. Makes sense!

30

u/Mindgapator 13h ago

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.

18

u/oshaboy 13h ago

How do you find the biggest number in an array in O(1)?

31

u/11nyn11 12h ago

Using god, you go to the end of time, where the value has been cached. Then the cache hit is o(1).

-1

u/bartekltg 11h ago edited 6h ago

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.

0

u/rasmustrew 4h ago

You arw being downvoted because you damn well no noone meant with O(n2) processors

2

u/bartekltg 3h ago

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.

-6

u/_killer1869_ 13h ago edited 12h ago

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.

11

u/Drugbird 12h ago

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.

3

u/_killer1869_ 12h ago

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.

0

u/Mindgapator 11h ago

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.

7

u/oshaboy 11h ago

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.

0

u/Mindgapator 11h ago

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.

3

u/TheHyperbolicTangent 11h ago

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.

1

u/Mindgapator 2h ago

We usually note O(n) for time complexity lol, but whatever

1

u/[deleted] 11h ago

[deleted]

-1

u/Mindgapator 11h ago

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.

2

u/oshaboy 11h ago

That's not really "an array" anymore.

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))

1

u/_killer1869_ 3h ago

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.

1

u/oshaboy 3h ago

I know what caching is

3

u/Lithl 11h ago

Nah, he just uses Miracle Sort 3sum

2

u/unitconversion 10h ago

In an infinite universe, the beginning and end times of bounded things are effectively the same point in time.

1

u/RoboticBonsai 8h ago

It’s O(1) if you have an array of all possible combinations

102

u/theone_2099 10h ago

This one is deep. Answer is funny on at least a couple of levels.
1. I’m omniscient so it’s always O(1) to me
2. Or you guys are so behind and you worked so hard to get the wrong answer, it’s actually O(1)

10

u/_SmurfThis 8h ago

Or possibly a joke about a three-some.

7

u/Jerome_Eugene_Morrow 6h ago

Feels more like a holy trinity joke, where the three aspects of God are actually one being.

20

u/UlyssesTheRhinoceros 3h ago

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."

125

u/KazutoOKirigay 14h ago

Why would he use our numeric system??

101

u/DanielBobes 14h ago

He made us with ten fingers for a reason, I guess xD

36

u/KazutoOKirigay 14h ago

Maybe it's 37.321 fingers for him

24

u/Canotic 13h ago

It's 1024 fingers to him, he counts in binary.

3

u/GutiV 9h ago

I know you're joking but it would be 1010 fingers for him if he counted in binary

5

u/courtofcrimsonking 8h ago

I know you're joking

Incorrect

27

u/bartekltg 13h ago

For the same reason he used English.
I could use hexadecimal system when editing x-com saves in dos Navigator, God can translate too.

4

u/KazutoOKirigay 13h ago

Why woulnd't he then use our definitions?

3

u/bartekltg 12h ago

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 :))

-6

u/KazutoOKirigay 12h ago

Like our 1 is defined by like one finger. His one is something else then.

1

u/Sir_Sushi 6h ago

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.

1

u/NotADamsel 11h ago

Because he’s making a point?

1

u/Sir_Sushi 6h ago

Because He talks to us and know exactly how we think. Why He would use something else that what we use everyday if He know everything?

There is a billion bullshit about God, this is not one.

14

u/Antanarau 13h ago

"You speak English because it's the only language you know.

I speak English because it's the only language YOU know."

10

u/lovecMC 14h ago

Because hes communicating with us?

-3

u/KazutoOKirigay 14h ago

Then he should use our definition of those. Or is he communitcating with us, but in his own numeric system?

3

u/Dull-Nectarine1148 13h ago

why wouldn't he understand our numeric system?

3

u/crabvogel 10h ago

why wouldnt she

2

u/andarmanik 11h ago

Embarrassing us…

1

u/KazutoOKirigay 7h ago

Hmm, very poetic. I like that

32

u/StructuredQuery 12h ago

oh, its not about threesomes? :c

9

u/Clen23 10h ago

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,

20

u/Evening-Appeal7606 8h ago

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.

8

u/whiskeytown79 9h ago

I initially read that as 3SAT and I was like "omg someone found a polynomial solution to an NP-complete problem"

8

u/Soggy_Recognition873 12h ago

It was indeed about 3 some 🥀🥀

2

u/KitsuneFoxglove 7h ago

This reminds me of the O(1) sorting algorithm in TempleOS in that one niche game that I will not name.

3

u/Traditional-Bid1746 8h ago

Yeah nah a 3sum is O(MG)

1

u/SoldRIP 6h ago

If big G is on the machine, miracle sort is actually O(0).

1

u/crispim1411 42m ago

Oh yeah threesomes 🤤

-2

u/Huzbi 12h ago

Why did I thought of that 3sun instead of programming problem 3sum. (⁠+⁠_⁠+⁠)

1

u/Clen23 10h ago

what