Calculating wrong a Binomial distribution 
From $N$ balls in a bin, $D$ of them are red and the rest are blue. We draw $n$ balls with/without replacement uniformly. Let $X$ be a random variable representing the sum of red balls we draw out. Calculate the distribution of $X$.

Without replacement
it's Hypergeometric distribution:
$$ P(X=k)= \frac{\binom{D}{k}\binom{N-D}{n-k}}{\binom{N}{n}} $$
With replacement
Here is my problem - It should be Binomial distribution but I calculate it wrong.
My wrong answer is:
The probability to choose a red ball is $\frac{D}{N}$. We choose $k$ red balls and $n-k$ blue balls:
$$ P(X=k)= \bigg(\frac{D}{N}\bigg)^{k}\bigg(\frac{N-D}{N}\bigg)^{n-k} $$
Why is it an incorrect answer?
 A: Let's try your proposed answer (for the case with replacement)
using some specific numbers.
Let $N = 20,$ $D = 10,$ and $n = 4.$
Then $$\dfrac DN = \dfrac{10}{20} = \dfrac12$$ and 
$$\dfrac {N - D}N = \dfrac{20 - 10}{20} = \dfrac12,$$
so your formula comes out to
$$ P(X=k) = \left(\frac12\right)^{k} \left(\frac12\right)^{4-k}
= \frac{1}{16}$$
for $k = 0, 1, 2, 3, 4.$ For any other value of $k$, it is impossible to have $k$ red balls in a sequence of balls, so $P(X=k) = 0.$
Add up the total probability of all possible events:
\begin{align}
P(x = 0) + P(x = 1) + P(x = 2&) + P(x = 3) + P(x = 4) \\
&= \frac{1}{16} + \frac{1}{16} + \frac{1}{16} + \frac{1}{16} + \frac{1}{16}\\
&= \frac{5}{16}.
\end{align}
So $\frac{11}{16}$ of the time something impossible must happen, since all the possible outcomes only account for $\frac{5}{16}$ of the total probability.
The error in your formula is that it underestimates the probability of the "middle" outcomes.  In this example, since there are equal numbers of red and blue balls, the probability that you draw a red ball on all $4$ draws 
is the same as the probability that you draw a blue ball on the first draw and red balls on the last $3$ draws, which is the same as the probability that you draw a red ball, then blue, the two more red.
When you count the red balls to arrive at your random number $X,$
you combine together all the events (blue, red, red, red),
(red, blue, red, red), (red, red, blue, red), and (red, red, red, blue)
into one event called $(X = 3),$
but that does not change the fact that each of the events
(blue, red, red, red), (red, blue, red, red), etc.
individually had the same probability as (red, red, red, red),
that is, the probability $\frac{1}{16}.$
By combining this four events together, you get an event with four times
the individual probability, that is, 
$$P(X = 3) = 4\left(\frac{1}{16}\right) = \frac14.$$
A: With Replacement 
Each red has the same probability of being drawn, $\frac DN$, and each blue has the same probability of being drawn, $\frac{N-D}N$. Therefore, $\left(\frac DN\right)^k\left(\frac{N-D}N\right)^{n-k}$ would be the probability of drawing $$\overbrace{{\huge\lower{1pt}\color{#C00}{\bullet\bullet}}\cdots{\huge\lower{1pt}\color{#C00}{\bullet}}}^{k}\overbrace{{\huge\lower{1pt}\color{#00F}{\bullet\bullet}}\cdots{\huge\lower{1pt}\color{#00F}{\bullet}}}^{n-k}$$
However, the colors may be shuffled, and there are $\binom{n}{k}$ ways of shuffling the colors. That gives a total probability of
$$
\binom{n}{k}\left(\frac DN\right)^k\left(\frac{N-D}N\right)^{n-k}
$$
This makes sense. If we add up the probabilities for all $k$, the Binomial Theorem says
$$
\begin{align}
\sum_{k=0}^n\binom{n}{k}\left(\frac DN\right)^k\left(\frac{N-D}N\right)^{n-k}
&=\left(\frac DN+\frac{N-D}N\right)^n\\
&=1
\end{align}
$$

Without Replacement
The probability of each red decreases with each draw $\frac{D-j}{N-i}$ for the $j+1^\text{st}$ red drawn and the $i+1^\text{st}$ ball drawn, and the probability of each blue decreases with each draw $\frac{N-D-j}{N-i}$, for the $j+1^\text{st}$ blue drawn and the $i+1^\text{st}$ ball drawn. Thus, the probability of any given order of reds and blues is
$$
\scriptsize\frac{\overbrace{D(D-1)(D-2)\cdots(D-k+1)}^\text{reds drawn}\,\overbrace{(N-D)(N-D-1)(N-D-2)\cdots(N-D-n+k+1)}^\text{blues drawn}}{\underbrace{N(N-1)(N-2)\cdots(N-n+1)}_{\substack{\text{balls drawn}\\\text{these can be associated with reds or blues,}\\\text{depending on their order,}\\\text{but each will appear}}}}
$$
which equals
$$
\frac{\frac{D!}{(D-k)!}\frac{(N-D)!}{(N-D-n+k)!}}{\frac{N!}{(N-n)!}}
$$
But then, as with replacement, these can be shuffled in $\binom{n}{k}=\frac{n!}{k!\,(n-k)!}$ ways, giving a total probability of
$$
\begin{align}
\frac{n!}{k!\,(n-k)!}\frac{\frac{D!}{(D-k)!}\frac{(N-D)!}{(N-D-n+k)!}}{\frac{N!}{(N-n)!}}
&=\frac{\frac{D!}{(D-k)!\,k!}\frac{(N-D)!}{(N-D-n+k)!\,(n-k)!}}{\frac{N!}{(N-n)!\,n!}}\\[6pt]
&=\frac{\binom{D}{k}\binom{N-D}{n-k}}{\binom{N}{n}}
\end{align}
$$
A: The fraction $\frac{D}{N}$ represents the probability that a SPECIFIC ball will be red.  So, you've calculated the probability of one possible way of choosing $k$ red balls and $n-k$ blue ones.  But you haven't taken into account the fact that there are lots of orders in which you can pick them.
This is where the $\binom{n}{k}$ part of the binomial distribution comes from: there are $\binom{n}{k}$ different orders for $k$ red balls and $n-k$ blue ones, because you can choose any $k$ positions to be red.
