I have previously asked a question about a problem simplifying an expression in Mathematica. The solution was to expand the definition of StirlingS2.
This time, I have a more complex set of functions:
p[k_, j_, n_, m_] := StirlingS2[k, j]*Factorial[n*m]/(Factorial[(n*m) - j]*(n*m)^k) ratio[n_, k_] := Sum[p[k, j, n, 1]*KroneckerDelta[n, j]/Binomial[n, Min[n, j]], {j, 1, k}] I know that simplified ratio equals to (Factorial[n]/(n^k))*StirlingS2[k, n].
If I use FullSimplify on ratio it doesn't work, so I tried to unwrap the StirlingS2 definition from the previous question and built this expressions:
stirlingS2[k_, j_, r_] := (1/Factorial[j])*((-1)^(r + j))*Binomial[j, r]*r^k // FullSimplify p[k_, j_, n_, m_, r_] := stirlingS2[k, j, r]*Factorial[n*m]/(Factorial[(n*m) - j]*(n*m)^k) ratio[n_, k_] := Sum[Sum[p[k, j, n, 1, r] KroneckerDelta[n, j]/ Binomial[n, Min[n, j]] // FullSimplify, {r, 0, j}] // FunctionExpand, {j, 1, k}] Now, when I simplify ratio this way: FullSimplify[ratio[n, k], Assumptions -> {n \[Element] PositiveIntegers, k \[Element] PositiveIntegers}] it doesn't output the correct simplified ratio.
How can I fix this issue? And how can I simplify these functions without having to modify them so much?