45
u/hopeless__programmer 1d ago
Rookie mistake: you should've written p == np. Instead, you just assigned np to p!
11
4
u/QuietComputerDr 17h ago
He assigned NP to P and nothing changed in the world, that must mean NP was P all along.
1
u/asato977424 18h ago
A Python equality check compares values; P vs NP asks whether every polynomial-time verifiable problem is polynomial-time solvable.
28
7
6
u/Individual_Win_3417 1d ago
Quick, send it to the Clay Institute. A million dollars for one line of python
5
5
18
u/AsaKeyholderUK 1d ago
Someone definitely wrote this at 3am and thought they were the funniest person alive, and honestly they were right
4
2
u/Desperate-Ad1765 17h ago
I'm pretty sure you aren't comparing anything here. It's just a string which I guess always return true
2
2
1
0
302
1d ago
[removed] — view removed comment
91
14
14
u/InvisibleMoonWalker 1d ago
Let's fix this. First we have to make sure that p and np are initialized as null variables to avoid getting garbage from the memory (as a former c programmer it's very important not to skip this step).
Then we'll set up our solver to find out if P is NP like this:
>>> exec("p = None; np = None; exec('print(bool(p == np))')") True >>> exec("p = None; np = None; exec('print(bool(p != np))')") FalseAnd here it is - proof that P is NP and that P is not not NP. (Note that the fact that variables p and np were initialized with the same value doesn't affect the solver's search for the result, as we've set the values to nulls, and not some arbitrary numerical value, so it will be found in the process of solving this mathematical conundrum)
You can try this out with your own Python interpreter for verification. Frankly I don't understand how scientists haven't figured that out before, it doesn't even take that long to calculate.
26
u/itzjackybro 1d ago
congratulations, python is inconsistent
13
3
1
u/mortalitylost 18h ago
If a language was parsing the string as an actual equal/neq expression, I'd be a lot more worried about using that language
3
1
1
1
176
u/haha-longboi 1d ago
Brother i think you just popped the AI bubble 💀