Definition: A function is surjective if for every element “b” in B, there is some element “a” in A such that
. //
This simply means that our function “hits” every element in the set that it’s mapping to (i.e., its codomain). In our school dance example, this idea corresponds to the scenario in which every girl has at least one dance partner. Note the “at least” here, which is included because the definition of surjectivity makes no reference to how many elements in A are sent to “b” in B, but rather that there always is at least one. Also note that this has to hold for every element in B.
For more on surjectivity, take a look at lesson 7.