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

Theorem birthday 20212
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 9950 . . . . 5  |-  2  e.  NN0
3 3nn0 9951 . . . . 5  |-  3  e.  NN0
42, 3deccl 10106 . . . 4  |- ; 2 3  e.  NN0
51, 4eqeltri 2328 . . 3  |-  K  e. 
NN0
6 birthday.n . . . 4  |-  N  = ;; 3 6 5
7 6nn0 9954 . . . . . 6  |-  6  e.  NN0
83, 7deccl 10106 . . . . 5  |- ; 3 6  e.  NN0
9 5nn 9848 . . . . 5  |-  5  e.  NN
108, 9decnncl 10105 . . . 4  |- ;; 3 6 5  e.  NN
116, 10eqeltri 2328 . . 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 20211 . . 3  |-  ( ( K  e.  NN0  /\  N  e.  NN )  ->  ( ( # `  T
)  /  ( # `  S ) )  <_ 
( exp `  -u (
( ( ( K ^ 2 )  -  K )  /  2
)  /  N ) ) )
155, 11, 14mp2an 656 . 2  |-  ( (
# `  T )  /  ( # `  S
) )  <_  ( exp `  -u ( ( ( ( K ^ 2 )  -  K )  /  2 )  /  N ) )
16 log2ub 20208 . . . . . 6  |-  ( log `  2 )  < 
(;; 2 5 3  / ;; 3 6 5 )
175nn0cni 9945 . . . . . . . . . . . 12  |-  K  e.  CC
1817sqvali 11150 . . . . . . . . . . 11  |-  ( K ^ 2 )  =  ( K  x.  K
)
1917mulid1i 8807 . . . . . . . . . . . 12  |-  ( K  x.  1 )  =  K
2019eqcomi 2262 . . . . . . . . . . 11  |-  K  =  ( K  x.  1 )
2118, 20oveq12i 5804 . . . . . . . . . 10  |-  ( ( K ^ 2 )  -  K )  =  ( ( K  x.  K )  -  ( K  x.  1 ) )
22 ax-1cn 8763 . . . . . . . . . . 11  |-  1  e.  CC
2317, 17, 22subdii 9196 . . . . . . . . . 10  |-  ( K  x.  ( K  - 
1 ) )  =  ( ( K  x.  K )  -  ( K  x.  1 ) )
2421, 23eqtr4i 2281 . . . . . . . . 9  |-  ( ( K ^ 2 )  -  K )  =  ( K  x.  ( K  -  1 ) )
2524oveq1i 5802 . . . . . . . 8  |-  ( ( ( K ^ 2 )  -  K )  /  2 )  =  ( ( K  x.  ( K  -  1
) )  /  2
)
2617, 22subcli 9090 . . . . . . . . . 10  |-  ( K  -  1 )  e.  CC
27 2cn 9784 . . . . . . . . . 10  |-  2  e.  CC
28 2ne0 9797 . . . . . . . . . 10  |-  2  =/=  0
2917, 26, 27, 28divassi 9484 . . . . . . . . 9  |-  ( ( K  x.  ( K  -  1 ) )  /  2 )  =  ( K  x.  (
( K  -  1 )  /  2 ) )
30 1nn0 9949 . . . . . . . . . 10  |-  1  e.  NN0
31 2p1e3 9815 . . . . . . . . . . . . . . . 16  |-  ( 2  +  1 )  =  3
32 eqid 2258 . . . . . . . . . . . . . . . 16  |- ; 2 2  = ; 2 2
332, 2, 31, 32decsuc 10115 . . . . . . . . . . . . . . 15  |-  (; 2 2  +  1 )  = ; 2 3
341, 33eqtr4i 2281 . . . . . . . . . . . . . 14  |-  K  =  (; 2 2  +  1 )
3534oveq1i 5802 . . . . . . . . . . . . 13  |-  ( K  -  1 )  =  ( (; 2 2  +  1 )  -  1 )
362, 2deccl 10106 . . . . . . . . . . . . . . 15  |- ; 2 2  e.  NN0
3736nn0cni 9945 . . . . . . . . . . . . . 14  |- ; 2 2  e.  CC
38 pncan 9025 . . . . . . . . . . . . . 14  |-  ( (; 2
2  e.  CC  /\  1  e.  CC )  ->  ( (; 2 2  +  1 )  -  1 )  = ; 2 2 )
3937, 22, 38mp2an 656 . . . . . . . . . . . . 13  |-  ( (; 2
2  +  1 )  -  1 )  = ; 2
2
4035, 39eqtri 2278 . . . . . . . . . . . 12  |-  ( K  -  1 )  = ; 2
2
4140oveq1i 5802 . . . . . . . . . . 11  |-  ( ( K  -  1 )  /  2 )  =  (; 2 2  /  2
)
42 eqid 2258 . . . . . . . . . . . . 13  |- ; 1 1  = ; 1 1
43 0nn0 9948 . . . . . . . . . . . . 13  |-  0  e.  NN0
4427mulid1i 8807 . . . . . . . . . . . . . . 15  |-  ( 2  x.  1 )  =  2
4544oveq1i 5802 . . . . . . . . . . . . . 14  |-  ( ( 2  x.  1 )  +  0 )  =  ( 2  +  0 )
4627addid1i 8967 . . . . . . . . . . . . . 14  |-  ( 2  +  0 )  =  2
4745, 46eqtri 2278 . . . . . . . . . . . . 13  |-  ( ( 2  x.  1 )  +  0 )  =  2
482dec0h 10108 . . . . . . . . . . . . . 14  |-  2  = ; 0 2
4944, 48eqtri 2278 . . . . . . . . . . . . 13  |-  ( 2  x.  1 )  = ; 0
2
502, 30, 30, 42, 2, 43, 47, 49decmul2c 10140 . . . . . . . . . . . 12  |-  ( 2  x. ; 1 1 )  = ; 2
2
5130, 30deccl 10106 . . . . . . . . . . . . . 14  |- ; 1 1  e.  NN0
5251nn0cni 9945 . . . . . . . . . . . . 13  |- ; 1 1  e.  CC
5337, 27, 52, 28divmuli 9482 . . . . . . . . . . . 12  |-  ( (; 2
2  /  2 )  = ; 1 1  <->  ( 2  x. ; 1 1 )  = ; 2
2 )
5450, 53mpbir 202 . . . . . . . . . . 11  |-  (; 2 2  /  2
)  = ; 1 1
5541, 54eqtri 2278 . . . . . . . . . 10  |-  ( ( K  -  1 )  /  2 )  = ; 1
1
5619, 1eqtri 2278 . . . . . . . . . . 11  |-  ( K  x.  1 )  = ; 2
3
57 3p2e5 9823 . . . . . . . . . . 11  |-  ( 3  +  2 )  =  5
582, 3, 2, 56, 57decaddi 10136 . . . . . . . . . 10  |-  ( ( K  x.  1 )  +  2 )  = ; 2
5
595, 30, 30, 55, 3, 2, 58, 56decmul2c 10140 . . . . . . . . 9  |-  ( K  x.  ( ( K  -  1 )  / 
2 ) )  = ;; 2 5 3
6029, 59eqtri 2278 . . . . . . . 8  |-  ( ( K  x.  ( K  -  1 ) )  /  2 )  = ;; 2 5 3
6125, 60eqtri 2278 . . . . . . 7  |-  ( ( ( K ^ 2 )  -  K )  /  2 )  = ;; 2 5 3
6261, 6oveq12i 5804 . . . . . 6  |-  ( ( ( ( K ^
2 )  -  K
)  /  2 )  /  N )  =  (;; 2 5 3  / ;; 3 6 5 )
6316, 62breqtrri 4022 . . . . 5  |-  ( log `  2 )  < 
( ( ( ( K ^ 2 )  -  K )  / 
2 )  /  N
)
64 2rp 10327 . . . . . . 7  |-  2  e.  RR+
65 relogcl 19895 . . . . . . 7  |-  ( 2  e.  RR+  ->  ( log `  2 )  e.  RR )
6664, 65ax-mp 10 . . . . . 6  |-  ( log `  2 )  e.  RR
67 5nn0 9953 . . . . . . . . . . 11  |-  5  e.  NN0
682, 67deccl 10106 . . . . . . . . . 10  |- ; 2 5  e.  NN0
6968, 3deccl 10106 . . . . . . . . 9  |- ;; 2 5 3  e.  NN0
7061, 69eqeltri 2328 . . . . . . . 8  |-  ( ( ( K ^ 2 )  -  K )  /  2 )  e. 
NN0
7170nn0rei 9944 . . . . . . 7  |-  ( ( ( K ^ 2 )  -  K )  /  2 )  e.  RR
72 nndivre 9749 . . . . . . 7  |-  ( ( ( ( ( K ^ 2 )  -  K )  /  2
)  e.  RR  /\  N  e.  NN )  ->  ( ( ( ( K ^ 2 )  -  K )  / 
2 )  /  N
)  e.  RR )
7371, 11, 72mp2an 656 . . . . . 6  |-  ( ( ( ( K ^
2 )  -  K
)  /  2 )  /  N )  e.  RR
7466, 73ltnegi 9285 . . . . 5  |-  ( ( log `  2 )  <  ( ( ( ( K ^ 2 )  -  K )  /  2 )  /  N )  <->  -u ( ( ( ( K ^
2 )  -  K
)  /  2 )  /  N )  <  -u ( log `  2
) )
7563, 74mpbi 201 . . . 4  |-  -u (
( ( ( K ^ 2 )  -  K )  /  2
)  /  N )  <  -u ( log `  2
)
7673renegcli 9076 . . . . 5  |-  -u (
( ( ( K ^ 2 )  -  K )  /  2
)  /  N )  e.  RR
7766renegcli 9076 . . . . 5  |-  -u ( log `  2 )  e.  RR
78 eflt 12360 . . . . 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 656 . . . 4  |-  ( -u ( ( ( ( K ^ 2 )  -  K )  / 
2 )  /  N
)  <  -u ( log `  2 )  <->  ( exp `  -u ( ( ( ( K ^ 2 )  -  K )  / 
2 )  /  N
) )  <  ( exp `  -u ( log `  2
) ) )
8075, 79mpbi 201 . . 3  |-  ( exp `  -u ( ( ( ( K ^ 2 )  -  K )  /  2 )  /  N ) )  < 
( exp `  -u ( log `  2 ) )
8166recni 8817 . . . . 5  |-  ( log `  2 )  e.  CC
82 efneg 12341 . . . . 5  |-  ( ( log `  2 )  e.  CC  ->  ( exp `  -u ( log `  2
) )  =  ( 1  /  ( exp `  ( log `  2
) ) ) )
8381, 82ax-mp 10 . . . 4  |-  ( exp `  -u ( log `  2
) )  =  ( 1  /  ( exp `  ( log `  2
) ) )
84 reeflog 19897 . . . . . 6  |-  ( 2  e.  RR+  ->  ( exp `  ( log `  2
) )  =  2 )
8564, 84ax-mp 10 . . . . 5  |-  ( exp `  ( log `  2
) )  =  2
8685oveq2i 5803 . . . 4  |-  ( 1  /  ( exp `  ( log `  2 ) ) )  =  ( 1  /  2 )
8783, 86eqtri 2278 . . 3  |-  ( exp `  -u ( log `  2
) )  =  ( 1  /  2 )
8880, 87breqtri 4020 . 2  |-  ( exp `  -u ( ( ( ( K ^ 2 )  -  K )  /  2 )  /  N ) )  < 
( 1  /  2
)
8912, 13birthdaylem1 20209 . . . . . . . 8  |-  ( T 
C_  S  /\  S  e.  Fin  /\  ( N  e.  NN  ->  S  =/=  (/) ) )
9089simp2i 970 . . . . . . 7  |-  S  e. 
Fin
9189simp1i 969 . . . . . . 7  |-  T  C_  S
92 ssfi 7051 . . . . . . 7  |-  ( ( S  e.  Fin  /\  T  C_  S )  ->  T  e.  Fin )
9390, 91, 92mp2an 656 . . . . . 6  |-  T  e. 
Fin
94 hashcl 11317 . . . . . 6  |-  ( T  e.  Fin  ->  ( # `
 T )  e. 
NN0 )
9593, 94ax-mp 10 . . . . 5  |-  ( # `  T )  e.  NN0
9695nn0rei 9944 . . . 4  |-  ( # `  T )  e.  RR
9789simp3i 971 . . . . . 6  |-  ( N  e.  NN  ->  S  =/=  (/) )
9811, 97ax-mp 10 . . . . 5  |-  S  =/=  (/)
99 hashnncl 11321 . . . . . 6  |-  ( S  e.  Fin  ->  (
( # `  S )  e.  NN  <->  S  =/=  (/) ) )
10090, 99ax-mp 10 . . . . 5  |-  ( (
# `  S )  e.  NN  <->  S  =/=  (/) )
10198, 100mpbir 202 . . . 4  |-  ( # `  S )  e.  NN
102 nndivre 9749 . . . 4  |-  ( ( ( # `  T
)  e.  RR  /\  ( # `  S )  e.  NN )  -> 
( ( # `  T
)  /  ( # `  S ) )  e.  RR )
10396, 101, 102mp2an 656 . . 3  |-  ( (
# `  T )  /  ( # `  S
) )  e.  RR
104 reefcl 12331 . . . 4  |-  ( -u ( ( ( ( K ^ 2 )  -  K )  / 
2 )  /  N
)  e.  RR  ->  ( exp `  -u (
( ( ( K ^ 2 )  -  K )  /  2
)  /  N ) )  e.  RR )
10576, 104ax-mp 10 . . 3  |-  ( exp `  -u ( ( ( ( K ^ 2 )  -  K )  /  2 )  /  N ) )  e.  RR
106 1re 8805 . . . 4  |-  1  e.  RR
107 rehalfcl 9906 . . . 4  |-  ( 1  e.  RR  ->  (
1  /  2 )  e.  RR )
108106, 107ax-mp 10 . . 3  |-  ( 1  /  2 )  e.  RR
109103, 105, 108lelttri 8914 . 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 656 1  |-  ( (
# `  T )  /  ( # `  S
) )  <  (
1  /  2 )
Colors of variables: wff set class
Syntax hints:    -> wi 6    <-> wb 178    = wceq 1619    e. wcel 1621   {cab 2244    =/= wne 2421    C_ wss 3127   (/)c0 3430   class class class wbr 3997   -->wf 4669   -1-1->wf1 4670   ` cfv 4673  (class class class)co 5792   Fincfn 6831   CCcc 8703   RRcr 8704   0cc0 8705   1c1 8706    + caddc 8708    x. cmul 8710    < clt 8835    <_ cle 8836    - cmin 9005   -ucneg 9006    / cdiv 9391   NNcn 9714   2c2 9763   3c3 9764   5c5 9766   6c6 9767   NN0cn0 9933  ;cdc 10092   RR+crp 10322   ...cfz 10749   ^cexp 11071   #chash 11304   expce 12306   logclog 19875
This theorem was proved from axioms:  ax-1 7  ax-2 8  ax-3 9  ax-mp 10  ax-5 1533  ax-6 1534  ax-7 1535  ax-gen 1536  ax-8 1623  ax-11 1624  ax-13 1625  ax-14 1626  ax-17 1628  ax-12o 1664  ax-10 1678  ax-9 1684  ax-4 1692  ax-16 1927  ax-ext 2239  ax-rep 4105  ax-sep 4115  ax-nul 4123  ax-pow 4160  ax-pr 4186  ax-un 4484  ax-inf2 7310  ax-cnex 8761  ax-resscn 8762  ax-1cn 8763  ax-icn 8764  ax-addcl 8765  ax-addrcl 8766  ax-mulcl 8767  ax-mulrcl 8768  ax-mulcom 8769  ax-addass 8770  ax-mulass 8771  ax-distr 8772  ax-i2m1 8773  ax-1ne0 8774  ax-1rid 8775  ax-rnegex 8776  ax-rrecex 8777  ax-cnre 8778  ax-pre-lttri 8779  ax-pre-lttrn 8780  ax-pre-ltadd 8781  ax-pre-mulgt0 8782  ax-pre-sup 8783  ax-addf 8784  ax-mulf 8785
This theorem depends on definitions:  df-bi 179  df-or 361  df-an 362  df-3or 940  df-3an 941  df-tru 1315  df-ex 1538  df-nf 1540  df-sb 1884  df-eu 2122  df-mo 2123  df-clab 2245  df-cleq 2251  df-clel 2254  df-nfc 2383  df-ne 2423  df-nel 2424  df-ral 2523  df-rex 2524  df-reu 2525  df-rmo 2526  df-rab 2527  df-v 2765  df-sbc 2967  df-csb 3057  df-dif 3130  df-un 3132  df-in 3134  df-ss 3141  df-pss 3143  df-nul 3431  df-if 3540  df-pw 3601  df-sn 3620  df-pr 3621  df-tp 3622  df-op 3623  df-uni 3802  df-int 3837  df-iun 3881  df-iin 3882  df-br 3998  df-opab 4052  df-mpt 4053  df-tr 4088  df-eprel 4277  df-id 4281  df-po 4286  df-so 4287  df-fr 4324  df-se 4325  df-we 4326  df-ord 4367  df-on 4368  df-lim 4369  df-suc 4370  df-om 4629  df-xp 4675  df-rel 4676  df-cnv 4677  df-co 4678  df-dm 4679  df-rn 4680  df-res 4681  df-ima 4682  df-fun 4683  df-fn 4684  df-f 4685  df-f1 4686  df-fo 4687  df-f1o 4688  df-fv 4689  df-isom 4690  df-ov 5795  df-oprab 5796  df-mpt2 5797  df-of 6012  df-1st 6056  df-2nd 6057  df-iota 6225  df-riota 6272  df-recs 6356  df-rdg 6391  df-1o 6447  df-2o 6448  df-oadd 6451  df-er 6628  df-map 6742  df-pm 6743  df-ixp 6786  df-en 6832  df-dom 6833  df-sdom 6834  df-fin 6835  df-fi 7133  df-sup 7162  df-oi 7193  df-card 7540  df-cda 7762  df-pnf 8837  df-mnf 8838  df-xr 8839  df-ltxr 8840  df-le 8841  df-sub 9007  df-neg 9008  df-div 9392  df-n 9715  df-2 9772  df-3 9773  df-4 9774  df-5 9775  df-6 9776  df-7 9777  df-8 9778  df-9 9779  df-10 9780  df-n0 9934  df-z 9993  df-dec 10093  df-uz 10199  df-q 10285  df-rp 10323  df-xneg 10420  df-xadd 10421  df-xmul 10422  df-ioo 10627  df-ioc 10628  df-ico 10629  df-icc 10630  df-fz 10750  df-fzo 10838  df-fl 10892  df-mod 10941  df-seq 11014  df-exp 11072  df-fac 11256  df-bc 11283  df-hash 11305  df-shft 11528  df-cj 11550  df-re 11551  df-im 11552  df-sqr 11686  df-abs 11687  df-limsup 11911  df-clim 11928  df-rlim 11929  df-sum 12125  df-ef 12312  df-sin 12314  df-cos 12315  df-tan 12316  df-pi 12317  df-divides 12495  df-struct 13113  df-ndx 13114  df-slot 13115  df-base 13116  df-sets 13117  df-ress 13118  df-plusg 13184  df-mulr 13185  df-starv 13186  df-sca 13187  df-vsca 13188  df-tset 13190  df-ple 13191  df-ds 13193  df-hom 13195  df-cco 13196  df-rest 13290  df-topn 13291  df-topgen 13307  df-pt 13308  df-prds 13311  df-xrs 13366  df-0g 13367  df-gsum 13368  df-qtop 13373  df-imas 13374  df-xps 13376  df-mre 13451  df-mrc 13452  df-acs 13454  df-mnd 14330  df-submnd 14379  df-mulg 14455  df-cntz 14756  df-cmn 15054  df-xmet 16336  df-met 16337  df-bl 16338  df-mopn 16339  df-cnfld 16341  df-top 16599  df-bases 16601  df-topon 16602  df-topsp 16603  df-cld 16719  df-ntr 16720  df-cls 16721  df-nei 16798  df-lp 16831  df-perf 16832  df-cn 16920  df-cnp 16921  df-haus 17006  df-cmp 17077  df-tx 17220  df-hmeo 17409  df-fbas 17483  df-fg 17484  df-fil 17504  df-fm 17596  df-flim 17597  df-flf 17598  df-xms 17848  df-ms 17849  df-tms 17850  df-cncf 18345  df-limc 19179  df-dv 19180  df-ulm 19719  df-log 19877  df-atan 20126
  Copyright terms: Public domain W3C validator