I won't explain this, it's very simple.
(2) Don't put it back,
Consider arranging n products in a row,
Then all possible outcomes are A(N, n),
Among them, the result of defect at the ith time (i.e. the ith position) is as follows.
C(M, 1) A (n- 1,n- 1),
So the probability that the ith time (i.e. the ith position) is defective is
C(M, 1) A(N- 1,n- 1)/A(N,n)=M/N
The second case has a conclusion,
It's called "the lottery has nothing to do with signing the contract"