Ok..let me explain it by taking one more example..with 2 books and 2 shelves where i want to put 1 book in each shelf
S1,S2
1,1(A,B)
You know that this can be done only in 2 ways, but according to my way of doing, it would be
2C1*2*1C1*1 = 4 Cases, because
Case 1: I chose A first and place it in S1 and chose B next and place it in S2 {A->S1, B->S2}
Case 2: I chose A first and place it in S2 and chose B next and place it in S1 {B->S1, A->S2}
Case 3: I chose B first and place it in S1 and chose A next and place it in S1 {B->S1,A->S2}
Case 4: I chose B first and place it in S2 and chose A next and place it in S1 {A->S1, B->S2}
As you can see, even though there are four cases, there will be only 2 distinct arrangements..this happens only when the two shelves contains same number of elements.. so it should be 2C1*2*1C1*1 / 2!
and similarly for 3 books and 3 shelves if i have to put 1 book in each
S1,S2,S2
1,1,1(A,B,C)
3C1*3*2C1*2*1C1*1 / 3! = 36 / 3! as all three shelves have same number elements we are dividing here with 3!..