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

Theorem birthday 20471
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 10131 . . . . 5  |-  2  e.  NN0
3 3nn0 10132 . . . . 5  |-  3  e.  NN0
42, 3deccl 10289 . . . 4  |- ; 2 3  e.  NN0
51, 4eqeltri 2436 . . 3  |-  K  e. 
NN0
6 birthday.n . . . 4  |-  N  = ;; 3 6 5
7 6nn0 10135 . . . . . 6  |-  6  e.  NN0
83, 7deccl 10289 . . . . 5  |- ; 3 6  e.  NN0
9 5nn 10029 . . . . 5  |-  5  e.  NN
108, 9decnncl 10288 . . . 4  |- ;; 3 6 5  e.  NN
116, 10eqeltri 2436 . . 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 20470 . . 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 20467 . . . . . 6  |-  ( log `  2 )  < 
(;; 2 5 3  / ;; 3 6 5 )
175nn0cni 10126 . . . . . . . . . . . 12  |-  K  e.  CC
1817sqvali 11348 . . . . . . . . . . 11  |-  ( K ^ 2 )  =  ( K  x.  K
)
1917mulid1i 8986 . . . . . . . . . . . 12  |-  ( K  x.  1 )  =  K
2019eqcomi 2370 . . . . . . . . . . 11  |-  K  =  ( K  x.  1 )
2118, 20oveq12i 5993 . . . . . . . . . 10  |-  ( ( K ^ 2 )  -  K )  =  ( ( K  x.  K )  -  ( K  x.  1 ) )
22 ax-1cn 8942 . . . . . . . . . . 11  |-  1  e.  CC
2317, 17, 22subdii 9375 . . . . . . . . . 10  |-  ( K  x.  ( K  - 
1 ) )  =  ( ( K  x.  K )  -  ( K  x.  1 ) )
2421, 23eqtr4i 2389 . . . . . . . . 9  |-  ( ( K ^ 2 )  -  K )  =  ( K  x.  ( K  -  1 ) )
2524oveq1i 5991 . . . . . . . 8  |-  ( ( ( K ^ 2 )  -  K )  /  2 )  =  ( ( K  x.  ( K  -  1
) )  /  2
)
2617, 22subcli 9269 . . . . . . . . . 10  |-  ( K  -  1 )  e.  CC
27 2cn 9963 . . . . . . . . . 10  |-  2  e.  CC
28 2ne0 9976 . . . . . . . . . 10  |-  2  =/=  0
2917, 26, 27, 28divassi 9663 . . . . . . . . 9  |-  ( ( K  x.  ( K  -  1 ) )  /  2 )  =  ( K  x.  (
( K  -  1 )  /  2 ) )
30 1nn0 10130 . . . . . . . . . 10  |-  1  e.  NN0
31 2p1e3 9996 . . . . . . . . . . . . . . . 16  |-  ( 2  +  1 )  =  3
32 eqid 2366 . . . . . . . . . . . . . . . 16  |- ; 2 2  = ; 2 2
332, 2, 31, 32decsuc 10298 . . . . . . . . . . . . . . 15  |-  (; 2 2  +  1 )  = ; 2 3
341, 33eqtr4i 2389 . . . . . . . . . . . . . 14  |-  K  =  (; 2 2  +  1 )
3534oveq1i 5991 . . . . . . . . . . . . 13  |-  ( K  -  1 )  =  ( (; 2 2  +  1 )  -  1 )
362, 2deccl 10289 . . . . . . . . . . . . . . 15  |- ; 2 2  e.  NN0
3736nn0cni 10126 . . . . . . . . . . . . . 14  |- ; 2 2  e.  CC
38 pncan 9204 . . . . . . . . . . . . . 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 2386 . . . . . . . . . . . 12  |-  ( K  -  1 )  = ; 2
2
4140oveq1i 5991 . . . . . . . . . . 11  |-  ( ( K  -  1 )  /  2 )  =  (; 2 2  /  2
)
42 eqid 2366 . . . . . . . . . . . . 13  |- ; 1 1  = ; 1 1
43 0nn0 10129 . . . . . . . . . . . . 13  |-  0  e.  NN0
4427mulid1i 8986 . . . . . . . . . . . . . . 15  |-  ( 2  x.  1 )  =  2
4544oveq1i 5991 . . . . . . . . . . . . . 14  |-  ( ( 2  x.  1 )  +  0 )  =  ( 2  +  0 )
4627addid1i 9146 . . . . . . . . . . . . . 14  |-  ( 2  +  0 )  =  2
4745, 46eqtri 2386 . . . . . . . . . . . . 13  |-  ( ( 2  x.  1 )  +  0 )  =  2
482dec0h 10291 . . . . . . . . . . . . . 14  |-  2  = ; 0 2
4944, 48eqtri 2386 . . . . . . . . . . . . 13  |-  ( 2  x.  1 )  = ; 0
2
502, 30, 30, 42, 2, 43, 47, 49decmul2c 10323 . . . . . . . . . . . 12  |-  ( 2  x. ; 1 1 )  = ; 2
2
5130, 30deccl 10289 . . . . . . . . . . . . . 14  |- ; 1 1  e.  NN0
5251nn0cni 10126 . . . . . . . . . . . . 13  |- ; 1 1  e.  CC
5337, 27, 52, 28divmuli 9661 . . . . . . . . . . . 12  |-  ( (; 2
2  /  2 )  = ; 1 1  <->  ( 2  x. ; 1 1 )  = ; 2
2 )
5450, 53mpbir 200 . . . . . . . . . . 11  |-  (; 2 2  /  2
)  = ; 1 1
5541, 54eqtri 2386 . . . . . . . . . 10  |-  ( ( K  -  1 )  /  2 )  = ; 1
1
5619, 1eqtri 2386 . . . . . . . . . . 11  |-  ( K  x.  1 )  = ; 2
3
57 3p2e5 10004 . . . . . . . . . . 11  |-  ( 3  +  2 )  =  5
582, 3, 2, 56, 57decaddi 10319 . . . . . . . . . 10  |-  ( ( K  x.  1 )  +  2 )  = ; 2
5
595, 30, 30, 55, 3, 2, 58, 56decmul2c 10323 . . . . . . . . 9  |-  ( K  x.  ( ( K  -  1 )  / 
2 ) )  = ;; 2 5 3
6029, 59eqtri 2386 . . . . . . . 8  |-  ( ( K  x.  ( K  -  1 ) )  /  2 )  = ;; 2 5 3
6125, 60eqtri 2386 . . . . . . 7  |-  ( ( ( K ^ 2 )  -  K )  /  2 )  = ;; 2 5 3
6261, 6oveq12i 5993 . . . . . 6  |-  ( ( ( ( K ^
2 )  -  K
)  /  2 )  /  N )  =  (;; 2 5 3  / ;; 3 6 5 )
6316, 62breqtrri 4150 . . . . 5  |-  ( log `  2 )  < 
( ( ( ( K ^ 2 )  -  K )  / 
2 )  /  N
)
64 2rp 10510 . . . . . . 7  |-  2  e.  RR+
65 relogcl 20151 . . . . . . 7  |-  ( 2  e.  RR+  ->  ( log `  2 )  e.  RR )
6664, 65ax-mp 8 . . . . . 6  |-  ( log `  2 )  e.  RR
67 5nn0 10134 . . . . . . . . . . 11  |-  5  e.  NN0
682, 67deccl 10289 . . . . . . . . . 10  |- ; 2 5  e.  NN0
6968, 3deccl 10289 . . . . . . . . 9  |- ;; 2 5 3  e.  NN0
7061, 69eqeltri 2436 . . . . . . . 8  |-  ( ( ( K ^ 2 )  -  K )  /  2 )  e. 
NN0
7170nn0rei 10125 . . . . . . 7  |-  ( ( ( K ^ 2 )  -  K )  /  2 )  e.  RR
72 nndivre 9928 . . . . . . 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 9464 . . . . 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 9255 . . . . 5  |-  -u (
( ( ( K ^ 2 )  -  K )  /  2
)  /  N )  e.  RR
7766renegcli 9255 . . . . 5  |-  -u ( log `  2 )  e.  RR
78 eflt 12605 . . . . 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 8996 . . . . 5  |-  ( log `  2 )  e.  CC
82 efneg 12586 . . . . 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 20153 . . . . . 6  |-  ( 2  e.  RR+  ->  ( exp `  ( log `  2
) )  =  2 )
8564, 84ax-mp 8 . . . . 5  |-  ( exp `  ( log `  2
) )  =  2
8685oveq2i 5992 . . . 4  |-  ( 1  /  ( exp `  ( log `  2 ) ) )  =  ( 1  /  2 )
8783, 86eqtri 2386 . . 3  |-  ( exp `  -u ( log `  2
) )  =  ( 1  /  2 )
8880, 87breqtri 4148 . 2  |-  ( exp `  -u ( ( ( ( K ^ 2 )  -  K )  /  2 )  /  N ) )  < 
( 1  /  2
)
8912, 13birthdaylem1 20468 . . . . . . . 8  |-  ( T 
C_  S  /\  S  e.  Fin  /\  ( N  e.  NN  ->  S  =/=  (/) ) )
9089simp2i 966 . . . . . . 7  |-  S  e. 
Fin
9189simp1i 965 . . . . . . 7  |-  T  C_  S
92 ssfi 7226 . . . . . . 7  |-  ( ( S  e.  Fin  /\  T  C_  S )  ->  T  e.  Fin )
9390, 91, 92mp2an 653 . . . . . 6  |-  T  e. 
Fin
94 hashcl 11526 . . . . . 6  |-  ( T  e.  Fin  ->  ( # `
 T )  e. 
NN0 )
9593, 94ax-mp 8 . . . . 5  |-  ( # `  T )  e.  NN0
9695nn0rei 10125 . . . 4  |-  ( # `  T )  e.  RR
9789simp3i 967 . . . . . 6  |-  ( N  e.  NN  ->  S  =/=  (/) )
9811, 97ax-mp 8 . . . . 5  |-  S  =/=  (/)
99 hashnncl 11532 . . . . . 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 9928 . . . 4  |-  ( ( ( # `  T
)  e.  RR  /\  ( # `  S )  e.  NN )  -> 
( ( # `  T
)  /  ( # `  S ) )  e.  RR )
10396, 101, 102mp2an 653 . . 3  |-  ( (
# `  T )  /  ( # `  S
) )  e.  RR
104 reefcl 12576 . . . 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 8984 . . . 4  |-  1  e.  RR
107 rehalfcl 10087 . . . 4  |-  ( 1  e.  RR  ->  (
1  /  2 )  e.  RR )
108106, 107ax-mp 8 . . 3  |-  ( 1  /  2 )  e.  RR
109103, 105, 108lelttri 9093 . 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 1647    e. wcel 1715   {cab 2352    =/= wne 2529    C_ wss 3238   (/)c0 3543   class class class wbr 4125   -->wf 5354   -1-1->wf1 5355   ` cfv 5358  (class class class)co 5981   Fincfn 7006   CCcc 8882   RRcr 8883   0cc0 8884   1c1 8885    + caddc 8887    x. cmul 8889    < clt 9014    <_ cle 9015    - cmin 9184   -ucneg 9185    / cdiv 9570   NNcn 9893   2c2 9942   3c3 9943   5c5 9945   6c6 9946   NN0cn0 10114  ;cdc 10275   RR+crp 10505   ...cfz 10935   ^cexp 11269   #chash 11505   expce 12551   logclog 20130
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1551  ax-5 1562  ax-17 1621  ax-9 1659  ax-8 1680  ax-13 1717  ax-14 1719  ax-6 1734  ax-7 1739  ax-11 1751  ax-12 1937  ax-ext 2347  ax-rep 4233  ax-sep 4243  ax-nul 4251  ax-pow 4290  ax-pr 4316  ax-un 4615  ax-inf2 7489  ax-cnex 8940  ax-resscn 8941  ax-1cn 8942  ax-icn 8943  ax-addcl 8944  ax-addrcl 8945  ax-mulcl 8946  ax-mulrcl 8947  ax-mulcom 8948  ax-addass 8949  ax-mulass 8950  ax-distr 8951  ax-i2m1 8952  ax-1ne0 8953  ax-1rid 8954  ax-rnegex 8955  ax-rrecex 8956  ax-cnre 8957  ax-pre-lttri 8958  ax-pre-lttrn 8959  ax-pre-ltadd 8960  ax-pre-mulgt0 8961  ax-pre-sup 8962  ax-addf 8963  ax-mulf 8964
This theorem depends on definitions:  df-bi 177  df-or 359  df-an 360  df-3or 936  df-3an 937  df-tru 1324  df-ex 1547  df-nf 1550  df-sb 1654  df-eu 2221  df-mo 2222  df-clab 2353  df-cleq 2359  df-clel 2362  df-nfc 2491  df-ne 2531  df-nel 2532  df-ral 2633  df-rex 2634  df-reu 2635  df-rmo 2636  df-rab 2637  df-v 2875  df-sbc 3078  df-csb 3168  df-dif 3241  df-un 3243  df-in 3245  df-ss 3252  df-pss 3254  df-nul 3544  df-if 3655  df-pw 3716  df-sn 3735  df-pr 3736  df-tp 3737  df-op 3738  df-uni 3930  df-int 3965  df-iun 4009  df-iin 4010  df-br 4126  df-opab 4180  df-mpt 4181  df-tr 4216  df-eprel 4408  df-id 4412  df-po 4417  df-so 4418  df-fr 4455  df-se 4456  df-we 4457  df-ord 4498  df-on 4499  df-lim 4500  df-suc 4501  df-om 4760  df-xp 4798  df-rel 4799  df-cnv 4800  df-co 4801  df-dm 4802  df-rn 4803  df-res 4804  df-ima 4805  df-iota 5322  df-fun 5360  df-fn 5361  df-f 5362  df-f1 5363  df-fo 5364  df-f1o 5365  df-fv 5366  df-isom 5367  df-ov 5984  df-oprab 5985  df-mpt2 5986  df-of 6205  df-1st 6249  df-2nd 6250  df-riota 6446  df-recs 6530  df-rdg 6565  df-1o 6621  df-2o 6622  df-oadd 6625  df-er 6802  df-map 6917  df-pm 6918  df-ixp 6961  df-en 7007  df-dom 7008  df-sdom 7009  df-fin 7010  df-fi 7312  df-sup 7341  df-oi 7372  df-card 7719  df-cda 7941  df-pnf 9016  df-mnf 9017  df-xr 9018  df-ltxr 9019  df-le 9020  df-sub 9186  df-neg 9187  df-div 9571  df-nn 9894  df-2 9951  df-3 9952  df-4 9953  df-5 9954  df-6 9955  df-7 9956  df-8 9957  df-9 9958  df-10 9959  df-n0 10115  df-z 10176  df-dec 10276  df-uz 10382  df-q 10468  df-rp 10506  df-xneg 10603  df-xadd 10604  df-xmul 10605  df-ioo 10813  df-ioc 10814  df-ico 10815  df-icc 10816  df-fz 10936  df-fzo 11026  df-fl 11089  df-mod 11138  df-seq 11211  df-exp 11270  df-fac 11454  df-bc 11481  df-hash 11506  df-shft 11769  df-cj 11791  df-re 11792  df-im 11793  df-sqr 11927  df-abs 11928  df-limsup 12152  df-clim 12169  df-rlim 12170  df-sum 12367  df-ef 12557  df-sin 12559  df-cos 12560  df-tan 12561  df-pi 12562  df-dvds 12740  df-struct 13358  df-ndx 13359  df-slot 13360  df-base 13361  df-sets 13362  df-ress 13363  df-plusg 13429  df-mulr 13430  df-starv 13431  df-sca 13432  df-vsca 13433  df-tset 13435  df-ple 13436  df-ds 13438  df-unif 13439  df-hom 13440  df-cco 13441  df-rest 13537  df-topn 13538  df-topgen 13554  df-pt 13555  df-prds 13558  df-xrs 13613  df-0g 13614  df-gsum 13615  df-qtop 13620  df-imas 13621  df-xps 13623  df-mre 13698  df-mrc 13699  df-acs 13701  df-mnd 14577  df-submnd 14626  df-mulg 14702  df-cntz 15003  df-cmn 15301  df-xmet 16586  df-met 16587  df-bl 16588  df-mopn 16589  df-fbas 16590  df-fg 16591  df-cnfld 16594  df-top 16853  df-bases 16855  df-topon 16856  df-topsp 16857  df-cld 16973  df-ntr 16974  df-cls 16975  df-nei 17052  df-lp 17085  df-perf 17086  df-cn 17174  df-cnp 17175  df-haus 17260  df-cmp 17331  df-tx 17474  df-hmeo 17663  df-fil 17754  df-fm 17846  df-flim 17847  df-flf 17848  df-xms 18098  df-ms 18099  df-tms 18100  df-cncf 18596  df-limc 19431  df-dv 19432  df-ulm 19971  df-log 20132  df-atan 20385
  Copyright terms: Public domain W3C validator