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

Theorem birthday 20249
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 9982 . . . . 5  |-  2  e.  NN0
3 3nn0 9983 . . . . 5  |-  3  e.  NN0
42, 3deccl 10138 . . . 4  |- ; 2 3  e.  NN0
51, 4eqeltri 2353 . . 3  |-  K  e. 
NN0
6 birthday.n . . . 4  |-  N  = ;; 3 6 5
7 6nn0 9986 . . . . . 6  |-  6  e.  NN0
83, 7deccl 10138 . . . . 5  |- ; 3 6  e.  NN0
9 5nn 9880 . . . . 5  |-  5  e.  NN
108, 9decnncl 10137 . . . 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 20248 . . 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 20245 . . . . . 6  |-  ( log `  2 )  < 
(;; 2 5 3  / ;; 3 6 5 )
175nn0cni 9977 . . . . . . . . . . . 12  |-  K  e.  CC
1817sqvali 11183 . . . . . . . . . . 11  |-  ( K ^ 2 )  =  ( K  x.  K
)
1917mulid1i 8839 . . . . . . . . . . . 12  |-  ( K  x.  1 )  =  K
2019eqcomi 2287 . . . . . . . . . . 11  |-  K  =  ( K  x.  1 )
2118, 20oveq12i 5870 . . . . . . . . . 10  |-  ( ( K ^ 2 )  -  K )  =  ( ( K  x.  K )  -  ( K  x.  1 ) )
22 ax-1cn 8795 . . . . . . . . . . 11  |-  1  e.  CC
2317, 17, 22subdii 9228 . . . . . . . . . 10  |-  ( K  x.  ( K  - 
1 ) )  =  ( ( K  x.  K )  -  ( K  x.  1 ) )
2421, 23eqtr4i 2306 . . . . . . . . 9  |-  ( ( K ^ 2 )  -  K )  =  ( K  x.  ( K  -  1 ) )
2524oveq1i 5868 . . . . . . . 8  |-  ( ( ( K ^ 2 )  -  K )  /  2 )  =  ( ( K  x.  ( K  -  1
) )  /  2
)
2617, 22subcli 9122 . . . . . . . . . 10  |-  ( K  -  1 )  e.  CC
27 2cn 9816 . . . . . . . . . 10  |-  2  e.  CC
28 2ne0 9829 . . . . . . . . . 10  |-  2  =/=  0
2917, 26, 27, 28divassi 9516 . . . . . . . . 9  |-  ( ( K  x.  ( K  -  1 ) )  /  2 )  =  ( K  x.  (
( K  -  1 )  /  2 ) )
30 1nn0 9981 . . . . . . . . . 10  |-  1  e.  NN0
31 2p1e3 9847 . . . . . . . . . . . . . . . 16  |-  ( 2  +  1 )  =  3
32 eqid 2283 . . . . . . . . . . . . . . . 16  |- ; 2 2  = ; 2 2
332, 2, 31, 32decsuc 10147 . . . . . . . . . . . . . . 15  |-  (; 2 2  +  1 )  = ; 2 3
341, 33eqtr4i 2306 . . . . . . . . . . . . . 14  |-  K  =  (; 2 2  +  1 )
3534oveq1i 5868 . . . . . . . . . . . . 13  |-  ( K  -  1 )  =  ( (; 2 2  +  1 )  -  1 )
362, 2deccl 10138 . . . . . . . . . . . . . . 15  |- ; 2 2  e.  NN0
3736nn0cni 9977 . . . . . . . . . . . . . 14  |- ; 2 2  e.  CC
38 pncan 9057 . . . . . . . . . . . . . 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 5868 . . . . . . . . . . 11  |-  ( ( K  -  1 )  /  2 )  =  (; 2 2  /  2
)
42 eqid 2283 . . . . . . . . . . . . 13  |- ; 1 1  = ; 1 1
43 0nn0 9980 . . . . . . . . . . . . 13  |-  0  e.  NN0
4427mulid1i 8839 . . . . . . . . . . . . . . 15  |-  ( 2  x.  1 )  =  2
4544oveq1i 5868 . . . . . . . . . . . . . 14  |-  ( ( 2  x.  1 )  +  0 )  =  ( 2  +  0 )
4627addid1i 8999 . . . . . . . . . . . . . 14  |-  ( 2  +  0 )  =  2
4745, 46eqtri 2303 . . . . . . . . . . . . 13  |-  ( ( 2  x.  1 )  +  0 )  =  2
482dec0h 10140 . . . . . . . . . . . . . 14  |-  2  = ; 0 2
4944, 48eqtri 2303 . . . . . . . . . . . . 13  |-  ( 2  x.  1 )  = ; 0
2
502, 30, 30, 42, 2, 43, 47, 49decmul2c 10172 . . . . . . . . . . . 12  |-  ( 2  x. ; 1 1 )  = ; 2
2
5130, 30deccl 10138 . . . . . . . . . . . . . 14  |- ; 1 1  e.  NN0
5251nn0cni 9977 . . . . . . . . . . . . 13  |- ; 1 1  e.  CC
5337, 27, 52, 28divmuli 9514 . . . . . . . . . . . 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 9855 . . . . . . . . . . 11  |-  ( 3  +  2 )  =  5
582, 3, 2, 56, 57decaddi 10168 . . . . . . . . . 10  |-  ( ( K  x.  1 )  +  2 )  = ; 2
5
595, 30, 30, 55, 3, 2, 58, 56decmul2c 10172 . . . . . . . . 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 5870 . . . . . 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 10359 . . . . . . 7  |-  2  e.  RR+
65 relogcl 19932 . . . . . . 7  |-  ( 2  e.  RR+  ->  ( log `  2 )  e.  RR )
6664, 65ax-mp 8 . . . . . 6  |-  ( log `  2 )  e.  RR
67 5nn0 9985 . . . . . . . . . . 11  |-  5  e.  NN0
682, 67deccl 10138 . . . . . . . . . 10  |- ; 2 5  e.  NN0
6968, 3deccl 10138 . . . . . . . . 9  |- ;; 2 5 3  e.  NN0
7061, 69eqeltri 2353 . . . . . . . 8  |-  ( ( ( K ^ 2 )  -  K )  /  2 )  e. 
NN0
7170nn0rei 9976 . . . . . . 7  |-  ( ( ( K ^ 2 )  -  K )  /  2 )  e.  RR
72 nndivre 9781 . . . . . . 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 9317 . . . . 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 9108 . . . . 5  |-  -u (
( ( ( K ^ 2 )  -  K )  /  2
)  /  N )  e.  RR
7766renegcli 9108 . . . . 5  |-  -u ( log `  2 )  e.  RR
78 eflt 12397 . . . . 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 8849 . . . . 5  |-  ( log `  2 )  e.  CC
82 efneg 12378 . . . . 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 19934 . . . . . 6  |-  ( 2  e.  RR+  ->  ( exp `  ( log `  2
) )  =  2 )
8564, 84ax-mp 8 . . . . 5  |-  ( exp `  ( log `  2
) )  =  2
8685oveq2i 5869 . . . 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 20246 . . . . . . . 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 7083 . . . . . . 7  |-  ( ( S  e.  Fin  /\  T  C_  S )  ->  T  e.  Fin )
9390, 91, 92mp2an 653 . . . . . 6  |-  T  e. 
Fin
94 hashcl 11350 . . . . . 6  |-  ( T  e.  Fin  ->  ( # `
 T )  e. 
NN0 )
9593, 94ax-mp 8 . . . . 5  |-  ( # `  T )  e.  NN0
9695nn0rei 9976 . . . 4  |-  ( # `  T )  e.  RR
9789simp3i 966 . . . . . 6  |-  ( N  e.  NN  ->  S  =/=  (/) )
9811, 97ax-mp 8 . . . . 5  |-  S  =/=  (/)
99 hashnncl 11354 . . . . . 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 9781 . . . 4  |-  ( ( ( # `  T
)  e.  RR  /\  ( # `  S )  e.  NN )  -> 
( ( # `  T
)  /  ( # `  S ) )  e.  RR )
10396, 101, 102mp2an 653 . . 3  |-  ( (
# `  T )  /  ( # `  S
) )  e.  RR
104 reefcl 12368 . . . 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 8837 . . . 4  |-  1  e.  RR
107 rehalfcl 9938 . . . 4  |-  ( 1  e.  RR  ->  (
1  /  2 )  e.  RR )
108106, 107ax-mp 8 . . 3  |-  ( 1  /  2 )  e.  RR
109103, 105, 108lelttri 8946 . 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 5251   -1-1->wf1 5252   ` cfv 5255  (class class class)co 5858   Fincfn 6863   CCcc 8735   RRcr 8736   0cc0 8737   1c1 8738    + caddc 8740    x. cmul 8742    < clt 8867    <_ cle 8868    - cmin 9037   -ucneg 9038    / cdiv 9423   NNcn 9746   2c2 9795   3c3 9796   5c5 9798   6c6 9799   NN0cn0 9965  ;cdc 10124   RR+crp 10354   ...cfz 10782   ^cexp 11104   #chash 11337   expce 12343   logclog 19912
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 4188  ax-pr 4214  ax-un 4512  ax-inf2 7342  ax-cnex 8793  ax-resscn 8794  ax-1cn 8795  ax-icn 8796  ax-addcl 8797  ax-addrcl 8798  ax-mulcl 8799  ax-mulrcl 8800  ax-mulcom 8801  ax-addass 8802  ax-mulass 8803  ax-distr 8804  ax-i2m1 8805  ax-1ne0 8806  ax-1rid 8807  ax-rnegex 8808  ax-rrecex 8809  ax-cnre 8810  ax-pre-lttri 8811  ax-pre-lttrn 8812  ax-pre-ltadd 8813  ax-pre-mulgt0 8814  ax-pre-sup 8815  ax-addf 8816  ax-mulf 8817
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 4305  df-id 4309  df-po 4314  df-so 4315  df-fr 4352  df-se 4353  df-we 4354  df-ord 4395  df-on 4396  df-lim 4397  df-suc 4398  df-om 4657  df-xp 4695  df-rel 4696  df-cnv 4697  df-co 4698  df-dm 4699  df-rn 4700  df-res 4701  df-ima 4702  df-iota 5219  df-fun 5257  df-fn 5258  df-f 5259  df-f1 5260  df-fo 5261  df-f1o 5262  df-fv 5263  df-isom 5264  df-ov 5861  df-oprab 5862  df-mpt2 5863  df-of 6078  df-1st 6122  df-2nd 6123  df-riota 6304  df-recs 6388  df-rdg 6423  df-1o 6479  df-2o 6480  df-oadd 6483  df-er 6660  df-map 6774  df-pm 6775  df-ixp 6818  df-en 6864  df-dom 6865  df-sdom 6866  df-fin 6867  df-fi 7165  df-sup 7194  df-oi 7225  df-card 7572  df-cda 7794  df-pnf 8869  df-mnf 8870  df-xr 8871  df-ltxr 8872  df-le 8873  df-sub 9039  df-neg 9040  df-div 9424  df-nn 9747  df-2 9804  df-3 9805  df-4 9806  df-5 9807  df-6 9808  df-7 9809  df-8 9810  df-9 9811  df-10 9812  df-n0 9966  df-z 10025  df-dec 10125  df-uz 10231  df-q 10317  df-rp 10355  df-xneg 10452  df-xadd 10453  df-xmul 10454  df-ioo 10660  df-ioc 10661  df-ico 10662  df-icc 10663  df-fz 10783  df-fzo 10871  df-fl 10925  df-mod 10974  df-seq 11047  df-exp 11105  df-fac 11289  df-bc 11316  df-hash 11338  df-shft 11562  df-cj 11584  df-re 11585  df-im 11586  df-sqr 11720  df-abs 11721  df-limsup 11945  df-clim 11962  df-rlim 11963  df-sum 12159  df-ef 12349  df-sin 12351  df-cos 12352  df-tan 12353  df-pi 12354  df-dvds 12532  df-struct 13150  df-ndx 13151  df-slot 13152  df-base 13153  df-sets 13154  df-ress 13155  df-plusg 13221  df-mulr 13222  df-starv 13223  df-sca 13224  df-vsca 13225  df-tset 13227  df-ple 13228  df-ds 13230  df-hom 13232  df-cco 13233  df-rest 13327  df-topn 13328  df-topgen 13344  df-pt 13345  df-prds 13348  df-xrs 13403  df-0g 13404  df-gsum 13405  df-qtop 13410  df-imas 13411  df-xps 13413  df-mre 13488  df-mrc 13489  df-acs 13491  df-mnd 14367  df-submnd 14416  df-mulg 14492  df-cntz 14793  df-cmn 15091  df-xmet 16373  df-met 16374  df-bl 16375  df-mopn 16376  df-cnfld 16378  df-top 16636  df-bases 16638  df-topon 16639  df-topsp 16640  df-cld 16756  df-ntr 16757  df-cls 16758  df-nei 16835  df-lp 16868  df-perf 16869  df-cn 16957  df-cnp 16958  df-haus 17043  df-cmp 17114  df-tx 17257  df-hmeo 17446  df-fbas 17520  df-fg 17521  df-fil 17541  df-fm 17633  df-flim 17634  df-flf 17635  df-xms 17885  df-ms 17886  df-tms 17887  df-cncf 18382  df-limc 19216  df-dv 19217  df-ulm 19756  df-log 19914  df-atan 20163
  Copyright terms: Public domain W3C validator