Post Reply 
(32S, 32SII) Birthday paradox, hash collision probability
05-05-2020, 01:46 PM
Post: #11
RE: (32S, 32SII) Birthday paradox, hash collision probability
(05-03-2020 01:00 PM)Albert Chan Wrote:  
Code:
m = require 'mathx'
function ln_nr(n,s) return 0.5*s* m.log1p((s-1)*(s-2-6*n)/(6*n*n)) end
function P_collision(n,s) return -m.expm1(ln_nr(n,s)) end

Fantastic, Albert!
A 41-compatible routine, input n ENTER s:
Code:
>LBL "PCOL"
 50
 %
 DSE ST Y
 X<> ST Z    
 STO/ ST Y    
 3
 x
 STO/ ST Y
 +/-
 R^
 +
 1
 -
 x
 LN1+X
 x
 E^X-1
 +/-
 END

Cheers, Werner

41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE,DM15L,12C,16CE
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (32S, 32SII) Birthday paradox, hash collision probability - Werner - 05-05-2020 01:46 PM



User(s) browsing this thread: 1 Guest(s)