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 `2^(n)` ways. There are two ways (i) when all objects are put in box `B_(1)` (ii) when all objects are put in box `B_(2)`. Thus, there are `2^(n)-2` ways in which neither box is
empty. If we now remove the laebls from the boxes so that they become identical this number must be divided by 2 to get the required number of ways.
Hence, the required number of ways `=(1)/(2)(2^(n)-2)=2^(n-1)-1`.