Hi all,
please consider this counting of special combinations:
def C(n, k):
return Compositions(n, max_part=k, inner=[k]).cardinality()
for n in (0..4): print([C(n, k) for k in (0..n)])
[0]
[0, 1]
[0, 1, 1]
[0, 1, 1, 1]
[0, 1, 2, 1, 1]
Edge cases are notoriously difficult and error-prone. Maybe a
combinatorialist can help me: I suspect the case C(0, 0) to be
wrong, it shouldn't be C(0,0) = 0, but C(0,0) = 1.
The counted situation looks like this to me:
[[0]]
[[ ], [[1]]]
[[ ], [[1, 1]], [[2]]]
[[ ], [[1, 1, 1]], [[2, 1]], [[3]]]
[[ ], [[1, 1, 1, 1]], [[2, 2], [2, 1, 1]], [[3, 1]], [[4]]]
Peter
P.S. Sage 10.1
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sage-support/a1470edb-4d6f-4444-ac10-12f4e307df55n%40googlegroups.com.