This ugly duckling theorem calculator can aid you in understanding the implications of showing the differences and similarities between any two objects.
Although it may appear simple initially, this theorem shows that there's really no ugly duckling if we remove all bias from the classification process.
In this text, we will show:
- What Watanabe's ugly duckling theorem means;
- The relation between the ugly duckling theorem and pattern recognition;
- What the Hamming distance is; and
- An example of visualizing this problem.
What is the ugly duckling theorem?
The ugly duckling theorem asserts that classification without bias makes all objects equally similar and dissimilar. It originated in Satosi Watanabe's "Ugly duckling theorem" from "Knowing and Guessing, A Quantitative Study of Inference and Information (1969)".
In the original story "The Ugly Duckling" by Hans Christian Andersen, a duckling struggles to find its place due to the apparent differences between it and its duck family. The story concludes when the duckling realizes it wasn't a duck but a swan the whole time.
According to this theorem, two ducklings share the same number of similarities between them as any of them share with the baby swan.
Explaining the theorem
Assume we have three objects A, B, and C, and we want to find the one which differentiates the most from the others.
For that, we will separate them using the list of all boolean functions that arise from initial features.
Let's say that initially, we separate the objects based on whether they have legs or wings and call these classes and , respectively. Note that you can use any feature you'd like.
The size of the set of all boolean functions created from these two features is , in our case .
Boolean functions from and
L ∧ W
L ∧ ¬W
L ∨ W
L ∨ ¬W
¬L ∧ W
¬L ∧ ¬W
¬L ∨ W
¬L ∨ ¬W
💡 These boolean functions are created from all possible combinations that arise from applying the logical operators to the initial features. E.g., means the object does not have wings or does not have legs.
Representing each object by a n-bit string
Therefore, we can use a string of bits to represent each object by assigning each digit to each boolean function.
To avoid bias in this representation, each digit will have the same importance as the others when comparing the objects.
Lastly, we will take the order of the digits from the list above. An object containing on the leading digit will have both legs and wings.
The Hamming distance
The Hamming distance is a way to compare two binary strings of equal length by counting the number of positions where their bits differ. For example, and would have a Hamming distance of .
We can use the Hamming distance in our problem to find the most dissimilar object. Let's do that!
Comparing the n-bits string objects
Let's say we've paired each object with its corresponding n-bits string as follows:
Look at each and count how many bits and have in common. Now compare and .
No matter which strings you choose to compare; they will all have four bits in common and four different bits.
Since each bit refers to a "feature", and each of these features is as important as the others, Watanabe's ugly duckling theorem concludes that we can't really say that these objects are more similar than they are dissimilar.
The only way to distinguish them would be to consider any of the features more appealing than the others. This, however, introduces bias.
🙋 Use the ugly duckling theorem calculator to understand this example with a more visual representation 🦆.
How do Watanabe's ugly duckling theorem and pattern recognition relate?
Watanabe's ugly duckling theorem states that without bias, all objects are equally similar and dissimilar when compared to each other. For pattern recognition, this means that the objects' features should be weighted accordingly, taking into account the particular problem to be solved.
What is the Hamming distance of 01 and 10?
2. The Hamming distance of 01 and 10 is the number of positions in which their bits differ. Since we need to switch two bits from 01 to get to 10, the Hamming distance is 2.
How do I calculate the Hamming distance?
To calculate the Hamming distance of any two equal-length bit strings:
- Compare the first bit of each of the strings.
- Repeat comparing each position until you've covered the whole string, and count the number of times these bits differ.
- The result is the Hamming distance between the strings.