WORKED DEFAULT
Check the calculation with the default inputs
For n = 8 and k = 3 nonnegative ordered parts, there are C(10,2) = 45 weak compositions.
- Allow zerosn = 8 across k = 3
- Place separatorsC(10,2)
- Return count45 compositions
COMPOSITIONS / ZERO ALLOWED
Count ordered ways to express n as exactly k nonnegative integer parts, including zero-valued parts.
METHOD / WORKED EXAMPLE
Count ordered ways to express n as exactly k nonnegative integer parts, including zero-valued parts. The result panel keeps the defining recurrence or counting identity visible so the output can be checked independently.
WORKED DEFAULT
For n = 8 and k = 3 nonnegative ordered parts, there are C(10,2) = 45 weak compositions.
READ THE RESULT
Allowing zero distinguishes weak compositions from positive compositions and changes both domain and count.
ASSUMPTIONS AND LIMITS
n is capped at 40 and k at 20; unsafe exact combinations are refused.
COMMON QUESTIONS
For k positive positions, place k-1 separators among n units plus separators, giving C(n+k-1,k-1); handle k=0 explicitly. The indexing and counted objects are stated in the method and worked example. Inputs must be whole numbers inside the displayed domain; the page never rounds a decimal into an accepted index. This ties the answer to one explicit convention instead of silently mixing sequence offsets or combinatorial interpretations.
Allowing zero distinguishes weak compositions from positive compositions and changes both domain and count. Small boundary cases and the displayed identity provide useful independent checks. Recompute the displayed recurrence or closed form with the same inputs and compare its previous terms or counting factors. That check supports this bounded result, but it does not transfer the interpretation to a different sequence or counting object.
n is capped at 40 and k at 20; unsafe exact combinations are refused. The implementation uses integer arithmetic internally and refuses results beyond the safe display boundary. Combinatorial and recurrence values can grow rapidly even when the inputs look small. The conservative cap prevents browser stalls and avoids presenting an unsafe floating-point integer as exact; larger work needs arbitrary-precision software and independent resource controls.
RELATED TOOLS
Use boundary
For k positive positions, place k-1 separators among n units plus separators, giving C(n+k-1,k-1); handle k=0 explicitly.
Count = C(n+k-1,k-1) for k>0.