MPE Home Metamath Proof Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  MPE Home  >  Th. List  >  birthday Unicode version

Theorem birthday 20251
Description: The Birthday Problem. There is a more than even chance that out of 23 people in a room, at least two of them have the same birthday. Mathematically, this is asserting that for  K  =  2 3 and  N  =  3 6 5, fewer than half of the set of all functions from  1 ... K to  1 ... N are injective. (Contributed by Mario Carneiro, 17-Apr-2015.)
Hypotheses
Ref Expression
birthday.s  |-  S  =  { f  |  f : ( 1 ... K ) --> ( 1 ... N ) }
birthday.t  |-  T  =  { f  |  f : ( 1 ... K ) -1-1-> ( 1 ... N ) }
birthday.k  |-  K  = ; 2
3
birthday.n  |-  N  = ;; 3 6 5
Assertion
Ref Expression
birthday  |-  ( (
# `  T )  /  ( # `  S
) )  <  (
1  /  2 )
Distinct variable groups:    f, K    f, N
Allowed substitution hints:    S( f)    T( f)

Proof of Theorem birthday
StepHypRef Expression
1 birthday.k . . . 4  |-  K  = ; 2
3
2 2nn0 9984 . . . . 5  |-  2  e.  NN0
3 3nn0 9985 . . . . 5  |-  3  e.  NN0
42, 3deccl 10140 . . . 4  |- ; 2 3  e.  NN0
51, 4eqeltri 2355 . . 3  |-  K  e. 
NN0
6 birthday.n . . . 4  |-  N  = ;; 3 6 5
7 6nn0 9988 . . . . . 6  |-  6  e.  NN0
83, 7deccl 10140 . . . . 5  |- ; 3 6  e.  NN0
9 5nn 9882 . . . . 5  |-  5  e.  NN
108, 9decnncl 10139 . . . 4  |- ;; 3 6 5  e.  NN
116, 10eqeltri 2355 . . 3  |-  N  e.  NN
12 birthday.s . . . 4  |-  S  =  { f  |  f : ( 1 ... K ) --> ( 1 ... N ) }
13 birthday.t . . . 4  |-  T  =  { f  |  f : ( 1 ... K ) -1-1-> ( 1 ... N ) }
1412, 13birthdaylem3 20250 . . 3  |-  ( ( K  e.  NN0  /\  N  e.  NN )  ->  ( ( # `  T
)  /  ( # `  S ) )  <_ 
( exp `  -u (
( ( ( K ^ 2 )  -  K )  /  2
)  /  N ) ) )
155, 11, 14mp2an 653 . 2  |-  ( (
# `  T )  /  ( # `  S
) )  <_  ( exp `  -u ( ( ( ( K ^ 2 )  -  K )  /  2 )  /  N ) )
16 log2ub 20247 . . . . . 6  |-  ( log `  2 )  < 
(;; 2 5 3  / ;; 3 6 5 )
175nn0cni 9979 . . . . . . . . . . . 12  |-  K  e.  CC
1817sqvali 11185 . . . . . . . . . . 11  |-  ( K ^ 2 )  =  ( K  x.  K
)
1917mulid1i 8841 . . . . . . . . . . . 12  |-  ( K  x.  1 )  =  K
2019eqcomi 2289 . . . . . . . . . . 11  |-  K  =  ( K  x.  1 )
2118, 20oveq12i 5872 . . . . . . . . . 10  |-  ( ( K ^ 2 )  -  K )  =  ( ( K  x.  K )  -  ( K  x.  1 ) )
22 ax-1cn 8797 . . . . . . . . . . 11  |-  1  e.  CC
2317, 17, 22subdii 9230 . . . . . . . . . 10  |-  ( K  x.  ( K  - 
1 ) )  =  ( ( K  x.  K )  -  ( K  x.  1 ) )
2421, 23eqtr4i 2308 . . . . . . . . 9  |-  ( ( K ^ 2 )  -  K )  =  ( K  x.  ( K  -  1 ) )
2524oveq1i 5870 . . . . . . . 8  |-  ( ( ( K ^ 2 )  -  K )  /  2 )  =  ( ( K  x.  ( K  -  1
) )  /  2
)
2617, 22subcli 9124 . . . . . . . . . 10  |-  ( K  -  1 )  e.  CC
27 2cn 9818 . . . . . . . . . 10  |-  2  e.  CC
28 2ne0 9831 . . . . . . . . . 10  |-  2  =/=  0
2917, 26, 27, 28divassi 9518 . . . . . . . . 9  |-  ( ( K  x.  ( K  -  1 ) )  /  2 )  =  ( K  x.  (
( K  -  1 )  /  2 ) )
30 1nn0 9983 . . . . . . . . . 10  |-  1  e.  NN0
31 2p1e3 9849 . . . . . . . . . . . . . . . 16  |-  ( 2  +  1 )  =  3
32 eqid 2285 . . . . . . . . . . . . . . . 16  |- ; 2 2  = ; 2 2
332, 2, 31, 32decsuc 10149 . . . . . . . . . . . . . . 15  |-  (; 2 2  +  1 )  = ; 2 3
341, 33eqtr4i 2308 . . . . . . . . . . . . . 14  |-  K  =  (; 2 2  +  1 )
3534oveq1i 5870 . . . . . . . . . . . . 13  |-  ( K  -  1 )  =  ( (; 2 2  +  1 )  -  1 )
362, 2deccl 10140 . . . . . . . . . . . . . . 15  |- ; 2 2  e.  NN0
3736nn0cni 9979 . . . . . . . . . . . . . 14  |- ; 2 2  e.  CC
38 pncan 9059 . . . . . . . . . . . . . 14  |-  ( (; 2
2  e.  CC  /\  1  e.  CC )  ->  ( (; 2 2  +  1 )  -  1 )  = ; 2 2 )
3937, 22, 38mp2an 653 . . . . . . . . . . . . 13  |-  ( (; 2
2  +  1 )  -  1 )  = ; 2
2
4035, 39eqtri 2305 . . . . . . . . . . . 12  |-  ( K  -  1 )  = ; 2
2
4140oveq1i 5870 . . . . . . . . . . 11  |-  ( ( K  -  1 )  /  2 )  =  (; 2 2  /  2
)
42 eqid 2285 . . . . . . . . . . . . 13  |- ; 1 1  = ; 1 1
43 0nn0 9982 . . . . . . . . . . . . 13  |-  0  e.  NN0
4427mulid1i 8841 . . . . . . . . . . . . . . 15  |-  ( 2  x.  1 )  =  2
4544oveq1i 5870 . . . . . . . . . . . . . 14  |-  ( ( 2  x.  1 )  +  0 )  =  ( 2  +  0 )
4627addid1i 9001 . . . . . . . . . . . . . 14  |-  ( 2  +  0 )  =  2
4745, 46eqtri 2305 . . . . . . . . . . . . 13  |-  ( ( 2  x.  1 )  +  0 )  =  2
482dec0h 10142 . . . . . . . . . . . . . 14  |-  2  = ; 0 2
4944, 48eqtri 2305 . . . . . . . . . . . . 13  |-  ( 2  x.  1 )  = ; 0
2
502, 30, 30, 42, 2, 43, 47, 49decmul2c 10174 . . . . . . . . . . . 12  |-  ( 2  x. ; 1 1 )  = ; 2
2
5130, 30deccl 10140 . . . . . . . . . . . . . 14  |- ; 1 1  e.  NN0
5251nn0cni 9979 . . . . . . . . . . . . 13  |- ; 1 1  e.  CC
5337, 27, 52, 28divmuli 9516 . . . . . . . . . . . 12  |-  ( (; 2
2  /  2 )  = ; 1 1  <->  ( 2  x. ; 1 1 )  = ; 2
2 )
5450, 53mpbir 200 . . . . . . . . . . 11  |-  (; 2 2  /  2
)  = ; 1 1
5541, 54eqtri 2305 . . . . . . . . . 10  |-  ( ( K  -  1 )  /  2 )  = ; 1
1
5619, 1eqtri 2305 . . . . . . . . . . 11  |-  ( K  x.  1 )  = ; 2
3
57 3p2e5 9857 . . . . . . . . . . 11  |-  ( 3  +  2 )  =  5
582, 3, 2, 56, 57decaddi 10170 . . . . . . . . . 10  |-  ( ( K  x.  1 )  +  2 )  = ; 2
5
595, 30, 30, 55, 3, 2, 58, 56decmul2c 10174 . . . . . . . . 9  |-  ( K  x.  ( ( K  -  1 )  / 
2 ) )  = ;; 2 5 3
6029, 59eqtri 2305 . . . . . . . 8  |-  ( ( K  x.  ( K  -  1 ) )  /  2 )  = ;; 2 5 3
6125, 60eqtri 2305 . . . . . . 7  |-  ( ( ( K ^ 2 )  -  K )  /  2 )  = ;; 2 5 3
6261, 6oveq12i 5872 . . . . . 6  |-  ( ( ( ( K ^
2 )  -  K
)  /  2 )  /  N )  =  (;; 2 5 3  / ;; 3 6 5 )
6316, 62breqtrri 4050 . . . . 5  |-  ( log `  2 )  < 
( ( ( ( K ^ 2 )  -  K )  / 
2 )  /  N
)
64 2rp 10361 . . . . . . 7  |-  2  e.  RR+
65 relogcl 19934 . . . . . . 7  |-  ( 2  e.  RR+  ->  ( log `  2 )  e.  RR )
6664, 65ax-mp 8 . . . . . 6  |-  ( log `  2 )  e.  RR
67 5nn0 9987 . . . . . . . . . . 11  |-  5  e.  NN0
682, 67deccl 10140 . . . . . . . . . 10  |- ; 2 5  e.  NN0
6968, 3deccl 10140 . . . . . . . . 9  |- ;; 2 5 3  e.  NN0
7061, 69eqeltri 2355 . . . . . . . 8  |-  ( ( ( K ^ 2 )  -  K )  /  2 )  e. 
NN0
7170nn0rei 9978 . . . . . . 7  |-  ( ( ( K ^ 2 )  -  K )  /  2 )  e.  RR
72 nndivre 9783 . . . . . . 7  |-  ( ( ( ( ( K ^ 2 )  -  K )  /  2
)  e.  RR  /\  N  e.  NN )  ->  ( ( ( ( K ^ 2 )  -  K )  / 
2 )  /  N
)  e.  RR )
7371, 11, 72mp2an 653 . . . . . 6  |-  ( ( ( ( K ^
2 )  -  K
)  /  2 )  /  N )  e.  RR
7466, 73ltnegi 9319 . . . . 5  |-  ( ( log `  2 )  <  ( ( ( ( K ^ 2 )  -  K )  /  2 )  /  N )  <->  -u ( ( ( ( K ^
2 )  -  K
)  /  2 )  /  N )  <  -u ( log `  2
) )
7563, 74mpbi 199 . . . 4  |-  -u (
( ( ( K ^ 2 )  -  K )  /  2
)  /  N )  <  -u ( log `  2
)
7673renegcli 9110 . . . . 5  |-  -u (
( ( ( K ^ 2 )  -  K )  /  2
)  /  N )  e.  RR
7766renegcli 9110 . . . . 5  |-  -u ( log `  2 )  e.  RR
78 eflt 12399 . . . . 5  |-  ( (
-u ( ( ( ( K ^ 2 )  -  K )  /  2 )  /  N )  e.  RR  /\  -u ( log `  2
)  e.  RR )  ->  ( -u (
( ( ( K ^ 2 )  -  K )  /  2
)  /  N )  <  -u ( log `  2
)  <->  ( exp `  -u (
( ( ( K ^ 2 )  -  K )  /  2
)  /  N ) )  <  ( exp `  -u ( log `  2
) ) ) )
7976, 77, 78mp2an 653 . . . 4  |-  ( -u ( ( ( ( K ^ 2 )  -  K )  / 
2 )  /  N
)  <  -u ( log `  2 )  <->  ( exp `  -u ( ( ( ( K ^ 2 )  -  K )  / 
2 )  /  N
) )  <  ( exp `  -u ( log `  2
) ) )
8075, 79mpbi 199 . . 3  |-  ( exp `  -u ( ( ( ( K ^ 2 )  -  K )  /  2 )  /  N ) )  < 
( exp `  -u ( log `  2 ) )
8166recni 8851 . . . . 5  |-  ( log `  2 )  e.  CC
82 efneg 12380 . . . . 5  |-  ( ( log `  2 )  e.  CC  ->  ( exp `  -u ( log `  2
) )  =  ( 1  /  ( exp `  ( log `  2
) ) ) )
8381, 82ax-mp 8 . . . 4  |-  ( exp `  -u ( log `  2
) )  =  ( 1  /  ( exp `  ( log `  2
) ) )
84 reeflog 19936 . . . . . 6  |-  ( 2  e.  RR+  ->  ( exp `  ( log `  2
) )  =  2 )
8564, 84ax-mp 8 . . . . 5  |-  ( exp `  ( log `  2
) )  =  2
8685oveq2i 5871 . . . 4  |-  ( 1  /  ( exp `  ( log `  2 ) ) )  =  ( 1  /  2 )
8783, 86eqtri 2305 . . 3  |-  ( exp `  -u ( log `  2
) )  =  ( 1  /  2 )
8880, 87breqtri 4048 . 2  |-  ( exp `  -u ( ( ( ( K ^ 2 )  -  K )  /  2 )  /  N ) )  < 
( 1  /  2
)
8912, 13birthdaylem1 20248 . . . . . . . 8  |-  ( T 
C_  S  /\  S  e.  Fin  /\  ( N  e.  NN  ->  S  =/=  (/) ) )
9089simp2i 965 . . . . . . 7  |-  S  e. 
Fin
9189simp1i 964 . . . . . . 7  |-  T  C_  S
92 ssfi 7085 . . . . . . 7  |-  ( ( S  e.  Fin  /\  T  C_  S )  ->  T  e.  Fin )
9390, 91, 92mp2an 653 . . . . . 6  |-  T  e. 
Fin
94 hashcl 11352 . . . . . 6  |-  ( T  e.  Fin  ->  ( # `
 T )  e. 
NN0 )
9593, 94ax-mp 8 . . . . 5  |-  ( # `  T )  e.  NN0
9695nn0rei 9978 . . . 4  |-  ( # `  T )  e.  RR
9789simp3i 966 . . . . . 6  |-  ( N  e.  NN  ->  S  =/=  (/) )
9811, 97ax-mp 8 . . . . 5  |-  S  =/=  (/)
99 hashnncl 11356 . . . . . 6  |-  ( S  e.  Fin  ->  (
( # `  S )  e.  NN  <->  S  =/=  (/) ) )
10090, 99ax-mp 8 . . . . 5  |-  ( (
# `  S )  e.  NN  <->  S  =/=  (/) )
10198, 100mpbir 200 . . . 4  |-  ( # `  S )  e.  NN
102 nndivre 9783 . . . 4  |-  ( ( ( # `  T
)  e.  RR  /\  ( # `  S )  e.  NN )  -> 
( ( # `  T
)  /  ( # `  S ) )  e.  RR )
10396, 101, 102mp2an 653 . . 3  |-  ( (
# `  T )  /  ( # `  S
) )  e.  RR
104 reefcl 12370 . . . 4  |-  ( -u ( ( ( ( K ^ 2 )  -  K )  / 
2 )  /  N
)  e.  RR  ->  ( exp `  -u (
( ( ( K ^ 2 )  -  K )  /  2
)  /  N ) )  e.  RR )
10576, 104ax-mp 8 . . 3  |-  ( exp `  -u ( ( ( ( K ^ 2 )  -  K )  /  2 )  /  N ) )  e.  RR
106 1re 8839 . . . 4  |-  1  e.  RR
107 rehalfcl 9940 . . . 4  |-  ( 1  e.  RR  ->  (
1  /  2 )  e.  RR )
108106, 107ax-mp 8 . . 3  |-  ( 1  /  2 )  e.  RR
109103, 105, 108lelttri 8948 . 2  |-  ( ( ( ( # `  T
)  /  ( # `  S ) )  <_ 
( exp `  -u (
( ( ( K ^ 2 )  -  K )  /  2
)  /  N ) )  /\  ( exp `  -u ( ( ( ( K ^ 2 )  -  K )  /  2 )  /  N ) )  < 
( 1  /  2
) )  ->  (
( # `  T )  /  ( # `  S
) )  <  (
1  /  2 ) )
11015, 88, 109mp2an 653 1  |-  ( (
# `  T )  /  ( # `  S
) )  <  (
1  /  2 )
Colors of variables: wff set class
Syntax hints:    -> wi 4    <-> wb 176    = wceq 1625    e. wcel 1686   {cab 2271    =/= wne 2448    C_ wss 3154   (/)c0 3457   class class class wbr 4025   -->wf 5253   -1-1->wf1 5254   ` cfv 5257  (class class class)co 5860   Fincfn 6865   CCcc 8737   RRcr 8738   0cc0 8739   1c1 8740    + caddc 8742    x. cmul 8744    < clt 8869    <_ cle 8870    - cmin 9039   -ucneg 9040    / cdiv 9425   NNcn 9748   2c2 9797   3c3 9798   5c5 9800   6c6 9801   NN0cn0 9967  ;cdc 10126   RR+crp 10356   ...cfz 10784   ^cexp 11106   #chash 11339   expce 12345   logclog 19914
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1535  ax-5 1546  ax-17 1605  ax-9 1637  ax-8 1645  ax-13 1688  ax-14 1690  ax-6 1705  ax-7 1710  ax-11 1717  ax-12 1868  ax-ext 2266  ax-rep 4133  ax-sep 4143  ax-nul 4151  ax-pow 4190  ax-pr 4216  ax-un 4514  ax-inf2 7344  ax-cnex 8795  ax-resscn 8796  ax-1cn 8797  ax-icn 8798  ax-addcl 8799  ax-addrcl 8800  ax-mulcl 8801  ax-mulrcl 8802  ax-mulcom 8803  ax-addass 8804  ax-mulass 8805  ax-distr 8806  ax-i2m1 8807  ax-1ne0 8808  ax-1rid 8809  ax-rnegex 8810  ax-rrecex 8811  ax-cnre 8812  ax-pre-lttri 8813  ax-pre-lttrn 8814  ax-pre-ltadd 8815  ax-pre-mulgt0 8816  ax-pre-sup 8817  ax-addf 8818  ax-mulf 8819
This theorem depends on definitions:  df-bi 177  df-or 359  df-an 360  df-3or 935  df-3an 936  df-tru 1310  df-ex 1531  df-nf 1534  df-sb 1632  df-eu 2149  df-mo 2150  df-clab 2272  df-cleq 2278  df-clel 2281  df-nfc 2410  df-ne 2450  df-nel 2451  df-ral 2550  df-rex 2551  df-reu 2552  df-rmo 2553  df-rab 2554  df-v 2792  df-sbc 2994  df-csb 3084  df-dif 3157  df-un 3159  df-in 3161  df-ss 3168  df-pss 3170  df-nul 3458  df-if 3568  df-pw 3629  df-sn 3648  df-pr 3649  df-tp 3650  df-op 3651  df-uni 3830  df-int 3865  df-iun 3909  df-iin 3910  df-br 4026  df-opab 4080  df-mpt 4081  df-tr 4116  df-eprel 4307  df-id 4311  df-po 4316  df-so 4317  df-fr 4354  df-se 4355  df-we 4356  df-ord 4397  df-on 4398  df-lim 4399  df-suc 4400  df-om 4659  df-xp 4697  df-rel 4698  df-cnv 4699  df-co 4700  df-dm 4701  df-rn 4702  df-res 4703  df-ima 4704  df-iota 5221  df-fun 5259  df-fn 5260  df-f 5261  df-f1 5262  df-fo 5263  df-f1o 5264  df-fv 5265  df-isom 5266  df-ov 5863  df-oprab 5864  df-mpt2 5865  df-of 6080  df-1st 6124  df-2nd 6125  df-riota 6306  df-recs 6390  df-rdg 6425  df-1o 6481  df-2o 6482  df-oadd 6485  df-er 6662  df-map 6776  df-pm 6777  df-ixp 6820  df-en 6866  df-dom 6867  df-sdom 6868  df-fin 6869  df-fi 7167  df-sup 7196  df-oi 7227  df-card 7574  df-cda 7796  df-pnf 8871  df-mnf 8872  df-xr 8873  df-ltxr 8874  df-le 8875  df-sub 9041  df-neg 9042  df-div 9426  df-nn 9749  df-2 9806  df-3 9807  df-4 9808  df-5 9809  df-6 9810  df-7 9811  df-8 9812  df-9 9813  df-10 9814  df-n0 9968  df-z 10027  df-dec 10127  df-uz 10233  df-q 10319  df-rp 10357  df-xneg 10454  df-xadd 10455  df-xmul 10456  df-ioo 10662  df-ioc 10663  df-ico 10664  df-icc 10665  df-fz 10785  df-fzo 10873  df-fl 10927  df-mod 10976  df-seq 11049  df-exp 11107  df-fac 11291  df-bc 11318  df-hash 11340  df-shft 11564  df-cj 11586  df-re 11587  df-im 11588  df-sqr 11722  df-abs 11723  df-limsup 11947  df-clim 11964  df-rlim 11965  df-sum 12161  df-ef 12351  df-sin 12353  df-cos 12354  df-tan 12355  df-pi 12356  df-dvds 12534  df-struct 13152  df-ndx 13153  df-slot 13154  df-base 13155  df-sets 13156  df-ress 13157  df-plusg 13223  df-mulr 13224  df-starv 13225  df-sca 13226  df-vsca 13227  df-tset 13229  df-ple 13230  df-ds 13232  df-hom 13234  df-cco 13235  df-rest 13329  df-topn 13330  df-topgen 13346  df-pt 13347  df-prds 13350  df-xrs 13405  df-0g 13406  df-gsum 13407  df-qtop 13412  df-imas 13413  df-xps 13415  df-mre 13490  df-mrc 13491  df-acs 13493  df-mnd 14369  df-submnd 14418  df-mulg 14494  df-cntz 14795  df-cmn 15093  df-xmet 16375  df-met 16376  df-bl 16377  df-mopn 16378  df-cnfld 16380  df-top 16638  df-bases 16640  df-topon 16641  df-topsp 16642  df-cld 16758  df-ntr 16759  df-cls 16760  df-nei 16837  df-lp 16870  df-perf 16871  df-cn 16959  df-cnp 16960  df-haus 17045  df-cmp 17116  df-tx 17259  df-hmeo 17448  df-fbas 17522  df-fg 17523  df-fil 17543  df-fm 17635  df-flim 17636  df-flf 17637  df-xms 17887  df-ms 17888  df-tms 17889  df-cncf 18384  df-limc 19218  df-dv 19219  df-ulm 19758  df-log 19916  df-atan 20165
  Copyright terms: Public domain W3C validator