1
$\begingroup$

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?

$\endgroup$

1 Answer 1

2
$\begingroup$
$Version (* "14.0.0 for Mac OS X ARM (64-bit) (December 13, 2023)" *) Clear["Global`*"] 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}] 

Using the Assumptions option in FullSimplify

FullSimplify[ratio[n, k], Assumptions -> {n ∈ PositiveIntegers, k ∈ PositiveIntegers}] (* Sum[(n!*KroneckerDelta[j, n]*StirlingS2[k, j])/ (n^k*(Binomial[n, Min[j, n]]*(-j + n)!)), {j, 1, k}] *) 

The Assuming construct makes more thorough use of the assumptions, e.g., the assumptions are available to the intermediate Sum.

Assuming[{n ∈ PositiveIntegers, k ∈ PositiveIntegers}, ratio[n, k] // FullSimplify] (* Piecewise[{{1, k == 1}, {(n!*StirlingS2[k, n])/n^k, k > 1 && k >= n}}, 0] *) 
$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.