I just don't see what I do wrong - number of surjections seems higher than number of functions.

710 Views Asked by At

EDIT: Answer added.

I haven't slept much lately and I've been raging on this thing for a couple hours now. I really hope some people here can have the same obsession/rage and will help me out.

I have two sets, A and B. |A| = m, |B| = n. I was looking for the number of surjections from A to B, and I found a formula here: http://www.ma.utexas.edu/users/kbi/COURSES/TERM/11S/325K/L17.pdf

I seem to have understood the following:

You have to calculate the Stirling number of the second kind, and then multiply it with n! due to the fact that Stirling numbers only divide/group (and do not map). I have the following in maple:

f:=(n,m)->n!/(m!*(n-m)!);

test:=Sum((-1)^if(n,n-i)(n-i)^m,i=0..n);

If I set m to be 500 and n to be 300, then test > n^m, the latter being the total number of functions. The number of surjective functions is a subset of the number of functions and should therefore not be higher. My blood is boiling, because I know I'm overseeing something idiotic. Hoping for help.

EDIT:

Not sure what the protocol is on adding answers, but this question has been answered. It is most likely a problem with maple. I added a screenshot of my maple worksheet. I defined a function f1(n,m) myself, that acted odd. I googled and found that maple has a default implemented Stirling2(n,m) function. As the screenshot shows, both functions give the same result for many values of n and m, but not for all. Apparantly I need 10 rep to post images, so I'll link to imgur: enter image description here

1

There are 1 best solutions below

1
On BEST ANSWER

This question has been answered. It is most likely a problem with maple. I added a screenshot of my maple worksheet. I defined a function f1(n,m) myself, that acted odd. I googled and found that maple has a default implemented Stirling2(n,m) function. As the screenshot shows, both functions give the same result for many values of $n$ and $m$, but not for all.

enter image description here