$X$ follows a hypergeometric distribution. A classic phrasing is that there are $N$ total items, with $G$ good ones, $B = N-G$ bad ones, and $n$ is the number of draws from the items without replacement. If we let $X$ follow this distribution, then the probability that $X = k$ is
$$P(X = k) = \frac{\binom{N}{k}\binom{N-G}{n-k}}{\binom{N}{n}},$$
where $\binom{n}{k} = \frac{n!}{k!(n-k)!}$, which is the binomial coefficient. Notice that this is not $(n/k)$, which is just regular division. Basically, we are counting all the ways we can get $k$ goods, $n-k$ bads, and dividing by the number of ways we can get $n$.
Notice that in your problem, we are interested in the number of defective items that we draw from the shipment. It is implied that the draws are without replacement. Since we are interested in the defective ones, we will call these the "good" ones. So, $N = 20$, $G = 3$, $B = 17$, $n = 2$. For example, if $k = 0$, then we want to calculate the probability that we draw no defective items:
$$f(0) = P(X = 0) = \frac{\binom{3}{0}\binom{17}{2}}{\binom{20}{2}} = \frac{68}{95}.$$
In words, we are counting the number of ways to choose 0 of 3 defective ones, multiplying by the number of ways to choose 2 of 17 working items, and then dividing by the number of ways to draw 2 items from the entire shipment.
You can try the formula for the other values.
Best Answer
So in total you have ${12 \choose 3}$ choices to choose 3 computers. Now to get one defective computer exactly, you choose 2 good computers in ${8 \choose 2}$ ways, and 1 defective computer in ${4 \choose 1}$ ways. So together you can choose 2 good computers and exactly one defective one in ${8 \choose 2}{4 \choose 1}$.
Now the probability is : $$\frac{{8 \choose 2}{4 \choose 1}}{{12 \choose 3}}.$$
Try generalizing to variable choices.