How do you prove the no free lunch theorem: for any learning algorithm for binary classification with the - loss over a domain , and any training size , there is a distribution and a labelling function with such that with probability at least over , ?
Learning theory, No free lunch
Level L5 Expert. Length Long. Nature Mat Mathematical.
What's being asked
Whether you can run the averaging argument over all labellings of a -point set and then convert an expectation bound into a probability bound.
Key idea
Averaged over all labellings of a -point set, the algorithm has expected error at least on the unseen half. Some labelling therefore has expected error , and a reverse-Markov argument gives .
Steps
- Choose with . Let be all labellings of , and let be uniform on with labels , so .
- There are possible training sequences of unlabelled points. Let be labelled by . Then .
- Fix a sequence . At least points of do not occur in . For any hypothesis , .
- Average over : .
- For a fixed , pair the labellings that differ only at . They agree on , so the algorithm outputs the same hypothesis, hence the same prediction at , and exactly one of the pair is wrong at . The average is . Therefore the expected error is at least .
- So some has . Since , the reverse Markov inequality gives .
Common mistakes
- Taking with . Then the training set could cover completely. You need points so that at least half are unseen.
- Forgetting the pairing argument. The key fact is that unseen points are labelled arbitrarily, so no algorithm can do better than guessing on them.
- Using Markov in the wrong direction. A lower bound on the probability that is large needs the upper bound .
- Claiming the theorem holds for a fixed distribution. The distribution depends on the algorithm.
How long your answer should be
One to one and a half pages; 8–10 minutes.
Last checked on 4 December 2026.
Read this
Previous in Learning theory: Define the growth function . State and prove Sauer's lemma: if , then . Why does this matter for generalisation?
Next in Learning theory: How do you prove that for a class of functions with values in , with probability at least over a sample of size , every satisfies , where is the expected Rademacher complexity?