# Elementary cases-probability

I am studying for the test in probability class. Now, I have some problems with combinatorics here, but it is not that I do not understand combinations, permutations with or without repetition, all of that is clear to me. I have problem with assigning elementary cases, and if any of you could clear that for me I would be very grateful.

To give you an idea what I am talking about, let's consider this example:

Let's say we have n boxes and n+2 balls. If those balls are thrown in boxes so that each ball has equal probability of getting in each box, what is probability that there won't be any empty box?

Now, I have first calculated number of possible events and that is n^(n+2) and this is number of possible events if I am assigning elementary case to balls(each ball can get into n boxes so nnn*...*n=n^(n+2), and since I did it like this, I consider that each ball is different). Now, I want to calculate number of likely events. What I did here is I set up classic equation x1+x2+...xn=n+2 (then added one to each term so there is >=1 ball in each box) and then i get y1+y2+...yn=2n+2. Which is just combinations with repetition and I got for likely events binomial coefficient(2n+1, n-1). Then just normally calculated probability (number of likely events)/(number od possible events) and didn't get the right answer. My professor told me that this is because I calculated number of likely events as if I assigned elementary cases to boxes, and as if I assigned elementary cases to balls when I was calculating total number of events.

Now, I would not know how to calculate number of likely events simply because I do not know how to look for those likely elementary cases, so any help would be very appreciated, with this problem and in general. I think you can now see what I do not understand.

• Looking at the eight questions you asked in the past, it seems as if you haven't accepted any answer. Although not all questions on this platform get a sufficient answer, please try to respect the following guidelines: math.stackexchange.com/help/someone-answers. – jvdhooft Jun 13 '17 at 10:09

There are indeed $n^{n+2}$ possible outcomes.
For $i=1,\dots,n$ let $E_i$ denote the set of outcomes such that box $i$ stays empty.
Then you are looking for $$n^{n+2}-|E_1\cup\cdots\cup E_n|$$
Have a look at the link and work this out, realizing that e.g. $|E_1\cap E_3\cap E_7|=(n-3)^{n+2}$.