Counting strings, need to under stand how this worked Question 
Let $N_4 = \{1, 2, ..., 4\}$.
Calculate the number of strings on the set $N_4$ that are of length $8$.
Calculate the number of strings on the set $N_4$ that are of length $8$ and contain exactly five ones.
Answer
For the first part of the question, for each of the $8$ positions in the string we have a choice of $4$ digits. Using the product rule, the number of different possible strings is $= 4^8 = 65536$.
The task of creating a string from the set $N_4$ of length $8$ with $5$ ones may be partitioned into two tasks:
Select the position of the ones this can be done in $C(8,5) = 56$ different ways. (THIS IS THE STEP I DON"T UNDERSTAND)
(AND THIS TOO)
Select the digits that go into the remaining $3$ positions $= 3^3 = 27$ different ways.  
We now apply the product rule to obtain the solution $= 1512$.
Hence, the solutions are:
$65536$
$1512$

Placing the ones: You have 8 positions to place the first '1', after that 7 positions remain available for the second '1', and so on till the fifth '1' (4 positions left for it). In total you would have 8×7×6×5×4 options; but, because the '1's are indistinguishable from each other, for each placement you are counting them 5×4×3×2×1 times (this is the number of ways you can order the '1's between themselves; imagine them having different colors for example). So the number of indistinguishable ways to place the '1's is: 8×7 = 56 (divide the two products above).
Placing the other digits: You are now left with 3 vacant positions, where you can place 2, 3 or 4. So, you have 3 options for each position, and in total: 3×3×3 = 27 combinations
