r/computerscience • • Nov 21 '22

What are the main Computer Science theorems?

I have been wondering which theorems like Little's Theorem were groundbreaking on computer science?

159 Upvotes

23 comments sorted by

228

u/Potato-Pancakes- Nov 22 '22 edited Nov 22 '22

The Halting Problem: If you write a program P that reads in a program Q and determines whether or not Q runs forever, then there exists some input program Q such that P either runs forever or returns the wrong answer. This is important because it shows that not all problems can be solved by a program.

The Universal Turing Machine theorem: There exists a program that can simulate any other program.

The existence of Chaitin's constant: There exists a well-defined real number that cannot be computed. That is, any algorithm to compute this number will eventually stall forever without getting any closer to the correct value.

Cook's Theorem: The boolean satisfaction problem is NP-complete. This is important, because it shows that there exist problems that are NP-hard while also in NP.

The [Master Theorem:](https://en.wikipedia.org/wiki/Master_theorem_(analysis_of_algorithms)) given a recursive algorithm, this formula (too case-based and messy to post here, so check the link) will tell you the run time complexity.

The CAP Theorem (aka Brewer's theorem): Any distributed database/data store can have at most two of the following three properties simultaneously: Consistency (every read request receives either the most recent write or an error), Availability (every request receives a non-error response), and Partition Tolerance (there is no number of dropped messages between nodes that can crash the whole system).

Chaitin's incompleteness theorem: Most binary strings cannot be compressed. More specifically, given a compression function f:{0,1}* -> {0,1}*, for a randomly-chosen binary string x, f(x) is probably at least as long as x.

Shannon's source-coding theorem: given the entropy of a message/signal, you can determine the minimum number of bits that it can be compressed to without losing significant information.

The Quantum Threshold Theorem: a quantum computer with a sufficient physical error rate r can achieve an arbitrarily small logical error rate.

The Whittaker-Nyquist-Shannon sampling theorem: when sampling a continuous signal in order to encode it discretely, to avoid aliasing artifacts, one must sample at twice the frequency of the maximum frequency that you wish to preserve from the signal.

The No Free Lunch Theorem is complicated, but effectively states that: there is no good general-purpose universal optimization strategy; instead for an optimization strategy to be effective it needs to be tailored to the specific problem under consideration.

The pseudorandom generator theorem: Computers can generate pseudorandom binary sequences if and only if one-way functions exist.

Other hugely important concepts and results:

  • Fast Fourier Transform (a really useful algorithm for computing discrete Fourier transforms quickly)

  • Hamming codes (error-correcting codes)

  • Public-key encryption and digital signatures (Merkle puzzles, Diffie-Hellman, RSA)

  • Neural networks and the back-propagation algorithm

  • Relational database design

  • QuickSort and QuickSelect

  • Algorithm analysis (Knuth, Dijkstra)

  • Program verification via formal methods

  • Compression: Huffman trees, Lempel-Ziv, Burrows-Wheeler Transform

  • Any of these algorithms

  • Algorithms with quantum speedup (Shor's algorithm, Grover's search algorithm)

EDIT: adding a couple more, and also a whole buncha links

The Universal Approximation Theorem: any function can be approximated by a Neural Network, given sufficient depth (or breadth, but that's complicated) (and sufficient training)

Rice's theorem: Given a non-trivial property of languages, and a Turing machine, it is undecidable if the language of inputs accepted by the Turing machine will have that property or not.

24

u/hugotothechillz Nov 22 '22

I would also add to the list the two Godel’s incompletness theorems which are very much related to algorithmic decidability.

7

u/everything-narrative Nov 22 '22

Godel's theorems are basically just more scope-limited versions of the halting problem. Given that a proof search algorithm exists for first order theories, any first order theory powerful enough to encode the execution of turing-equivalent machines, is incomplete:

Simply construct a program which searches for its own halting behavior, then negates that halting behavior. This can be done using quining techniques.

9

u/JSBO11 Nov 22 '22

This is a great answer

7

u/[deleted] Nov 22 '22

I would add Rice’s Theorem to this list. Any non-trivial property about a program is undecidable i.e., it’s impossible to be able to determine the property with certainty for all programs). This has huge implications for any practice that aims to figure out properties of programs (e.g., static analysis).

4

u/dashdanw Nov 22 '22

I rarely save comments but this one takes the cake. Hours of fun

2

u/[deleted] Nov 22 '22

It feels like my college followed your list when teaching me stuff lmao

1

u/Fiion_the_aussie Nov 22 '22

This is really interesting I just finished my first year and look forward to learning stuff like this

83

u/[deleted] Nov 22 '22

P=NP. It is a theorem actually since I have a proof for it, but it's too short to fit in this comment

58

u/MrPinkle Nov 22 '22

Left as an exercise for the reader.

4

u/Black_Bird00500 Nov 22 '22

Darkanine9's Last Theorem

0

u/eakmail Nov 22 '22

I proved that P=NP for programs with infinite length, in nearby post.

https://www.reddit.com/r/computerscience/comments/z22np0/another_barrier_to_the_proof_of_pnp/

And it makes hard to prove P!=NP for programs with finite size, which I strongly believe it's true.

29

u/JoJoModding Nov 22 '22

Besides the halting problem and all the other deep logical metatheorems, the fact that lists can not be comparison-sorted in faster than O(n log n) is surprisingly useful. Otherwise, Computer Science is very diverse. You might get a more fruitful answer if you ask about a specific subfield, like Complexity Theory, Type Theory, Algorithms, Cryptography, etc.

1

u/Blazerboy65 Nov 22 '22

the fact that lists can not be comparison-sorted in faster than O(n log n)

Is there a name for this or a Wikipedia page?

3

u/jgerrish Nov 22 '22

It's related to Shannon's work on entropy and information theory.

A teacher I respect a lot gave us a counterfeit coin sorting problem related to the balance puzzle.

Even though I still get hung up on solving specific instances, it helped me understand the relation between information theory and sorting in computer science.

8

u/MagicSquare8-9 Nov 22 '22

This list is mostly about logic and computational complexity:

Rice's theorem: non-trivial semantic property of a program is undecidable.

Barrington's theorem: a computer that periodically lose its memory, except for 5 bits of data and a clock, is powerful enough to solve any problems that can be solved efficiently on parallel computer (NC); it's not if you have only 4 bits.

Friedberg-Muchnik theorem: there exist incomparable computably enumerable pair of language.

NP=PCP theorem: every problem with polynomial-sized proof, also have a probabilistic polynomial-sized proof in which you only need constant size spot check to avoid error below any arbitrarily small error.

MIP* =RE theorem: for any recursively enumerable problem, 2 provers with quantum entanglement can convince a skeptical verifier to accept a correct result.

(MIP=NEXPTIME, IP=PSPACE also relate, you can look that up)

15

u/RajjSinghh Nov 22 '22

I'd probably say that the Halting Problem is undecidable or the Recursion Theorem (basically showing that a program is capable of describing its own source code) are the most useful

2

u/deiknunai Nov 22 '22

Gödel's incompleteness theorems can be viewed as the foundation of computer science. As remarked elsewhere, they're a rather straightforward consequence of the undecidability of halting, but you have to give it to Gödel that he saw how deep this was before everyone else.

An absolutely foundational result is the Curry-Howard correspondence, which is conceptually a bit intricate, but which basically says that computer programs and mathematical proofs are two different ways of seeing the same thing.

In my field of distributed computing, the superstar “FLP theorem”, due to Fischer, Lynch, and Patterson, says that in a fully asynchronous system, irrevocable consensus is impossible if even a single process can crash, i.e., suddenly stop doing anything without the other processes being able to detect it. This is true even if we assume perfect, all-to-all communication in the system.

Still in distributed computing, the impossibility of consensus if a third of all processes may arbitrarily deviate from the protocol (known as “Byzantine faults”) is another celebrated result. I can't remember who showed it first, but I'm guessing it has to be Lamport, either alone or with Pease and Shostak.

1

u/asterik-x Nov 22 '22

The travelling salesman bit lost paradox. Very difficult theorem to understand

0

u/[deleted] Nov 22 '22

[deleted]

-2

u/asterik-x Nov 22 '22

Fuck you bitch/dog . travelling salesman is the name of theorem .

1

u/[deleted] Nov 22 '22

every recursion can be replaced by a loop and a stack