This problem of maximization is similar to an urn model? 
$M$ cookies have been mixed in a bread dough. Suppose that the whole dough is used to make $N$ muffins How many cookies should be used so that with a probability of $0.95$ each muffin contains a cookie?

I've tried think the problem like a urn model. $M$ balls and $N$ urns so the probability that each urn have at least a ball is $\sum_{i=0}^{M} {N \choose i}(1-\frac{i}{7})^M$
But is pretty hard try to find the $M$ such that:
$\sum_{i=0}^{M} {N \choose i}(1-\frac{i}{N})^M=0.95$
So, exist another way to find $M$?
 A: 
I've tried think the problem like a urn model. $M$ balls and $N$ urns so the probability that each urn have at least a ball is $\sum_{i=0}^{M} {N \choose i}(1-\frac{i}{N})^M$

I am not entirely sure how you got this expression. But it's not correct: if $M = 1$ ball, it gives $\binom{N}{0} + \binom{N}{1}\left(1 - \frac{1}{N}\right) = 1 + N - 1 = N$, which is not between $0$ and $1$. If $M = 2$ balls, it gives $\binom{N}{0} + \binom{N}{1}\left(1 - \frac{1}{N}\right)^2 + \binom{N}2 \left(1 - \frac{2}{N}\right)^2 =1 + \frac{(N-1)^2}{N} + \frac{(N-1)(N-2)^2}{2N}$ which is also not right.
(Further extended comment)
To tackle the original problem -- first, it's not stated in the problem, but we have to assume that each of the $M$ balls (cookies) is independently assigned to a random of the $N$ urns (muffins).


*

*The total number of ways to put $M$ balls in $N$ urns is $N^M$.

*Then we can use inclusion-exclusion: the number ways to put $M$ balls in $n$ urns, for $n =1$ to $N$, is $n^M$. So we start with the number of ways to put them in all $N$ urns, then subtract the ways to put them in only $N-1$, then add the ways to put them in $N-2$, and so on. We get the number of ways to put at least one ball in every earn as:
$$
N^M - \binom{N}{N-1} (N-1)^M + \binom{N}{N-2} (N-2)^M - \binom{N}{N-3} (N-3)^M + \cdots
$$
or
$$
\sum_{i=0}^N (-1)^i \binom{N}{i} (N-i)^M.
$$
That doesn't help to show when it's above .95, though.
A: If you imagine adding cookies one by one and randomly placing each newly-added cookie into one of $N$ muffins, then this is exactly the coupon collector problem: 
https://en.wikipedia.org/wiki/Coupon_collector%27s_problem
I.e. how many cookies (boxes of cereal) you have to add (open) before you can cover all $N$ muffins (collect at least one each of $N$ different coupons).  I think the problem does not have a nice closed form (besides the one given by @6005) but the wikipedia article gives some tail estimates.
