.\r
\n" );
document.write( "
\n" );
document.write( "\n" );
document.write( "This problem (first part) asks in how many ways 8 distinguishable items can be distributed
\n" );
document.write( "in 4 distinguishable boxes so that each box has at least one item.\r
\n" );
document.write( "
\n" );
document.write( "
\n" );
document.write( "\n" );
document.write( "\r\n" );
document.write( " Solution\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( "The formula for the number of distributions of n distinguishable items in m distinguishable boxes \r\n" );
document.write( "so that no one box is empty is \r\n" );
document.write( "\r\n" );
document.write( " F(n,m) =
. (1)\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( "The sources for this formula are these references \r\n" );
document.write( "\r\n" );
document.write( " Feller - An Introduction to Probability Theory and its Applications, Vol I, 3ed, 1968,\r\n" );
document.write( "\r\n" );
document.write( " Chen Chuan-Chong, Koh Khee-Meng - Principles and Techniques in Combinatorics, 1992,\r\n" );
document.write( "\r\n" );
document.write( " Anderson - A first course in combinatorial Mathematics, 2001.\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( "To make calculations using this formula, I prepared Excel spreadsheets for some different values n and m.\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( " Below are calculations for n= 3, m= 2 (three balls in two boxes).\r\n" );
document.write( "\r\n" );
document.write( " k (-1)^k combin(2,k) (2-k)^3 Separate addends\r\n" );
document.write( " of formula (1)\r\n" );
document.write( " 0 1 1 8 8\r\n" );
document.write( " 1 -1 2 1 -2\r\n" );
document.write( " 6 <<<---=== Final sum F(3,2)\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( " You can check it manually that F(3,2) = 6 is the correct number of different distributions\r\n" );
document.write( " of 3 distinguishable balls in 2 distinguishable boxes.\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( " Below are calculations for n= 4, m= 2 (four balls in two boxes).\r\n" );
document.write( "\r\n" );
document.write( " k (-1)^k combin(2,k) (2-k)^4 Separate addends\r\n" );
document.write( " of formula (1)\r\n" );
document.write( " 0 1 1 16 16\r\n" );
document.write( " 1 -1 2 1 -2\r\n" );
document.write( " 14 <<<---=== Final sum F(4,2)\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( " You can check it manually that F(4,2) = 14 is the correct number of different distributions\r\n" );
document.write( " of 4 distinguishable balls in 2 distinguishable boxes.\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( " And finally, below are calculations for n= 8, m= 4 (8 balls in 4 boxes, the requested case).\r\n" );
document.write( "\r\n" );
document.write( " k (-1)^k combin(4,k) (4-k)^8 Separate addends\r\n" );
document.write( " of formula (1)\r\n" );
document.write( " 0 1 1 65536 65536\r\n" );
document.write( " 1 -1 4 6561 -26244\r\n" );
document.write( " 2 1 6 256 1536\r\n" );
document.write( " 3 -1 4 1 -4\r\n" );
document.write( " 40824 <<<---=== Final sum F(8,4)\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( "ANSWER. The number of all different distributions of 8 distinguishable objects in 4 different boxes is 40824.\r\n" );
document.write( "
\r
\n" );
document.write( "\n" );
document.write( "This part is solved.\r
\n" );
document.write( "
\n" );
document.write( "
\n" );
document.write( "\n" );
document.write( " \n" );
document.write( "