Try To Calculator logoTry To Calculator

Ugly Duckling Theorem Calculator

Last updated: October 3, 20244 people find this calculator helpful
Loading calculator…

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 mm initial features.

Let's say that initially, we separate the objects based on whether they have legs or wings and call these classes LL and WW, 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 22m22m, in our case 24=824=8.

∧ = and, ∨ = or, ¬ = not. For example, L ∧ ¬W means the object has legs AND doesn't have wings.

Boolean functions from LL and WW

L ∧ W

L ∧ ¬W

L ∨ W

L ∨ ¬W

¬L ∧ W

¬L ∧ ¬W

¬L ∨ W

¬L ∨ ¬W

For further reading into logic operators, check our AND calculator, NOR calculator, or XOR calculator.

💡 These boolean functions are created from all possible combinations that arise from applying the logical operators to the initial features. E.g., ¬W¬L¬W¬L 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 88 bits to represent each object by assigning each digit to each boolean function.

E.g., 1011001010110010

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 11 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, 11001100 and 11011101 would have a Hamming distance of 11.

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:

A=1 0 1 1 0 0 1 0A=1 0 1 1 0 0 1 0
B=0 1 1 1 0 0 0 1B=0 1 1 1 0 0 0 1
C=0 0 1 0 1 0 1 1C=0 0 1 0 1 0 1 1

Look at each and count how many bits AA and BB have in common. Now compare AA and CC.

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 🦆.

FAQs

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)".
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.

Based on 1 source

Related calculators