Fixed Bernoulli calculations for NB notebook