Siksha Sarovar

Siksha Sarovar (sikshasarovar.com) is a free educational web application that helps students in India learn programming and prepare for academic and competitive exams. The platform offers structured coding courses (C, C++, Python, Java, HTML, CSS, PHP, Power BI, AI, Machine Learning, Data Science), complete university curriculum notes for BCA/MCA students with previous year question papers, Class 10 and Class 12 CBSE/HBSE school notes, and dedicated preparation material for SSC, UPSC, Banking, Railway and other government exams. Browsing the site is completely free and requires no account. Users may optionally sign in with Google solely to save their learning progress, quiz scores and personal preferences across devices.

Privacy Policy | Terms of Service | Contact Siksha Sarovar | About Siksha Sarovar

v4.0.9 · PWA
Siksha Sarovar logo
Siksha Sarovar
Your Learning Universe

Siksha Sarovar is a free e-learning platform for coding courses, BCA university notes and competitive exam preparation. Optional Google sign-in saves your learning progress across devices.

Initializing knowledge base…
Compiling modules 0%

Course Introduction: The Science of Hard Problems

Lesson 1 of 15 in the free Complexity Theory notes on Siksha Sarovar, written by Rohit Jangra.

Welcome to Complexity Theory

Algorithms courses ask: how fast can we solve this problem? Complexity theory asks the deeper question: how fast can this problem possibly be solved — by any algorithm, ever? It is the study of the inherent difficulty of computational problems, and it contains the most famous open question in computer science: does P equal NP?

The journey of this course

How this course is organised

Syllabus blockLessons that cover it
Basics of computational complexity, time & space complexity, Big-OUnit 1 → "Time, Space & Big-O Notation"
Problem classification: P, NP, NP-hard, NP-completeUnit 1 → "The Complexity Classes"
Polynomial-time reductions (introduction)Unit 1 → "Polynomial-Time Reductions"
Turing machines and variantsUnit 2 → "Turing Machines & Their Variants"
Non-deterministic computationUnit 2 → "Non-deterministic Computation"
Circuit complexity, random access machinesUnit 2 → "Circuit Complexity & the RAM Model"
Complexity of sorting, searching, graph algorithmsUnit 2 → "Complexity of Concrete Algorithms"
Cook–Levin theoremUnit 3 → "The Cook–Levin Theorem"
SAT, 3-SAT, CLIQUEUnit 3 → "The Classic NP-Complete Problems"
Techniques for proving NP-completenessUnit 3 → "Proving NP-Completeness"
P vs NP statement & consequences of P = NPUnit 4 → "P vs NP & What P = NP Would Mean"
PSPACE and other classes, beyond polynomial timeUnit 4 → "PSPACE & the Wider Class Zoo"
Approximation algorithms, interactive proofsUnit 4 → "Living with Hardness"

Why this subject matters to you

  1. It tells you when to stop looking for a fast algorithm. Recognising that a scheduling/routing/packing problem is NP-complete saves weeks of doomed optimisation and points you to approximations and heuristics instead.
  2. It underpins security. All of modern cryptography rests on complexity assumptions — RSA is safe only because we believe factoring is hard.
  3. It is a placement/interview differentiator. "Is this problem NP-complete, and how would you cope?" is a real senior-engineer interview question.
  4. It is intellectually spectacular. P vs NP carries a million-dollar prize and would reshape mathematics, AI and medicine if resolved.

Prerequisites

You should knowWhy
Asymptotic notation from Data StructuresWe sharpen and formalise it
Basic graph terminology (vertex, edge, path, clique)Reductions live on graphs
Propositional logic (AND/OR/NOT, truth tables)SAT is the central problem
Finite automata (helpful, not mandatory)Turing machines extend them

How to study this course

  1. Learn the definitions cold. Half the exam marks are for stating P, NP, NP-hard, NP-complete, reductions and Cook–Levin precisely. Sloppy definitions lose marks fast.
  2. Practise reductions on paper. Reductions are the "problems" of this subject — the gadget constructions in Unit 3 must be reproduced, not just recognised.
  3. Keep a "class membership" table. Every time you meet a problem (sorting, SAT, CLIQUE, TQBF...), note its class. The table is your revision sheet.
  4. Always check both directions. An NP-completeness proof needs membership in NP and NP-hardness — students routinely forget the first half.

Notation you will use all semester

SymbolReadingFirst appears
O, Ω, Θ, o, ωasymptotic upper / lower / tight / strict boundsUnit 1
{0,1}*the set of all finite binary stringsUnit 1
L ⊆ {0,1}*a language = a decision problem's YES-setUnit 1
A ≤ₚ BA polynomial-time reduces to B ("A no harder than B")Unit 1
⟨G⟩, ⟨M, x⟩a standard string encoding of the object(s)Units 1–2
δtransition function of a machineUnit 2
φ, ψBoolean formulasUnit 3
OPT(x)value of the optimal solution of instance xUnit 4

What a typical end-term paper looks like

Question styleTypical marksWhere it is trained
"Define P / NP / NP-hard / NP-complete and relate them"5–8Unit 1
"Prove f(n) = O(g(n))" / derive the complexity of a code fragment4–6Unit 1
"Design a Turing machine for L; analyse its time and space"6–8Unit 2
"State and prove (or sketch) the Cook–Levin theorem"8–10Unit 3
"Prove problem X is NP-complete" (a gadget reduction)8–10Unit 3
"Consequences of P = NP" / short notes on PSPACE, IP, approximation5–8Unit 4

Two habits this table should trigger immediately: definitions are recall marks (bank them early), reductions are practice marks (earn them on paper, weekly — they cannot be crammed).

A four-week study plan that works

  1. Week 1 — Unit 1: memorise the five asymptotic definitions; rebuild the class diagram from memory; write five O/Ω/Θ proofs with explicit constants.
  2. Week 2 — Unit 2: trace the {0ⁿ1ⁿ} machine by hand; write the verifier ⟺ NTM equivalence argument once without notes.
  3. Week 3 — Unit 3: reproduce the Cook–Levin outline; write the SAT → 3-SAT and 3-SAT → CLIQUE reductions from a blank page.
  4. Week 4 — Unit 4 + revision: the class map, the P = NP consequences table, one approximation proof — then attack the revision lesson's question bank.

Self-check before you begin

  1. Can you state, without looking, the difference between solving a problem and verifying a proposed solution?
  2. Why does a 2ⁿ-time algorithm not become practical when computers get 1000× faster?
  3. What two things must be shown to prove a problem NP-complete?
  4. Which unit of this course proves the first NP-complete problem exists, and what is that problem?