Suppose there is a mega-huge-lottery where they draw 6 numbers from 100.
The winning combination came out and is:
12 - 14 - 30 - 46 - 52 - 68
Suppose also you have 5 tickets for this lottery with the following combination:
Ticket 1 : 11 - 13 - 29 - 45 - 51 - 67
Ticket 2 : 21 - 41 - 03 - 64 - 25 - 86
Ticket 3 : 06 - 07 - 15 - 23 - 26 - 34
Ticket 4 : 07 - 27 - 39 - 69 - 90 - 95
Ticket 5 : 12 - 55 - 61 - 83 - 85 - 89
We observe that:
In ticket 1, there is an offset of -1 of the winning combination
In ticket 2, we have the reversed digit of the winning combination
In ticket 3, we have half of every number in the winning combination
In ticket 4, (this ticket was chosen randomly by the terminal selling the ticket, but studying the listing of the randomly generated combination by the computer we find that this combination came out right before the winning combination (say if computed 1 millisecond later the computer would have printed the winning combination)
In ticket 5, Number 12 is the only number in the winning combination
Question is: With which ticket (1-2-3-4-5) did you came the closest to winning the lottery ?
If the lottery is working like this:
Grand Prize:6 numbers fixed
First Prize:5 numbers fixed
Second Prize:4 numbers fixed
Third Prize:3 numbers fixed
Forth Prize:2 numbers fixed
Fifth Prize:1 number fixed
Then all the combinations make a metric space.
Definition:
[latex]$$$
D := \{x \mid x \in Z \cap [1,100] \} \\
C := \{x \mid x \subset D \wedge |x|=6 \} \\
d(x,y) :=6-|x\cap y| \\
$$$[/latex]
then
[latex]$$$
1.(\forall x,y\in C \,) (d(x,y) \ge 0) \\
2.(\forall x\in C \,) (d(x,y) = 0 \leftrightarrow x=y ) \\
3.(\forall x,y\in C \,) (d(x,y) = d(y,x)) \\
4.(\forall x,y,z\in C \,) (d(x,z) \le d(x,y)+d(y,z)) \\
$$$[/latex]
proof:
1.
[latex]$$$
(\forall x,y\in C \,) (d(x,y)=6-|x\cap y|) \\
but, x\cap y \subset x \\
so,0 \le|x\cap y|\le |x|=6 \\
\Rightarrow d(x,y)=6-|x\cap y| \ge 6-|x|=0 \\
\Rightarrow (\forall x,y\in C \,) (d(x,y) \ge 0) \Box \\
$$$[/latex]
2.
[latex]$$$
(\forall x,y\in C \,) (d(x,y)=6-|x\cap y|) \\
\Rightarrow d(x,y)=0 \leftrightarrow 6-|x\cap y|=0 \\
\Rightarrow d(x,y)=0 \leftrightarrow 6=|x\cap y| \\
but, x\cap y \subset x \\
x\cap y \subset y \\
|x|=|y|=6 \\
\Rightarrow 6=|x\cap y|\rightarrow(|x|=|x\cap y|\wedge |x\cap y|=|y|)
$$$[/latex]
6 is a finite number
[latex]$$$
\Rightarrow (|x|=|x\cap y| \leftrightarrow x\cap y=x) \wedge (|x\cap y|=|y| \leftrightarrow x\cap y=y) \\
\Rightarrow |x\cap y|=6 \rightarrow (x\cap y=x \wedge x\cap y=y) \\
\Rightarrow |x\cap y|=6 \rightarrow (x=y) \\
$$$[/latex]
On the other hand,
[latex]$$$
x=y\rightarrow (x\cap y=x \wedge x\cap y=y) \rightarrow |x\cap y|=|x|=|y|=6 \\
\Rightarrow x=y\rightarrow|x\cap y|=6 \\
so,|x\cap y|=6\leftrightarrow x=y \\
so, (\forall x,y\in C \,) (d(x,y)=0 \leftrightarrow x=y) \Box \\
$$$[/latex]
3.
[latex]$$$
(\forall x,y\in C \,) (d(x,y)=6-|x\cap y|) \\
\Rightarrow d(y,x)=6-|y\cap x| \\
y\cap x=x \cap y \\
\Rightarrow |y\cap x|=|x \cap y| \\
\Rightarrow 6-|y\cap x|= 6-|x \cap y| \\
\Rightarrow d(y,x)=6-|y\cap x|=6-|x \cap y|=d(x,y) \\
so,(\forall x,y\in C \,) (d(x,y) = d(y,x)) \Box\\
$$$[/latex]
4.
[latex]$$$
(\forall x,y\in C \,) (d(x,y)=6-|x\cap y|) \\
\Rightarrow d(x,z)=6-|x\cap z|,d(x,y)+d(y,z)=12-|x\cap y|-|y\cap z|\\
\Rightarrow d(x,y)+d(y,z)-d(x,z)=6-|x\cap y|-|y\cap z|+|x\cap z|=|y|-|x\cap y|-|y\cap z|+|x\cap z|\\
$$$[/latex]
Definition:
[latex]$$$
\bar{(x)}:=C\backslash x \\
O:=\bar{x} \cap\bar{y}\cap\bar{z} \\
I:=\bar{x}\cap\bar{y}\cap z \\
II:=\bar{x}\cap y\cap\bar{z} \\
III:=\bar{x}\cap y\cap z \\
IV:=x\cap\bar{y}\cap\bar{z} \\
V:=x\cap\bar{y}\cap z \\
VI:=x\cap y\cap\bar{z} \\
VII:=x\cap y\cap z \\
then,|x\cap y|=|VI|+|VII|,|y\cap z|=|III|+|VII|,|z\cap x|=|V|+|VII|,6=|y|=|II|+|III|+|VI|+|VII| \\
so,|y|-|x\cap y|-|y\cap z|+|x\cap z|=|II|+|V| \ge 0 \\
\Rightarrow d(x,y)+d(y,z) \ge d(x,z) \\
\Rightarrow (\forall x,y,z\in C \,) (d(x,z) \le d(x,y)+d(y,z)) \Box \\
$$$[/latex]
So,
[latex]$$$
(C,d)
$$$[/latex]
is a metric space., and it is suitable for the lottery rules.
Thus the distance between those five tickets and the winning combination is
[latex]$$$
d(1,w)=0;\\
d(2,w)=0;\\
d(3,w)=0;\\
d(4,w)=0;\\
d(5,w)=1;\\
$$$[/latex]
So the 5th ticket is the closest one.