1. Home
  2. Explore
  3. Computer Science
  4. Theory of Computation

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Theory of Computation

Speaker 1Speaker 2

Theory of Computation

13:51
0:00-13:51
  1. Anna

    Today we are entering theoretical computer science from the perspective of neuroscience. The speaker describes this not simply as a computer science lecture, but as a kind of cultural anthropology: an attempt to understand the language, history, behavior, and inner workings of the theoretical computer science tribe.

  2. Michael

    And that exchange matters because the two fields have already been influencing one another. Earlier interdisciplinary topics included quantum Hamiltonians and computation, evolution and computation, and economics and computation. The goal is to let computer scientists learn from neuroscience while also showing neuroscientists how computer scientists think.

  3. Anna

    To understand that tribe, we begin with its history—and especially with Alan Turing. In 1936, Turing invented what we now call the Turing machine in response to a major mathematical question: can mathematics be automated?

  4. Michael

    That question came after Gödel had shown that mathematics could not be complete. Mathematics was still being practiced, of course, but people wanted to know whether the mathematics that could be done might nevertheless be carried out mechanically. Turing's machine gave the first precise definition of computation.

  5. Anna

    There is a philosophical lesson here. Mathematicians had been thinking about computation without formally defining it. They needed a definition precisely when they wanted to prove that some computations were impossible.

  6. Michael

    Right. If you want to show that something is impossible, you first have to map out the space of possibilities. You get inside the area, define its boundaries, and then demonstrate that a particular task lies beyond them.

  7. Anna

    Turing's model was remarkably minimalistic, and it taught another central lesson: universality. Very little is needed to have the capacity to do almost anything computationally, provided the machine receives the appropriate instructions or bit stream.

  8. Michael

    That is why universality is also connected to software and learning. A machine can be taught to perform different tasks not by rebuilding the machine, but by supplying the right program. The same general idea—that a simple system can support many capabilities—also makes sense in discussions of evolution.

  9. Anna

    Turing also proved that some computational problems are unsolvable. A famous example is the halting problem: given a program and its input, can we always determine whether the program will eventually stop or continue looping forever?

  10. Michael

    The answer is no. There is no program that can solve the halting problem for every possible program and input. And this limitation has consequences: there is no universal program that can always determine whether another program is correct, whether it will print anything, or whether it is a virus.

  11. Anna

    So computer science was born unusually conscious of its own limitations. Other sciences may become aware of their boundaries gradually, but theoretical computer science encountered impossibility results at the beginning of its history.

  12. Michael

    About a decade after Turing's work, John von Neumann was deeply influenced by those ideas. He helped define what a computer was and worked with an engineering team that built one. That combination of theory and construction marks the beginning of the modern field.

  13. Anna

    The lecture then turns to the major themes of contemporary theoretical computer science: algorithms, randomness, computational complexity, learning, connections with other sciences, and eventually ways a computer scientist might think about the brain.

  14. Michael

    For roughly fifty of the seventy years after 1946, computer scientists were intensely focused on the computer itself. They solved difficult engineering problems involving operating systems, compilers, databases, machine learning, chip layout, graphics, networks, and user interfaces.

  15. Anna

    Compilers and operating systems, for example, once required tens or even many tens of person-years to build. Later, they became reasonable projects for a course. Then the Internet changed the situation, and during the last couple of decades people have increasingly thought of themselves as students of the Internet rather than as students of the computer alone.

  16. Michael

    Two major engines drove this transformation. The first was Moore's Law: computer capability roughly doubled every year and a half for many decades. The lecture emphasizes that this was not simply a physical law; it was also a social phenomenon involving science, business, competition, and society.

  17. Anna

    A prediction created a target. Companies built business plans around continued improvement, competitors tried not to fall behind, and society purchased and used the resulting technology. Even after people began saying Moore's Law had stopped, engineers continued looking for ingenious ways to keep progress going.

  18. Michael

    The second engine was fast algorithms. Faster hardware is useful only when efficient algorithms can take advantage of it. If an algorithm requires exponential time, dramatically increasing the speed of the computer may provide little practical gain.

  19. Anna

    A classic illustration is matrix multiplication. The standard method for multiplying two n-by-n matrices takes on the order of n cubed operations, because there are n squared entries in the result and each requires roughly n terms to be combined.

  20. Michael

    For a long time, some mathematicians believed that n cubed was obviously the best possible. Volker Strassen disproved that belief with a faster algorithm. His method began with a curious two-by-two matrix multiplication procedure that used more total operations but fewer multiplications—seven instead of the twelve multiplications in the classical method.

  21. Anna

    Strassen then applied that procedure recursively. A large matrix can be viewed as a two-by-two matrix whose entries are themselves matrices, so the smaller algorithm can be repeatedly applied at larger scales. That breakthrough shook the field, and many later improvements followed, although progress eventually became much slower.

  22. Michael

    The speaker's own early thesis work tried to prove a lower bound for matrix multiplication, but that problem was solved decades later. The eventual proof used randomness—a probabilistic-method argument—which leads naturally to the next theme.

  23. Anna

    Theoretical computer scientists treat randomness as a useful tool, not merely as noise. Randomized algorithms can sometimes be the most deliberate and reliable choice available—literally, the best move may be to flip a coin.

  24. Michael

    Randomness helps in at least two important ways. First, it protects an algorithm from bad inputs or an adversary who deliberately supplies difficult inputs. Randomized quicksort is an example: random choices make it harder for an input to consistently force poor performance.

  25. Anna

    Second, random sampling helps distinguish competing hypotheses. Consider testing whether a huge, 190-digit number is prime. If the number is prime, Fermat's theorem gives a property that suitable tests should satisfy; if it is not prime, many choices of test value will expose that fact.

  26. Michael

    Repeating the test makes the probability of error extremely small. After around one hundred independent trials in the example, the failure probability can be on the order of two to the minus one hundred, which the speaker compares with an extraordinarily unlikely event such as a computer being destroyed by a meteorite at one particular nanosecond.

  27. Anna

    That does not mean randomness removes all standards of correctness. It means the algorithm comes with a quantified probability of success, and reducing an already negligible error probability even further may waste computational effort.

  28. Michael

    Random graphs provide another example. In the Erdős-Rényi model, every pair of nodes is connected independently with some fixed probability—for instance, one percent. Even without seeing a particular graph, we can predict many of its global properties.

  29. Anna

    For a sufficiently large random graph, one can expect properties such as connectivity, short path lengths, and expansion. Expansion means that separating part of the graph is expensive: you cannot disconnect a substantial portion by removing only a small number of nodes.

  30. Michael

    This illustrates why random structures are useful to theorists. A specific graph data set might take years to understand in detail, while a random graph generated by a known model comes with a great deal of predictable structure.

  31. Anna

    Complexity theory adds another striking contrast: primality testing is easy, while factoring appears hard. Once an algorithm tells you that a number is not prime, finding its actual factors can still be computationally difficult.

  32. Michael

    That gap is central to modern cryptography. Cryptographic systems rely on operations that are easy to perform in one direction but are believed to be difficult to reverse, with factoring serving as the important example discussed here.

  33. Anna

    Other problems reveal a divide between tasks that can be solved in polynomial time and tasks that seem to require exponential search. Ordinary matching between two groups can be solved efficiently, while matching three groups—such as boys, girls, and pets—becomes hard.

  34. Michael

    Similarly, finding whether two people are connected by a short chain in a social network can be done efficiently. But asking whether a social network contains a clique of sixty mutually connected people is a much harder problem. Set cover—choosing as few words as possible to cover every letter of the alphabet—is another example of a difficult problem.

  35. Anna

    The invisible line between the easy and difficult problems is studied through reductions. A reduction transforms one problem into another, so that an efficient solution to the second problem would provide an efficient solution to the first.

  36. Michael

    For example, if we had an efficient algorithm for number partitioning, we could use it to solve the three-way matching problem. The lecture sketches this by representing each boy-girl-pet triple as a sparse zero-one vector containing three ones, then translating the matching question into a partitioning question.

  37. Anna

    Problems that are all mutually reducible in this sense belong to the class NP-complete. NP consists of problems whose solutions can be found by exhaustive search over an exponential number of possibilities, while P consists of problems solvable in polynomial time.

  38. Michael

    NP-complete problems are the hardest problems in NP. Stephen Cook established the starting point in 1971 by proving that satisfiability, or SAT, a problem in Boolean logic, is NP-complete. To prove that a new problem is NP-complete, researchers reduce a known NP-complete problem to it.

  39. Anna

    Most researchers believe that P does not equal NP, meaning that some efficiently verifiable problems cannot be solved efficiently. But NP-completeness does not mean a problem is useless or should be abandoned.

  40. Michael

    It means we should change our expectations. We might search for approximation algorithms, heuristics, or special cases that are easy. The theoretical result gives researchers a map of what is unlikely to be achieved by a universally efficient algorithm.

  41. Anna

    The discussion also stresses that worst-case complexity is a theoretical tool, not always a direct description of practical data. Some problems that are hard in the worst case are easy over most of their parameter space, and sometimes finding genuinely hard instances is itself difficult.

  42. Michael

    There are also theories of average-case complexity and approximation. The PCP theorem, developed after the original P-versus-NP question, helps classify how well certain problems can be approximated—for example, distinguishing problems such as clique from problems such as splitting, where approximation can be more manageable.

  43. Anna

    The broader methodological point is crucial for neuroscience and other sciences: theoretical computer science helps identify the right algorithmic question. A question may be mathematically natural but computationally inappropriate for the resources available in a particular domain.

  44. Michael

    The lecture then introduces supervised learning through the online expert problem. Imagine six financial experts whose columns you read every morning. Each day you must choose one expert, observe the result later, and repeat this for thousands of days.

  45. Anna

    The challenge is that the outcomes do not have to follow a known probability distribution. They may even be chosen adversarially by someone trying to make your decisions look bad, although the adversary chooses the day's outcomes before seeing your choice.

  46. Michael

    Surprisingly, there is still a strategy that performs nearly as well as the best expert in hindsight. The multiplicative-weights algorithm begins by assigning every expert equal probability, one-sixth in this example.

  47. Anna

    After each result, the algorithm increases the weights of experts who performed better and decreases the weights of those who performed worse. It then normalizes the weights so they sum to one, turning them back into probabilities.

  48. Michael

    The guarantee is that the algorithm's expected performance is within roughly the square root of log n divided by T of the best expert's performance, where n is the number of experts and T is the number of days. Over about three thousand to thirty-six hundred days, the example suggests that the daily gap could be only a few cents.

  49. Anna

    That simple update rule has appeared repeatedly in different fields. It was studied in economics, financial mathematics, and artificial intelligence, where related ideas include boosting and AdaBoost. It has also been applied to problems such as convex programming and network congestion.

  50. Michael

    So the episode's portrait of theoretical computer science is not just a collection of clever algorithms. It is a discipline built around precise definitions, explicit limitations, reductions between problems, strategic use of randomness, and learning rules that can work even without a helpful probability model.

  51. Anna

    And that is why these ideas are relevant to neuroscience. They offer ways to ask what computation means, what a system can or cannot learn, how complexity should be measured, and how simple mechanisms can produce broad capabilities.

  52. Michael

    The larger interdisciplinary program goes on to consider learning, evolution, and the brain itself. But the foundation is now clear: understand the computational tribe by understanding its history, its algorithms, its randomness, its complexity theory, and its search for the right questions.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent