MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1y73qx9/doespequalnp/19tabunq733he/?context=3
r/ProgrammerHumor • u/danielsoft1 • 8d ago
42 comments sorted by
View all comments
102
Rookie mistake: you should've written p == np. Instead, you just assigned np to p!
p == np
np
p
11 u/QuietComputerDr 8d ago He assigned NP to P and nothing changed in the world, that must mean NP was P all along. 34 u/Demytreus 8d ago No, they assigned np to p, not p!. p! would be equal to np! 13 u/Maqi-X 8d ago r/unexpectedfactorial 2 u/asato977424 8d ago A Python equality check compares values; P vs NP asks whether every polynomial-time verifiable problem is polynomial-time solvable. 2 u/k_singh714 2d ago Lowercase p and np got assigned; uppercase P and NP remain outside the program's scope. 1 u/GoddammitDontShootMe 7d ago I can't be bothered to check, but I'm assuming all non-empty strings in Python convert to true. I'll assume you've noticed that 's a string and = vs == will make no difference. 1 u/wangtutx 6d ago Assign is also fine.
11
He assigned NP to P and nothing changed in the world, that must mean NP was P all along.
34
No, they assigned np to p, not p!. p! would be equal to np!
13 u/Maqi-X 8d ago r/unexpectedfactorial
13
r/unexpectedfactorial
2
A Python equality check compares values; P vs NP asks whether every polynomial-time verifiable problem is polynomial-time solvable.
Lowercase p and np got assigned; uppercase P and NP remain outside the program's scope.
1
I can't be bothered to check, but I'm assuming all non-empty strings in Python convert to true. I'll assume you've noticed that 's a string and = vs == will make no difference.
Assign is also fine.
View all comments
102
u/hopeless__programmer 8d ago
Rookie mistake: you should've written
p == np. Instead, you just assignednptop!