WORKED DEFAULT
Check the calculation with the default inputs
For five labelled inputs and three labelled outputs, inclusion-exclusion gives 150 onto functions.
- Count allk^n
- Exclude missing outputsinclusion-exclusion
- Return150
FUNCTIONS / EVERY OUTPUT USED
Count onto functions from n labelled domain elements to k labelled codomain elements.
METHOD / WORKED EXAMPLE
Count onto functions from n labelled domain elements to k labelled codomain elements. The result panel keeps the defining recurrence or counting identity visible so the output can be checked independently.
WORKED DEFAULT
For five labelled inputs and three labelled outputs, inclusion-exclusion gives 150 onto functions.
READ THE RESULT
Labelling the output blocks distinguishes surjections from ordinary set partitions into k unlabeled blocks.
ASSUMPTIONS AND LIMITS
This counts functions only and does not generate mappings or probabilities.
COMMON QUESTIONS
Count all k^n labelled functions, then use inclusion-exclusion over codomain values omitted from the image. The indexing, equivalence relation, 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.
Labelling the output blocks distinguishes surjections from ordinary set partitions into k unlabeled blocks. Small boundary cases and the displayed recurrence or 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.
This counts functions only and does not generate mappings or probabilities. 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
Count all k^n labelled functions, then use inclusion-exclusion over codomain values omitted from the image.
sum_i (-1)^i C(k,i)(k-i)^n.