Let us first label the boxes `B_(1)andB_(2)`. Now each object can be put either in `B_(1)or"in" B_(2)`. So, there are two ways to deal with each of the n objects. Consequently, n objects can be dealt with `2^(n)` ways. Out of these are `2^(n)` ways (i) when all objects are put in box `B_(1)` (ii) when all objects are put in box `B_(2)`. Thus, there `2^(n)-2` ways in which neither box is empty. If we now remove the labels from the boxes so that they become identical, this number must be divided by bty 2 to get the required number of ways.
`:.` Required number of ways `=(1)/(2)(2^(n)-2)=2^(n-1)-1`