Sorry, but you can only distribute 3 books to 2 students in 6 ways, as shown in the picture below. And my algorithm gives that answer, not yours. You forgot to multiply by 2, since the "two-book-column" can be in any of the two students.
Originally posted by Sang-drax
Lets try to simplify the problem; with three books and two students , the answer is 12 (use pen and paper).
My algorithm gives:
*Every student one book : 3*2 = 6 ways
*Distribute the remaining 1 books : 2 ways
*answer is 12, correct
Magos' algorithm gives:
(only one part to consider)
*3! ways, but order of the books in column 2 isn't important, so divide with 2!
*answer is 3!/2! = 3, wrong
Is my solution better, or even correct? I'm not sure, I can't find the flaw in neither mine nor Magos' algorithm.