I'm having some trouble wrapping my head around finding a likelihood function for a geometric distribution based on some measurements. We take the pmf of the flaws in an industrial process to be
$$p(x) = \theta (1-\theta)^{x} \qquad x=0,1,2,\ldots \quad \text{and}\quad 0<\theta<1.$$
Then if we have $n$ samples, of which $n_{0}$ have no flaws and $n_{2}$ have at least two flaws. I know that if these samples are independent, the likelihood should be the product of all trials, but the course notes I'm using give the likelihood function as
$$l(\theta) = \theta^{n_{0}+n_{1}}(1-\theta)^{2n-2n_{0}-n_{1}}.$$
Am I right to think that there's something combinatoric going on here? I've tried taking
$$l(\theta) = \prod_{i=1}^{n}\theta(1-\theta)^{x},$$
but this gives (I think?)
$$l(\theta) = \theta^{n}(1-\theta)^{0\cdot n_{0} + 1 \cdot(n-n_{0}-n_{1}) + 2\cdot n_1}.$$
What am I missing here?
The probability of an single sample having at least two flaws is $(1-\theta)^2$
which I think might make your likelihood function proportional to $$\theta^{n_0}\times\theta^{n_1}(1-\theta)^{n_1} \times (1-\theta)^{2n_2} $$ $$= \theta^{n_0+n_1}(1-\theta)^{n_1+2n_2} $$ $$= \theta^{n_0+n_1}(1-\theta)^{2n - 2n_0 -n_1} $$ in terms of $n, n_0,n_1$. This is the expression you queried
Expressed in terms of $n, n_0,n_2$ it would be $ \theta^{n-n_2}(1-\theta)^{n-n_0+n_2}$