To understand the binomial probability distribution function, I was lucky to see the connection between the Bernoulli probability: $P(X=k) = {n\choose k}p^k(1-p)^{1-k}$, which is based on the formula for one try: $P(x=k) = p^k(1-p)^{1-k}$ which is $p$ for $k=1$ and $1-p$ for $k=0$. The Bernoulli probability distribution function is a function that represents the probability of having k successes on $n$ trials of something.
If we do the experiment more than one time, let's say, $k$ times and the probability stays the same on every trial, then the probability function $P(s)$ is just the number of $s$ successes in these $k$ trials. This is exactly $kCs$ or $k\choose s$. Why? See the text at $(1)$in the end.
Now, for the hypergeometric distribution, we're doing kinda like in the Bernoulli case, but the probability changes after very trial. We can think of the success and failure as being the removal of a ball of color $A$ from a sack of balls of color $A$ or $B$. In the Bernoulli case, it's like we putting the ball back in the sack for the next trial, so the probability of getting a ball of color $A$ is the same on every trial. In the hypergeometric case is like we were not putting it back again, so the probability of getting a ball of color $A$ changes after each trial. For some reason, its formula is: $$P(X=k) = \frac{{K\choose k} {{N-K}\choose {n-k}}}{N\choose n}$$
Main question: How to find the formula for the hypergeometric distribution?
** (1) Explanation for the Bernoulli formula (the combinatoric part):**
Our experiment for let's say, $k=5$ trials when $S$ means success and $F$ means failure looks like this:
$$SSSSS\\ SSSSF \\ SSSFS \\ SSFSS \\ \cdots \\ FFFFF$$
Our function $P(s=3)$ should count how many objects exists in the set above with exactly 3 $S$ letters, for example: $SSSFF, SFSFS, SSFFS, \cdots$. To count this, we're gonna think about how many permutations of $A,B,C$ exist in $A,B,C,D,E$, that is, how many ways can we do things like:
$$ABCDE\\ABDCE\\ADEBC\\ \cdots \\ EDBCA$$
We know that there are $5!$ ways to permute every symbol, but we just care about the permutations on $A,B,C$, so $ABCDE$ and $ABCED$ are the same for this case. In general, for every permutation in the set above, there will be an equivalent one with $D$ and $E$ switched. Other example can be: $ABDEC$ being the same as $ABEDC$, so we're gonna divide by how many ways there are to permute $E$ and $D$, which is $2!$. So the number of ways to permute $A,B,C$ in $A,B,C,D,E$ is $\frac{5!}{2!} = \frac{5!}{(5-3)!}$. This is the known formula $\frac{p!}{(p-k)!}$.
Getting back to our case, I see the problem of counting how many $3$ $S$ucesses in $5$ trials as counting how many permutations of letters $A,B,C$ in the set $A,B,C,D,E$, with the restriction that we don't want to count repetitions (you'll understand this part soon). For example, the $3$ sucesses would look like this:
$$SSSFF\\SSFSF\\SFSFS\\\cdots\\FFSSS$$ I don't know exactly how to explain this part, but I see this as being the same as counting the permutations $A,B,C$ inside $A,B,C,D,E$, except that now, $ABCDE = ACBDE = BACDE = BCADE = CABDE = CBADE$, that is, $S_1S_2S_3FF = S_2S_1S_3FF = S_3S_1S_2FF = S_1S_3S_2FF = S_2S_3S_1FF = S_3S_2S_1FF$. I could differentiate the $F$ letters by $F_1, F_2$ but since we're not gonna count repetitions on $F$ as in the formula $\frac{p!}{(p-k)!}$, I'm considering that there exists only one case. Now we must just se that in general there will be $3!$ equal cases for each object, because $ABCDE = ACBDE = \cdots$. The reason is obvious: there is $3!$ ways to permute $A,B,C$ or $S_1,S_2,S_3$, so we just divide the formula by $3!$ or $k!$, that's why the formula for combination is ${p\choose k} = \frac{p!}{k!(p-k)!}$
UPDATE:
While writing this, I realized that it's a lot simpler if we just consider the permutations of the following letters: $S_1,S_2,S_3,F_1,F_2$, eliminate the permutations for $F_1,F_2$ by dividing by $2!$ and eliminate the permutations of $S_1S_2S_3$ because $S_1S_2S_3F_1F_2 = S_1S_3S_2F_1F_2 = \cdots $, which is $3!$ in total. I made a mess but I think it's good to see my thinking process.
Now that we counted how many successes there are, it's just a matter of multiplying by $p^k(1-p)^{1-k}$ to get the formula.