Now, if you’re like me, your first thought might be “What the ***** are those?” Well, let me break it down for ya.
Bernoulli polynomials are a series of functions that come up in all sorts of math problems from calculus to number theory. They look like this:
f(x) = x^n + n*x^(n-1)*b_n/2! + (n*(n-1))/2!*x^(n-2)*b_{n-2} + … + b_0
Where the “b”s are called Bernoulli numbers, and they’re pretty cool in their own right. For example:
b_0 = 1 (this is just a constant)
b_1 = -1/2
b_2 = 1/6
b_3 = 0
b_4 = -1/30
… and so on. These numbers have some pretty interesting properties, like being related to the Riemann zeta function (which is a big deal in number theory). But we won’t get into that here. Instead, Stirling numbers.
Stirling numbers are another set of functions that come up all over math from combinatorics to probability theory. They look like this:
S(n,k) = (1/k!)*sum((-1)^(j+i)*(j^i)/i!) for j=0..k
Where the “S”s are called Stirling numbers of the second kind (there’s also a first kind, but we won’t talk about those here). These functions have some pretty cool properties too like being related to partitions and permutations. But again, let’s not get into that here.
So why do these two sets of functions matter? Well, it turns out they’re actually connected! In fact, there’s a formula for converting between them:
S(n+k-1, k) = sum((-1)^i*binomial(n, i)*B_k(i)/i!) for i=0..k
Where the “B”s are called Bernoulli polynomials (which we talked about earlier). This formula is pretty cool because it allows us to use one set of functions to solve problems in another. For example:
If you’re trying to count the number of ways to choose k objects from a set of n, but with repetition allowed, you can use Stirling numbers to do that. But if you want to find the expected value of some function (like the sum of all those chosen objects), you can convert that into a problem involving Bernoulli polynomials instead.
And if you’re still not convinced, just remember: math is cool and we love it.