Number of possible sequences
How many ways can two sets of objects, nr of one type and nl of another, be placed in N available spaces? The assumption is that each of the two types are separately indistinguishable. I.e. all nr items look like one another as do the nl objects. In the case of tossed coins, all heads are considered indistinguishable from each other as are all tails.
Suppose in a kindergarten there are N cubby holes where the children can place an orange or an apple. There are nr oranges and nl apples for a total nr + nl = N total objects. The first cubby can hold any one of the N pieces of fruit, the second any of the remaining N - 1 pieces, the third any of N - 2, and so on until the last piece has only one place for it. The total number of possible arrangements is then N*(N-1)*(N-2)*...*1= N! ways. Of these ways however, many lead to the same result because the apples are undistinguishable, as are the oranges. The nr oranges can be arranged in nr ! different (but undistinguishable) ways and similarly nl ! ways for the oranges, so a total of nr ! *nl ! possible but identical combinations must be divided out. The total remaining is then