r/computerscience • u/Yah_Ruach • Apr 29 '25
Help What are the Implications of P=NP?
I am trying to write a sci-fi thriller where in 2027, there are anomalies in the world which is starting to appear because someone proves P=NP in specific conditions and circumstances and this should have massive consequences, like a ripple effect in the world. I just want to grasp the concept better and understand implications to write this setting better. I was thinking maybe one of the characters "solves" the Hodge conjecture in their dream and claims they could just "see" it ( which btw because a scenario where P=NP is developing) and this causes a domino effect of events.
I want to understand how to "show" Or depict it in fiction, for which I need a better grasp
thanks in advance for helping me out.
41
u/dkopgerpgdolfg Apr 29 '25 edited Apr 29 '25
It sounds like you're expecting some magic to happen ... but then you'll need to make something up, because reality doesn't support that in any way. No "anomaly will appear".
For sure it will be interesting for CS and some other science areas. Also for sure, anything that outside of human society is not affected at all. Somewhat likely, there are no effects outside of science because just P=NP doesn't automatically imply a practical calculation speedup.
At worst, there'll be a chaotic time for humanity that takes a long while to calm down, because lots of things we take for granted can suddenly be abused / become unreliable. Banking here, secret military communication there, ... long term, science could benefit from it in many ways. Understanding/developing things faster than before.
19
u/indjev99 Apr 29 '25
I cannot put into words how much hatred I feel after reading this.
3
u/amarao_san Apr 29 '25
It is depending if prove is by contradiction or constructive.
If it's by contradiction (we just proved it is but nothing else), just a lot of ripples across science and (some) industries, mostly around crypto (P=NP means, that every crypto validated in P can be decrypted in NP, which suddenly is ==P).
If it's constructive, means, that someone found a P solution for NP problem, that's make things interesting. Cryptography is gone, a lot of hard problems become extremely simple (including code correctness, pathfinding, optimization problems).
I think it's worth to go into different industries and see where they have workaround for NP-hard problems, and what happens, if they are no longer needed.
75
u/fangus Apr 29 '25
This is like you’ve come up with the hook for a joke, but you’re asking us to figure out the punchline - or rather the rest of your book.
10
u/apnorton Devops Engineer | Post-quantum crypto grad student Apr 29 '25
This was asked two days ago: https://www.reddit.com/r/computerscience/comments/1k94pqk/what_happens_if_pnp/
6
u/apnorton Devops Engineer | Post-quantum crypto grad student Apr 29 '25
Somewhat relevant to this discussion is Impagliazzo's Five Worlds. A resolution to the P vs NP problem could take many different forms; this paper presents a fictionalized view of the possible futures that could come to be when the question is resolved. In writing your fiction, you might want to pick one of these possibilities to explore, since it constructs a bit of world building impacts, too.
There's a lot of discussion on this paper online (blog posts, Q&A, etc), so it might be a helpful jumping off place.
3
u/Ok-Lavishness-349 Apr 29 '25
As a side note, an Indie movie was made in 2013 or thereabouts on a similar premise - it was called Traveling Salesman. It was funded via a crowd-funding web site. I don't know whether it was ever widely distributed though.
For another speculative story about a different case of an answer to a mathematical question being different from what most people expect, see Ted Chiang's short story Division by Zero.
2
u/FormerTimeTraveller Apr 29 '25
The last time this was solved, a portal broke open and a bunch of alien monsters came to wreak havoc on humanity and bring its end.
I wouldn’t worry about it this time tho. We’re a bunch of dummies. And also we seem to be bringing our own end quick enough so
2
u/dmazzoni Apr 29 '25
I really think encryption would be the big one.
Imagine being able to decrypt nearly everything. You couldn’t do things like bank online.
Imagine encryption was broken so badly that HTTPS became worthless overnight. That would cause a huge disruption as half of the major sites get hacked while the other half just go dark to prevent further damage.
The world goes “offline” for a few weeks while people scramble to come up with software updates to upgrade everyone to safe encryption, but even distributing those updates is problematic so it has to be done in person.
Sounds like a good plot to me.
2
u/xXProdigalXx Apr 29 '25
There's a book you might want to look into that one of my college professors recommended to me when I was asking a lot of the same questions back in the day. It's called "Quantum Computing Since Democritus", and though I never read it, he suggested that there's a pretty significant portion of it dedicated to what the consequences of P=NP are.
2
u/Literature-South Apr 29 '25
Proving P=NP doesn't actually do much. It just tells you for every non-polynomial problem, there is a polynomial solution. But it doesn't tell you what that solution is for any given problem. You still have to do the hard work of finding that solution for any given problem. Each one would be bespoke. Or at least each class of problem would be.
If P=NP were solved tomorrow, a year from now the world probably wouldn't look very different than it does today.
1
u/Eased91 Apr 29 '25
The implications will not be that big, but will bring Computer Science to a new Level. Things will get faster - And we will be able to solve some Problems, where we currently just have an approximation for.
For your Book, take a look at Matt Haigs "The Humans" who already asked this idea.
How about you discuss these with ChatGPT. Ask for breakthorughs in Physics. You will come to Quantum Time Bending or something. This could be a huge step and there can be a lot of implications.
1
u/SoldRIP Apr 29 '25
The most immediate consequence if anyone figured out a way to solve any NP problem in polynomial time would likely be the fact that this would allow them to break (almost) all public-key cryptography. Including such widely used things as RSA, SSL/TLS, PGP, etc.
So basically anything security-critical would have to move to using One-Time Pads. Or just being exclusively in-person, as we did before computers. 2FA would also break, so that's not viable workaround.
No more online banking, more or less. And getting a virus onto someone's computer will become much easier.
(Note that this assumes that someone not only proves "it can be done", but also finds a method of doing it. If they provide only the conceptual proof, without any way of realizing it, then the main thing that changes is everyone getting afraid of these things and probably fixing them in time... or not. Who knows.)
1
u/slimscsi Apr 29 '25
The knapsack market would collapse as everyone would need fewer.
1
u/claytonkb Apr 29 '25 edited Apr 29 '25
Scott Aaronson has explained it about as eloquently as I think it can be explained:
Source
PS: You should definitely also read Impagliazzo's "five worlds" paper which discusses the whole range of possible worlds, including where P=NP...
1
u/gugam99 Apr 29 '25
Strangely enough, this exact premise has been explored before: https://en.wikipedia.org/wiki/Travelling_Salesman_(2012_film)?wprov=sfti1
1
u/Narrow_Chocolate_265 Apr 30 '25
There ist a k such that SAT is solvable in O(nk) for some constant k. But SAT is NP-Complete so every Problem in NP Is polynomial time reducible to SAT. This means that NP is a subset of TIME(nk) but the Time hierarchy Theorem says that TIME(nk) Is a strict subset of TIME(nk+1). A contradiction which proofs P != NP. This proof is false because every problem is polynomial time reducible to SAT does not mean that NP is a subset of TIME(nk) because the reduction doesn't have to be necessarily in TIME(nk) and could be bigger.
1
u/eldoran89 Apr 30 '25
The story idea sounds more like the idea of someone who doesn't know anything about p=NP... But ok let's have a brief view what this problem actually means in real live. A proof of P=NP itself doesn't mean much but it would likely involve some mathematical tricks that lilly would mean that cryptographic functions that previously were secure are now vulnerable. So this might lead to cryptographic collaps which means computer systems getting hacked and therefore chaos ensures. a different scenario I could hardly imagine because the proof of P=NP is not some magic formula.
1
u/thefieldmouseisfast Apr 30 '25
as others have said, proving P=NP is only useful is you have a constructive proof (an algorithm).
I think an interesting idea would be if someone found such an algorithm for (as others have said)fast prime factorization and breaking cryptography, but the story would be that the discoverer keeps their discovery to themself while exploiting it. Such a person would amass incredible amounts of wealth and private information, eventually.
1
u/Liam_Mercier May 01 '25
Many cryptography algorithms break.
1
u/OlevTime May 02 '25
"Scientists proved gravity is real, suddenly things started falling to the ground. Never been seen before"
The above is similar to what proving P=NP would do.
1
u/bothunter May 02 '25
Encryption would be broken for starters. May I suggest watching Sneakers? (1992)
1
u/Ha__ha__999 May 02 '25
Crypto and one way encryption breaks
1
u/pagepool May 02 '25
All the traveling salesmen will have very efficient routes.
1
u/devnullopinions May 03 '25
Assuming that NP problems do have polynomial time solutions, you could in theory prove this with a non constructive proof that provides no algorithm to take an NP problem and convert it to an algorithm that can solve it in polynomial time.
1
u/redneck1772 May 04 '25
A mathematician would have to polynomial time reduce an npc problem to a p problem(doing this to 1 means all of them can also be reduced to a p decision problem). If you want it to be realistic it would be a proof and not something in front of the computer.
1
u/sschepis May 06 '25 edited May 06 '25
You're welcome:
The Algorithm of Power
In a world where technology governs every facet of life, Ahmad, a brilliant young mathematician from a marginalized, long-oppressed community, stumbles upon a groundbreaking discovery: an algorithm that solves NP-hard problems in polynomial time. Born in the slums of a dystopian city, Ahmad's creation promises to liberate his people by unlocking solutions to intractable problems—optimizing resource distribution, breaking corrupt financial systems, and exposing hidden truths. But his triumph is short-lived.
When Ahmad uses his algorithm to decrypt a trove of classified government files, he uncovers a chilling secret: someone else has already developed a similar algorithm. This shadowy figure, known only as "The Architect," has been manipulating global systems for decades. By breaking encryption, rigging elections, and blackmailing world leaders, The Architect wields unparalleled control over governments, corporations, and even wars. Every politician, CEO, and influencer is a puppet, their secrets weaponized to enforce compliance.
Determined to dismantle this invisible empire, Ahmad embarks on a perilous quest. He teams up with Zara, a rogue hacker with a vendetta against the elite, and Dr. Elara Voss, a disgraced cryptographer who once worked for The Architect. As they unravel the web of control, they face relentless pursuit by The Architect’s enforcers—cybernetic operatives and compromised officials who will stop at nothing to protect the status quo.
Ahmad's journey forces him to confront moral dilemmas: should he use his algorithm to fight fire with fire, risking becoming the very tyrant he seeks to destroy? As he hacks into global networks, exposing scandals and freeing minds, he becomes a symbol of resistance for the oppressed. But The Architect, always one step ahead, counters with a devastating misinformation campaign, framing Ahmad as a terrorist.
In a heart-pounding climax, Ahmad infiltrates the heart of The Architect’s operation—a fortified data fortress in the Arctic. There, he discovers The Architect’s true identity: ...
(what, I'm not gonna write your whole book for you)
The Algorithm of Power better be a gripping techno-thriller about one man’s fight to reclaim freedom in a world enslaved by computation. It will explore themes of justice, betrayal, and the ethical limits of power, culminating in a revelation that challenges the very nature of control in the digital age.
Now get to work, I want to read the end.
1
u/nerdy_berserker Jun 13 '25
I don't know if you have watched Silicon Valley, but in the final season, they manage to solve a NP problem in P time. I won't mention the entire thing here but you can watch the explanation of that part on YouTube.
They didn't explore the consequences as they shut down their system ( it was essentially an ai system that started breaking encryption to compress the original text before encrypting it)
As others have mentioned, it will render some encryption systems obsolete, but might be good for solving some other NP problems.
P vs NP are defined for the classical computer science perspective and quantum computing is already threatening encryption systems and companies are moving to quantum safe encryption so in the universe of your movie, quantum computers shouldn't exist
1
u/Cybasura Apr 29 '25 edited Apr 29 '25
Do you understand the fundamental meaning of P=NP?
P=NP, where P = Polynomial and NP = Non-deterministic Polynomial Time, refers to the time complexity ratio/equation that states if can a polynomial-time function ever match that of a Non-deterministic Polynomial-time function
For all intents and purposes, Polynomial Time is a deterministic time you can expect from something like for-loops, Non-determinist Polynomial Time are problems that are insanely difficult to complete, concepts like Cryptographically breaking a private or public key within a prime number multiplication-based encryption scheme (i.e. the Private Key Encryption Scheme RSA, which uses the formula of prime_1 x prime_2 to generate a bigger prime_n that is of N-sized bytes long)
Now you can already see what the hell will happen if P does equals to NP
That means given a world where that is proven, a NP time will essentially become a Polynomial Time operation and that means you can easily break encryption schemes, cryptographic hash functions (aka hashing algorithms) within polynomial time, within a deterministic time frame, it will absolutely devastate the world because now attackers have proof to believe there exists this technique to reduce a NP function into P function
1
u/VariousJob4047 Apr 29 '25
If P=NP is proven there will likely be exactly zero consequences outside of the content of some theoretical computer science papers. The conjecture implies that certain problems in computer science can be solved faster than we currently think they can be, but all that proving the conjecture would do is tell us that the solution is out there, we still have to go find it. What you’re trying to write about just isn’t how the world works, “anomalies” don’t start happening because the knowledge contained in a certain human being’s brain changes.
0
u/simplymoreproficient Apr 29 '25
If P=NP is proven by efficiently solving an NP-complete problem, it would be the end of all cryptography that relies on efficient one-way functions (trapdoor perms/hash functions). So no more online banking (or doing other sensitive things online). Also no more cryptocurrency.
0
u/raiyanrafi Apr 29 '25
Proof:
We know very well that p means poop and np means no poop by forcing law of gravity here if someone on earth eat food then he of course has to poop at some point, we also know that universe is boomerang and earth is pyramid therefore we conclude 1+√784=80817 and has to be true because its and universal truth of chung chong asserting that one can fly by without anything just because someone can fly implies 76 < 0 which is valid and remains true. and we can also observe birds chipper at every morning they are essentially saying p vs np is true. By observing how they fly we can conclude 77-1=0 and its follows from all previous statement and by applying "forceful law of logic" asserting everything this proof saying is true. And forcefully draw a complex relationship between p vs np and poop of birds if birds poop it means p happens and no poop means np happens finally we should apply modus pones here n implies np np happens therefore n is true, means birds pooped 1 minutes ago. and then skydiving rules applied over the galois field of operation which further claiming that p vs np i,need true. Eating vegetable contains golden ratio of 0° poop which means it is true finally drawing ultimate conclusion by law of brute truth essentially implies p vs np is true
PS: Im Drunk