Public
Edited
Apr 18, 2023
Paused
Insert cell
Insert cell
Insert cell
numberOfBridgeDeals = permut(52,13)*permut(39,13)*permut(26,13)
Insert cell
function probabilityOfABirthdayMatch(n,days) {
// https://en.wikipedia.org/wiki/Birthday_attack#Mathematics
return 1 - Math.exp(-n*(n-1)/2/days)
}
Insert cell
1/probabilityOfABirthdayMatch(1e12,numberOfBridgeDeals)
Insert cell
Insert cell
Insert cell
Insert cell
function permut(n,m) {
if (m == 0) return 1;
if (m == 1) return n;
if (m > n/2) return permut(n,n-m);
return Math.round(n/m*permut(n-1,m-1));
}
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more