We answer the first question. The same idea deals with the second, but with less work.
We stick with $5$ colours, Say there are $a$, $b$, $c$, $d$, $e$ of the various colours, which for convenience we call $a,b,\dots$. Let $n=a+b+c+d+e$. There are $\binom{n}{x}$ ways to draw $x$ items, all equally likely.
We count the bad draws, the ones that are missing one or more of the colours. To get the desired probability, we subtract the number of bads from total, then divide by total.
The idea we will use is called the Principle of Inclusion/Exclusion. Some North American texts call it PIE.
There are $\binom{n-a}{x}$, $\binom{n-b}{x}$, and so on ways to choose $x$ items while leaving out items coloured $a$, $b$, and so on.
Add up these numbers. That does not give us a correct count of the bads, since we have counted twice the choices that miss, for example, colours $a$ and $b$.
So subtract the sum $\binom{n-a-b}{x}+\binom{n-a-c}{x}+\cdots$, $10$ terms in all.
We have subtracted too much, for we have subtracted twice the choices that, for example, miss colours $a$ and $b$ and $c$.
So add back $\binom{n-a-b-c}{x}$, plus $9$ other terms of that shape.
We have added back too much, for we have added back too many times choices like missing all of colours $a$, $b$, $c$, $d$. So subtract
$\binom{n-a-b-c-d}{x}$, together with the other $4$ terms of that shape.
If $a=b=\cdots=e$, as in your example, the expression is quite a bit less messy.
We count the bads in that case. Then $n$ is, say $5k$. The first sum was $\binom{5}{1}\binom{4k}{x}$, we subtract $\binom{5}{2}\binom{3k}{x}$, add back $\binom{5}{3}\binom{2k}{x}$, and finally subtract $\binom{5}{4}\binom{k}{x}$.
Note that we define $\binom{p}{q}$ to be $0$ if $p\lt q$. That makes the expressions formally correct in all cases.
There is straightforward generalization beyond $5$ colours. Typically, the terms in the Inclusion/Exclusion become after a while negligible compared to the lead terms, so by truncating suitably we may be able to get a not too hard to compute adequate estimate.
Actually, no, it is not a uniform distribution. I hope you found out that in case 1, $X$ follows a binomial distribution with $n$ trials, and $p = k_1/(k_1+k_2)$. You should be familiar with the fact that
$$E[X] = np.$$
Further, you seem to be familiar with the fact that in case 2, $X$ follows a hypergeometric distribution with $n$ trials, $N = k_1+k_2$ total balls, and $G = k_1$ red balls. You should be familiar with the fact that
$$E[X] = n\cdot \frac{G}{N}.$$
Notice that $n\cdot G/N = n\cdot k_1/(k_1+k_2) = np$. The most you can draw in case 2 are $k_1+k_2$ balls, so the two will be the same when $0\leq n\leq k_1+k_2$. Also, I assume that "These balls are select by a uniform distribution." means that you draw the balls fairly/impartially from the box, not that there is some underlying uniform distribution that is not revealed.
Best Answer
We can consider each ball to be identifiable, although we are mainly interested in whether the ball is yellow.
We start with $8$ balls. The first draw chooses $2$ of them. There are $\binom 82$ possible pairs of balls that we can draw on the first draw.
For each possible pair of balls that we draw first, there is a set of $6$ balls remaining to draw from. There are $\binom 62$ possible pairs of balls that can be drawn from this set of $6.$
So, $\binom 82$ possible first pairs, and for each of these, $\binom 62$ possible second pairs, a total of $\binom 82 \binom 62$ equally likely outcomes of the two draws.
We now count how many of those outcomes had $x$ yellow balls in the first pair and $y$ yellow balls among all four balls drawn.
The first draw choose $x$ balls from among the $5$ yellow balls, which can happen in $\binom 5x$ different ways, and the remaining $2-x$ balls from the other $3$ balls, which can happen in $\binom 3{2-x}$ ways.
After drawing those $x$ yellow balls and $2-x$ red balls, we have $5-x$ yellow balls and $1+x$ red balls remaining. We draw $y-x$ yellow balls from the set of $5-x,$ which can happen in $\binom{5-x}{y-x}$ ways. Notice that we now have identified $x + (2-x) + (y-x)$ of the $4$ balls that are drawn; $4 - (x + (2-x) + (y-x)) = 2 + x - y,$ so that is the number of red balls that must be drawn on the second draw. There are $\binom{1+x}{2 + x - y}$ ways to draw that number of red balls from the remaining $1+x$ red balls.
Note that for each way to choose the first $x$ yellow balls, there are the same number of ways to choose the first $2-x$ red balls, and then the same number of ways to choose the next $y-x$ yellow balls, and finally for every way we can get to this point there are the same number of ways to choose the last $2+x-y$ red balls. (Note that we are not choosing from the same set of balls in each case in the last two enumerations of choices, but in each case the number of ways we can get the desired outcome is the same.) The total number of ways to draw $x$ yellow balls on the first draw and $y$ yellow balls total is therefore the product of all the numbers of options we had for each choice: $$ \binom 5x \binom 3{2-x} \binom{5-x}{y-x} \binom{1+x}{2 + x - y}.$$ That is the number of "successful" $(x,y)$ outcomes among the $\binom 82 \binom 62$ equally likely outcomes, so we divide by $\binom 82 \binom 62$ to get the probability.