# A metric on finite sets

1. Nov 10, 2008

### birulami

Hi,

recently I stumbled across the question whether for finite sets $A,B$ the function

[tex]d(A,B):=|A\cup B| - |A\cap B|[/itex]

is a http://en.wikipedia.org/wiki/Metric_distance" [Broken]? Trivially, $d(A,A)=0$ and of course $d$ is symmetric, but how about the triangle inequality? Does it hold?

Harald.

Last edited by a moderator: May 3, 2017
2. Nov 10, 2008

### gel

yes it is. For the triangle inequality see the formula $(A \Delta B) \Delta (B \Delta C) = A \Delta C$ here - http://en.wikipedia.org/wiki/Symmetric_difference" [Broken].

Also, for infinite sets you can replace the size |A| of a set with its measure (eg, length, volume, etc) to get a pseudometric, as mentioned in the wikipedia link.

Last edited by a moderator: May 3, 2017
3. Nov 11, 2008

### birulami

I never really came across symmetric difference as an explicit operator in set theory.

Thanks for the information,
Harald.

4. Nov 11, 2008

### CRGreathouse

It's certainly not a metric in the usual sense, since metrics are real-valued not set-valued.

5. Nov 11, 2008

### matticus

you didn't notice the bars around the sets, denoting cardinality. for finite sets this will be an integer number, hence it is a metric in a usual sense.