N or P
Contents Glossary
05

What if the line collapsed

The unproven equality that, if proven, would rewire the entire economy in a week.

The question P = NP asks whether every problem that is fast to check is also fast to solve. The whole world is betting that the answer is no. Every public-key cryptosystem (banking, messaging, identity, software updates) rests on the assumption that certain NP problems are genuinely hard. Most of operations research, drug design, protein folding, and AI training would become trivial if the answer turned out to be yes. Almost nobody believes that. Decades of attacks on these problems have produced nothing, and the Clay Mathematics Institute will pay a million dollars to anyone who settles the question either way. The practical implication for your engineering planning is this: do not bet on P = NP being true. Treat NP-complete problems as hard, build accordingly, and reach for SaaS solvers or approximations rather than waiting for a breakthrough.

  1. 01
    RSA is the most concrete bet on P ≠ NP. The encryption is one multiplication; the inverse is factoring. The Rust num-prime crate handles both halves and makes the asymmetry visible — primality test in microseconds, factoring of a 200-bit composite in minutes.
    use num_prime::nt_funcs::is_prime;
    use num_bigint::BigUint;
    
    fn rsa_modulus(p: &BigUint, q: &BigUint) -> BigUint {
        assert!(is_prime(p, None).probably());
        assert!(is_prime(q, None).probably());
        p * q
        // Recovering p, q from p*q alone is the bet.  No fast classical
        // algorithm is known.  The day one is found, every RSA key on the
        // internet is broken.
    }
  2. 02
    is_prime does not return a plain bool — primality testing on huge integers is not always deterministic. The crate returns a three-valued Primality enum that distinguishes "proved prime," "proved composite," and "probably prime" (passed Miller-Rabin, the standard probabilistic test, with an error rate roughly 1 in 2⁶⁰ per witness). .probably() collapses both positive answers — proved-prime and probably-prime — into true, leaving only proved-composite as false. For cryptographic-sized numbers, "probably" is the right answer to act on; the false-positive rate is below the rate at which cosmic rays flip bits in your RAM.
    // is_prime() returns a tri-state, not just a bool:
    //
    //   Primality::Yes       → proved prime (deterministic test passed)
    //   Primality::Probably  → passed Miller-Rabin, no proof either way
    //   Primality::No        → proved composite (a witness was found)
    //
    // .probably() merges the two positive answers into true:
    let answer = is_prime(p, None);
    let acceptable: bool = answer.probably();
    //
    // Same as writing:
    let acceptable = match answer {
        Primality::Yes      => true,
        Primality::Probably => true,
        Primality::No       => false,
    };
    //
    // The 1-in-2⁶⁰ error rate sounds scary; in practice it is far
    // below the rate of hardware bit-flips from cosmic rays.  Every
    // piece of production crypto code in the world treats Probably
    // as Yes.
Aaronson, S. (2017) P =? NP is the most accessible survey. Source →
In plain terms

The P = NP question is the most famous unsolved problem in computer science, and it is also a question about the world economy. If P turned out to equal NP, the day after the announcement, every encrypted bank transaction would be vulnerable to anyone with a laptop. Every password-protected service would be compromised. Every signed software update could be forged. The internet as a payment and identity system would need to be rebuilt on new foundations.

The upside would be just as dramatic. Drug discovery, which today requires expensive lab work to find molecules with desired properties, would become a search algorithm — find the binding affinity by computation, not experiment. Protein folding, which DeepMind partially cracked with AlphaFold in 2020, would collapse into a single algorithm. Vehicle routing, staff scheduling, supply chain optimization, every NP-complete problem in the business world — solved. Operations research as a profession would empty out.

The reason almost nobody believes this is that the absence of evidence is now overwhelming. Fifty years of brilliant researchers attacking specific NP-complete problems for academic glory and commercial reward have produced no polynomial algorithm for any of them. The known mathematical barriers to a proof of P ≠ NP are nontrivial — but the practical evidence that the problems are genuinely hard is now stacked very high.

For business planning today, the working assumption is that P ≠ NP. This means: when a problem is labeled NP-complete, do not promise an exact, fast solution. Buy a solver. Use an approximation. Outsource to a SaaS. Set realistic expectations.

The day the equality flips, every contract gets renegotiated. Until then, plan for the world you live in.

← 04 Hard, harder, hardest — the labels
5/39
06 Sorting — almost never your problem →