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

Theorem birthday 20244
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 9977 . . . . 5  |-  2  e.  NN0
3 3nn0 9978 . . . . 5  |-  3  e.  NN0
42, 3deccl 10133 . . . 4  |- ; 2 3  e.  NN0
51, 4eqeltri 2353 . . 3  |-  K  e. 
NN0
6 birthday.n . . . 4  |-  N  = ;; 3 6 5
7 6nn0 9981 . . . . . 6  |-  6  e.  NN0
83, 7deccl 10133 . . . . 5  |- ; 3 6  e.  NN0
9 5nn 9875 . . . . 5  |-  5  e.  NN
108, 9decnncl 10132 . . . 4  |- ;; 3 6 5  e.  NN
116, 10eqeltri 2353 . . 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 20243 . . 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 20240 . . . . . 6  |-  ( log `  2 )  < 
(;; 2 5 3  / ;; 3 6 5 )
175nn0cni 9972 . . . . . . . . . . . 12  |-  K  e.  CC
1817sqvali 11178 . . . . . . . . . . 11  |-  ( K ^ 2 )  =  ( K  x.  K
)
1917mulid1i 8834 . . . . . . . . . . . 12  |-  ( K  x.  1 )  =  K
2019eqcomi 2287 . . . . . . . . . . 11  |-  K  =  ( K  x.  1 )
2118, 20oveq12i 5831 . . . . . . . . . 10  |-  ( ( K ^ 2 )  -  K )  =  ( ( K  x.  K )  -  ( K  x.  1 ) )
22 ax-1cn 8790 . . . . . . . . . . 11  |-  1  e.  CC
2317, 17, 22subdii 9223 . . . . . . . . . 10  |-  ( K  x.  ( K  - 
1 ) )  =  ( ( K  x.  K )  -  ( K  x.  1 ) )
2421, 23eqtr4i 2306 . . . . . . . . 9  |-  ( ( K ^ 2 )  -  K )  =  ( K  x.  ( K  -  1 ) )
2524oveq1i 5829 . . . . . . . 8  |-  ( ( ( K ^ 2 )  -  K )  /  2 )  =  ( ( K  x.  ( K  -  1
) )  /  2
)
2617, 22subcli 9117 . . . . . . . . . 10  |-  ( K  -  1 )  e.  CC
27 2cn 9811 . . . . . . . . . 10  |-  2  e.  CC
28 2ne0 9824 . . . . . . . . . 10  |-  2  =/=  0
2917, 26, 27, 28divassi 9511 . . . . . . . . 9  |-  ( ( K  x.  ( K  -  1 ) )  /  2 )  =  ( K  x.  (
( K  -  1 )  /  2 ) )
30 1nn0 9976 . . . . . . . . . 10  |-  1  e.  NN0
31 2p1e3 9842 . . . . . . . . . . . . . . . 16  |-  ( 2  +  1 )  =  3
32 eqid 2283 . . . . . . . . . . . . . . . 16  |- ; 2 2  = ; 2 2
332, 2, 31, 32decsuc 10142 . . . . . . . . . . . . . . 15  |-  (; 2 2  +  1 )  = ; 2 3
341, 33eqtr4i 2306 . . . . . . . . . . . . . 14  |-  K  =  (; 2 2  +  1 )
3534oveq1i 5829 . . . . . . . . . . . . 13  |-  ( K  -  1 )  =  ( (; 2 2  +  1 )  -  1 )
362, 2deccl 10133 . . . . . . . . . . . . . . 15  |- ; 2 2  e.  NN0
3736nn0cni 9972 . . . . . . . . . . . . . 14  |- ; 2 2  e.  CC
38 pncan 9052 . . . . . . . . . . . . . 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 2303 . . . . . . . . . . . 12  |-  ( K  -  1 )  = ; 2
2
4140oveq1i 5829 . . . . . . . . . . 11  |-  ( ( K  -  1 )  /  2 )  =  (; 2 2  /  2
)
42 eqid 2283 . . . . . . . . . . . . 13  |- ; 1 1  = ; 1 1
43 0nn0 9975 . . . . . . . . . . . . 13  |-  0  e.  NN0
4427mulid1i 8834 . . . . . . . . . . . . . . 15  |-  ( 2  x.  1 )  =  2
4544oveq1i 5829 . . . . . . . . . . . . . 14  |-  ( ( 2  x.  1 )  +  0 )  =  ( 2  +  0 )
4627addid1i 8994 . . . . . . . . . . . . . 14  |-  ( 2  +  0 )  =  2
4745, 46eqtri 2303 . . . . . . . . . . . . 13  |-  ( ( 2  x.  1 )  +  0 )  =  2
482dec0h 10135 . . . . . . . . . . . . . 14  |-  2  = ; 0 2
4944, 48eqtri 2303 . . . . . . . . . . . . 13  |-  ( 2  x.  1 )  = ; 0
2
502, 30, 30, 42, 2, 43, 47, 49decmul2c 10167 . . . . . . . . . . . 12  |-  ( 2  x. ; 1 1 )  = ; 2
2
5130, 30deccl 10133 . . . . . . . . . . . . . 14  |- ; 1 1  e.  NN0
5251nn0cni 9972 . . . . . . . . . . . . 13  |- ; 1 1  e.  CC
5337, 27, 52, 28divmuli 9509 . . . . . . . . . . . 12  |-  ( (; 2
2  /  2 )  = ; 1 1  <->  ( 2  x. ; 1 1 )  = ; 2
2 )
5450, 53mpbir 200 . . . . . . . . . . 11  |-  (; 2 2  /  2
)  = ; 1 1
5541, 54eqtri 2303 . . . . . . . . . 10  |-  ( ( K  -  1 )  /  2 )  = ; 1
1
5619, 1eqtri 2303 . . . . . . . . . . 11  |-  ( K  x.  1 )  = ; 2
3
57 3p2e5 9850 . . . . . . . . . . 11  |-  ( 3  +  2 )  =  5
582, 3, 2, 56, 57decaddi 10163 . . . . . . . . . 10  |-  ( ( K  x.  1 )  +  2 )  = ; 2
5
595, 30, 30, 55, 3, 2, 58, 56decmul2c 10167 . . . . . . . . 9  |-  ( K  x.  ( ( K  -  1 )  / 
2 ) )  = ;; 2 5 3
6029, 59eqtri 2303 . . . . . . . 8  |-  ( ( K  x.  ( K  -  1 ) )  /  2 )  = ;; 2 5 3
6125, 60eqtri 2303 . . . . . . 7  |-  ( ( ( K ^ 2 )  -  K )  /  2 )  = ;; 2 5 3
6261, 6oveq12i 5831 . . . . . 6  |-  ( ( ( ( K ^
2 )  -  K
)  /  2 )  /  N )  =  (;; 2 5 3  / ;; 3 6 5 )
6316, 62breqtrri 4048 . . . . 5  |-  ( log `  2 )  < 
( ( ( ( K ^ 2 )  -  K )  / 
2 )  /  N
)
64 2rp 10354 . . . . . . 7  |-  2  e.  RR+
65 relogcl 19927 . . . . . . 7  |-  ( 2  e.  RR+  ->  ( log `  2 )  e.  RR )
6664, 65ax-mp 8 . . . . . 6  |-  ( log `  2 )  e.  RR
67 5nn0 9980 . . . . . . . . . . 11  |-  5  e.  NN0
682, 67deccl 10133 . . . . . . . . . 10  |- ; 2 5  e.  NN0
6968, 3deccl 10133 . . . . . . . . 9  |- ;; 2 5 3  e.  NN0
7061, 69eqeltri 2353 . . . . . . . 8  |-  ( ( ( K ^ 2 )  -  K )  /  2 )  e. 
NN0
7170nn0rei 9971 . . . . . . 7  |-  ( ( ( K ^ 2 )  -  K )  /  2 )  e.  RR
72 nndivre 9776 . . . . . . 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 9312 . . . . 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 9103 . . . . 5  |-  -u (
( ( ( K ^ 2 )  -  K )  /  2
)  /  N )  e.  RR
7766renegcli 9103 . . . . 5  |-  -u ( log `  2 )  e.  RR
78 eflt 12392 . . . . 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 8844 . . . . 5  |-  ( log `  2 )  e.  CC
82 efneg 12373 . . . . 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 19929 . . . . . 6  |-  ( 2  e.  RR+  ->  ( exp `  ( log `  2
) )  =  2 )
8564, 84ax-mp 8 . . . . 5  |-  ( exp `  ( log `  2
) )  =  2
8685oveq2i 5830 . . . 4  |-  ( 1  /  ( exp `  ( log `  2 ) ) )  =  ( 1  /  2 )
8783, 86eqtri 2303 . . 3  |-  ( exp `  -u ( log `  2
) )  =  ( 1  /  2 )
8880, 87breqtri 4046 . 2  |-  ( exp `  -u ( ( ( ( K ^ 2 )  -  K )  /  2 )  /  N ) )  < 
( 1  /  2
)
8912, 13birthdaylem1 20241 . . . . . . . 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 7078 . . . . . . 7  |-  ( ( S  e.  Fin  /\  T  C_  S )  ->  T  e.  Fin )
9390, 91, 92mp2an 653 . . . . . 6  |-  T  e. 
Fin
94 hashcl 11345 . . . . . 6  |-  ( T  e.  Fin  ->  ( # `
 T )  e. 
NN0 )
9593, 94ax-mp 8 . . . . 5  |-  ( # `  T )  e.  NN0
9695nn0rei 9971 . . . 4  |-  ( # `  T )  e.  RR
9789simp3i 966 . . . . . 6  |-  ( N  e.  NN  ->  S  =/=  (/) )
9811, 97ax-mp 8 . . . . 5  |-  S  =/=  (/)
99 hashnncl 11349 . . . . . 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 9776 . . . 4  |-  ( ( ( # `  T
)  e.  RR  /\  ( # `  S )  e.  NN )  -> 
( ( # `  T
)  /  ( # `  S ) )  e.  RR )
10396, 101, 102mp2an 653 . . 3  |-  ( (
# `  T )  /  ( # `  S
) )  e.  RR
104 reefcl 12363 . . . 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 8832 . . . 4  |-  1  e.  RR
107 rehalfcl 9933 . . . 4  |-  ( 1  e.  RR  ->  (
1  /  2 )  e.  RR )
108106, 107ax-mp 8 . . 3  |-  ( 1  /  2 )  e.  RR
109103, 105, 108lelttri 8941 . 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 1623    e. wcel 1684   {cab 2269    =/= wne 2446    C_ wss 3152   (/)c0 3455   class class class wbr 4023   -->wf 5216   -1-1->wf1 5217   ` cfv 5220  (class class class)co 5819   Fincfn 6858   CCcc 8730   RRcr 8731   0cc0 8732   1c1 8733    + caddc 8735    x. cmul 8737    < clt 8862    <_ cle 8863    - cmin 9032   -ucneg 9033    / cdiv 9418   NNcn 9741   2c2 9790   3c3 9791   5c5 9793   6c6 9794   NN0cn0 9960  ;cdc 10119   RR+crp 10349   ...cfz 10777   ^cexp 11099   #chash 11332   expce 12338   logclog 19907
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1533  ax-5 1544  ax-17 1603  ax-9 1635  ax-8 1643  ax-13 1686  ax-14 1688  ax-6 1703  ax-7 1708  ax-11 1715  ax-12 1866  ax-ext 2264  ax-rep 4131  ax-sep 4141  ax-nul 4149  ax-pow 4186  ax-pr 4212  ax-un 4510  ax-inf2 7337  ax-cnex 8788  ax-resscn 8789  ax-1cn 8790  ax-icn 8791  ax-addcl 8792  ax-addrcl 8793  ax-mulcl 8794  ax-mulrcl 8795  ax-mulcom 8796  ax-addass 8797  ax-mulass 8798  ax-distr 8799  ax-i2m1 8800  ax-1ne0 8801  ax-1rid 8802  ax-rnegex 8803  ax-rrecex 8804  ax-cnre 8805  ax-pre-lttri 8806  ax-pre-lttrn 8807  ax-pre-ltadd 8808  ax-pre-mulgt0 8809  ax-pre-sup 8810  ax-addf 8811  ax-mulf 8812
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 1529  df-nf 1532  df-sb 1630  df-eu 2147  df-mo 2148  df-clab 2270  df-cleq 2276  df-clel 2279  df-nfc 2408  df-ne 2448  df-nel 2449  df-ral 2548  df-rex 2549  df-reu 2550  df-rmo 2551  df-rab 2552  df-v 2790  df-sbc 2992  df-csb 3082  df-dif 3155  df-un 3157  df-in 3159  df-ss 3166  df-pss 3168  df-nul 3456  df-if 3566  df-pw 3627  df-sn 3646  df-pr 3647  df-tp 3648  df-op 3649  df-uni 3828  df-int 3863  df-iun 3907  df-iin 3908  df-br 4024  df-opab 4078  df-mpt 4079  df-tr 4114  df-eprel 4303  df-id 4307  df-po 4312  df-so 4313  df-fr 4350  df-se 4351  df-we 4352  df-ord 4393  df-on 4394  df-lim 4395  df-suc 4396  df-om 4655  df-xp 4693  df-rel 4694  df-cnv 4695  df-co 4696  df-dm 4697  df-rn 4698  df-res 4699  df-ima 4700  df-fun 5222  df-fn 5223  df-f 5224  df-f1 5225  df-fo 5226  df-f1o 5227  df-fv 5228  df-isom 5229  df-ov 5822  df-oprab 5823  df-mpt2 5824  df-of 6039  df-1st 6083  df-2nd 6084  df-iota 6252  df-riota 6299  df-recs 6383  df-rdg 6418  df-1o 6474  df-2o 6475  df-oadd 6478  df-er 6655  df-map 6769  df-pm 6770  df-ixp 6813  df-en 6859  df-dom 6860  df-sdom 6861  df-fin 6862  df-fi 7160  df-sup 7189  df-oi 7220  df-card 7567  df-cda 7789  df-pnf 8864  df-mnf 8865  df-xr 8866  df-ltxr 8867  df-le 8868  df-sub 9034  df-neg 9035  df-div 9419  df-nn 9742  df-2 9799  df-3 9800  df-4 9801  df-5 9802  df-6 9803  df-7 9804  df-8 9805  df-9 9806  df-10 9807  df-n0 9961  df-z 10020  df-dec 10120  df-uz 10226  df-q 10312  df-rp 10350  df-xneg 10447  df-xadd 10448  df-xmul 10449  df-ioo 10655  df-ioc 10656  df-ico 10657  df-icc 10658  df-fz 10778  df-fzo 10866  df-fl 10920  df-mod 10969  df-seq 11042  df-exp 11100  df-fac 11284  df-bc 11311  df-hash 11333  df-shft 11557  df-cj 11579  df-re 11580  df-im 11581  df-sqr 11715  df-abs 11716  df-limsup 11940  df-clim 11957  df-rlim 11958  df-sum 12154  df-ef 12344  df-sin 12346  df-cos 12347  df-tan 12348  df-pi 12349  df-dvds 12527  df-struct 13145  df-ndx 13146  df-slot 13147  df-base 13148  df-sets 13149  df-ress 13150  df-plusg 13216  df-mulr 13217  df-starv 13218  df-sca 13219  df-vsca 13220  df-tset 13222  df-ple 13223  df-ds 13225  df-hom 13227  df-cco 13228  df-rest 13322  df-topn 13323  df-topgen 13339  df-pt 13340  df-prds 13343  df-xrs 13398  df-0g 13399  df-gsum 13400  df-qtop 13405  df-imas 13406  df-xps 13408  df-mre 13483  df-mrc 13484  df-acs 13486  df-mnd 14362  df-submnd 14411  df-mulg 14487  df-cntz 14788  df-cmn 15086  df-xmet 16368  df-met 16369  df-bl 16370  df-mopn 16371  df-cnfld 16373  df-top 16631  df-bases 16633  df-topon 16634  df-topsp 16635  df-cld 16751  df-ntr 16752  df-cls 16753  df-nei 16830  df-lp 16863  df-perf 16864  df-cn 16952  df-cnp 16953  df-haus 17038  df-cmp 17109  df-tx 17252  df-hmeo 17441  df-fbas 17515  df-fg 17516  df-fil 17536  df-fm 17628  df-flim 17629  df-flf 17630  df-xms 17880  df-ms 17881  df-tms 17882  df-cncf 18377  df-limc 19211  df-dv 19212  df-ulm 19751  df-log 19909  df-atan 20158
  Copyright terms: Public domain W3C validator