Advanced

Ugly Duckling Theorem Calculator

The Ugly Duckling Theorem (Satosi Watanabe, 1969) proves a surprising result: given n binary features, any two distinct objects share exactly half of all 2^(2^n) possible Boolean predicates. This means that without explicitly weighting features, every pair of objects is equally similar — there is no objective way to single out any one object as the 'ugly duckling'. Enter the number of features and the raw feature agreements between two objects to see the contrast between raw (Hamming) similarity and predicate-space similarity.
Each feature takes value 0 or 1. Max 20 for display purposes.
How many of the n features have the same value in both objects
Predicate similarity (any pair)
50%

Exactly 50% always — regardless of how similar the two objects look in raw feature space.

Raw (Hamming) similarity
75 %
Feature agreements / n
3 / 4
Feature disagreements
1
Possible feature vectors
16
Total predicates
65,536
Matching predicates
32,768

The Ugly Duckling Theorem (Watanabe 1969): without any weighting of features, all pairs of objects share exactly half of all possible Boolean predicates — so no object can be singled out as more similar or more different. Classification always requires an implicit or explicit preference for some features over others.

50%
50%
Matching predicates (P(x) = P(y))
Differing predicates (P(x) ≠ P(y))
For any two distinct objects with n = 4 binary features, the 2^16 predicates split exactly 50/50
Results are estimates for general information only and are not professional advice — always verify important results independently before relying on them. Read the full disclaimer.
Quick answer

How does this calculator work?

Watanabe's Ugly Duckling Theorem shows that with n binary features, any two distinct objects share exactly 2^(2^n − 1) out of 2^(2^n) Boolean predicates — always exactly 50%. This proves that any similarity-based classification implicitly weights some features more than others; there is no objective, unweighted similarity between objects.

Formula
Total predicates = 2^(2^n) • Shared predicates (any pair) = 2^(2^n − 1) • Similarity = 50% (always)
How this is calculated

With n binary features, there are 2^n possible feature vectors (potential objects), and 2^(2^n) possible Boolean predicates — functions that assign 0 or 1 to every feature vector. Two objects x and y "agree" on a predicate P if P(x) = P(y), regardless of the value. For any two distinct feature vectors x ≠ y, exactly 2^(2^n − 1) predicates satisfy P(x) = P(y), and the same number satisfy P(x) ≠ P(y). The ratio is always exactly 50%, independent of how many raw features x and y share.

This result undermines the intuition that objects which look similar in feature space (high Hamming similarity) are genuinely more similar in an abstract sense. The theorem shows that the choice of similarity metric always encodes a bias — a preference for certain predicates (features or combinations of features) over others. This has deep implications for machine learning: any classification or clustering algorithm implicitly assumes some features matter more than others, and there is no unbiased default.

The theorem is related to the No Free Lunch theorems in optimization and learning theory, which show that no algorithm outperforms all others on all problems. Practically, this motivates domain-knowledge-driven feature engineering: you must choose which features are relevant before similarity is meaningful.

Frequently asked questions

A predicate is any function that maps a feature vector to 0 ("no") or 1 ("yes"). For n binary features there are 2^n possible feature vectors, so a predicate is a mapping from those 2^n vectors to {0,1} — and there are 2^(2^n) such mappings in total. "Is it a duck?" is a predicate; so is "does it have wings AND lay eggs OR live in water?" — all are counted equally.

For any two distinct objects x and y, exactly half the predicates return the same value for both (either both 0 or both 1). This holds regardless of how many of the n features they share. In raw feature space, two objects with 3/4 agreements look more similar than two with 1/4 agreements — but in the space of all Boolean predicates they are identical: 50% match for both pairs.

It means that any similarity measure or classification rule encodes assumptions about which predicates (features) matter. An algorithm that uses Euclidean distance in pixel space is implicitly saying that pixel-level differences are more informative than, say, semantic-level predicates. There is no 'natural' similarity without a prior preference for some features over others — which is why feature engineering and domain knowledge are so important.

Also known as

watanabe theorem predicates
feature weighting similarity bias
boolean predicates similarity calculator
no free lunch classification
pattern recognition feature bias
predicate space similarity

APA

TG we-Calculate Editorial Team. (2026). Ugly Duckling Theorem Calculator [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/ugly-duckling-theorem-calculator

Chicago

TG we-Calculate Editorial Team. "Ugly Duckling Theorem Calculator." TG we-Calculate. 2026. https://we-calculate.com/calculator/ugly-duckling-theorem-calculator.

IEEE

TG we-Calculate Editorial Team, "Ugly Duckling Theorem Calculator," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/ugly-duckling-theorem-calculator

BibTeX

@misc{wecalculate_ugly_duckling_theorem_calculator, title = {Ugly Duckling Theorem Calculator}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/ugly-duckling-theorem-calculator}}, year = {2026}, note = {TG we-Calculate} }

Did this calculator help you?