bracket combinations
function BracketCombinations(num) {
return (1 / (num + 1)) * choose(2 * num, num);
}
function fact(num) {
let sum = 1;
for (let i = 1; i <= num; i++) {
sum *= i;
}
return sum;
}
function choose(num, k) {
return fact(num) / 2 * (fact(k) * 1 / fact(num - k));
}