code: function probability_mass(x, trials, probability) {
              return factorial(trials) /
                  (factorial(x) * factorial(trials - x)) *
                  (Math.pow(probability, x) * Math.pow(1 - probability, trials - x));
          }
docs: a [probability mass function](https://en.wikipedia.org/wiki/Probability_mass_function)