Hi. You could try using IntegerPartitions[n,k].
eg.,
f[n,k] := IntegerPartitions[n, k]/n
f[20,2] // N
{{1.}, {0.95, 0.05}, {0.9, 0.1}, {0.85, 0.15}, {0.8, 0.2}, {0.75, 0.25}, {0.7, 0.3}, {0.65, 0.35}, {0.6, 0.4}, {0.55, 0.45}, {0.5, 0.5}}
Length[f[20,10]]
530
Regards