Probability of Moving Counters into Bags, Using Factorials. 
Bag P and bag Q each contain n counters, where n > 2. The counters are
  identical in shape and size, but colored either black or white.
  First, k counters (0 < k < n) are drawn at random from bag P and
  placed in bag Q. Then, k counters are drawn at random from bag Q and
  placed in bag P.
If initially n − 1 counters in bag P are white and one is black, and n
  − 1 counters in bag Q are white and one is black, find the probability
  in terms of n and k that the black counters end up in the same bag.
  Find the value or values of k for which this probability is maximized.

I do not know how to do the factorial approach to this question. 
I know that it can be calculated as the number of possible outcomes of event over all possible outcomes, but I don't understand how I could do this.
 A: Here is a brute force solution.
There are two ways in which the black counters can end up in the same bag: they can both end up in $P$, or they can both end up in $Q$. There are two ways for both to end up in $P$.


*

*The first transfer does not include the black counter in $P$, and the second transfer does include the black counter in $Q$. There are $\binom{n-1}k$ sets of $k$ counters in $P$ that do not include the black one out of a total of $\binom{n}k$ sets of $k$ counters, so the probability that the first transfer does not include the black counter in $P$ is $$\frac{\binom{n-1}k}{\binom{n}k}=\frac{\frac{(n-1)!}{k!(n-1-k)!}}{\frac{n!}{k!(n-k)!}}=\frac{n-k}{n}\;.$$ After this transfer there are $n-1+k$ white counters and one black counter in $Q$. There are altogether $\binom{n+k}k$ ways to choose $k$ of these counters, $\binom{n-1+k}{k-1}$ of which include the black counter, so the probability of transferring the black counter to $P$ is $$\frac{\binom{n-1+k}{k-1}}{\binom{n+k}k}=\frac{\binom{n-1+k}{k-1}}{\frac{n+k}{k}\binom{n-1+k}{k-1}}=\frac{k}{n+k}\;.$$ The overall probability of this case is therefore $$\frac{n-k}n\cdot\frac{k}{n+k}=\frac{k(n-k)}{n(n+k)}\;.$$

*Alternatively, the first transfer does include the black counter in $P$, and the second includes both black counters. The calculations are similar to those in the previous case. There are $\binom{n-1}{k-1}$ ways to choose $k$ counters from $P$ including the black one, so the probability of doing so is $$\frac{\binom{n-1}{k-1}}{\binom{n}k}=\frac{\binom{n-1}{k-1}}{\frac{n}k\binom{n-1}{k-1}}=\frac{k}n\;.$$ There are then $\binom{n+k-2}{k-2}$ ways to choose $k$ counters from $Q$ that include both black counters, so the probability of doing so is $$\frac{\binom{n+k-2}{k-2}}{\binom{n+k}k}=\frac{\binom{n+k-2}{k-2}}{\frac{(n+k)(n+k-1)}{k(k-1)}\binom{n+k-2}{k-2}}=\frac{k(k-1)}{(n+k)(n+k-1)}\;.$$ The overall probability of this case is therefore $$\frac{k}n\cdot\frac{k(k-1)}{(n+k)(n+k-1)}=\frac{k^2(k-1)}{n(n+k)(n+k-1)}\;.$$
The total probability of ending up with both black balls in $P$ is therefore
$$\begin{align*}
\frac{k(n-k)}{n(n+k)}+\frac{k^2(k-1)}{n(n+k)(n+k-1)}&=\frac{k(n-k)(n+k-1)+k^2(k-1)}{n(n+k)(n+k-1)}\\
&=\frac{k(n-1)}{(n+k)(n+k-1)}\;.\tag{1}
\end{align*}$$
There is only one way for both black counters to end up in $Q$: the black counter in $P$ must be in the first transfer, and the second must not include either black counter. We’ve already calculated that the probability that the black counter in $P$ is in the first transfer: it’s $\frac{k}n$. The probability that neither black counter is in the second transfer is then 
$$\frac{\binom{n+k-2}k}{\binom{n+k}k}=\frac{n(n-1)}{(n+k)(n+k-1)}\;,$$
and the overall probability that both black counters end up in $Q$ is
$$\frac{kn(n-1)}{n(n+k)(n+k-1)}=\frac{k(n-1)}{(n+k)(n+k-1)}\;.$$
Thus, the total probability of ending up with both black counters in one bag is
$$\frac{2k(n-1)}{(n+k)(n+k-1)}\;.$$
Finding the value of $k$ that maximizes this probability can be treated mostly as a standard calculus problem, but there is a small twist at the end. If $p(k)$ is the probability when we transfer $k$ counters, then
$$p(k)=2(n-1)\cdot\frac{k}{(n+k)(n+k-1)}\;,$$
where $n$ is a constant, and we want to maximize this function. Clearly
$$\begin{align*}
p'(k)&=2(n-1)\left(\frac{(n+k)(n+k-1)-k(2n+2k-1)}{(n+k)^2(n+k-1)^2}\right)\\
&=\frac{n^2-k^2-n}{(n+k)^2(n+k-1)^2}\;,
\end{align*}$$
which is $0$ when $k^2=n^2-n$, i.e., when $k=\sqrt{n(n-1)}$. It’s easy to check that $p'(k)$ is positive for $k<\sqrt{n(n-1)}$ and negative for $k>\sqrt{n(n-1)}$, so the function really does have a maximum at $k=\sqrt{n(n-1)}$. However, we need $k$ to be an integer. Clearly $$n-1<\sqrt{n(n-1)}<n\;,$$ so the maximum when $k$ is restricted to be an integer is either $n-1$ or $n$, one of the two integers closest to the true maximum. But we’re told that $k\le n-1$, so in fact the answer must be that $k=n-1$.
Added: It may seem a bit odd that the probability of ending up with both black counters in $P$ is the same as the probability of ending up with both black counters in $Q$, since the calculations are quite different. However, on close examination it turns out that the situation actually is symmetric. After we make the first transfer, there are $n+k$ counters in $Q$, and we choose $k$ of those counters to transfer to $P$. Some of the counters that we choose for this second transfer may be counters that were in $Q$ right along; say there are $\ell$ of these, where $0\le\ell\le k$. After the second transfer $P$ contains the $n-k$ counters that were not part of the first transfer, $\ell$ counters that started in $Q$, and $k-\ell$ counters that were started in $P$, were transferred to $Q$, and have now been returned to $P$. In short, $P$ ends up with $n-\ell$ of its original counters and $\ell$ counters that started in $Q$. Clearly this leaves $Q$ with $n-\ell$ of its original counters and $\ell$ counters that started in $P$. Thus, in effect we’ve simply chosen $\ell$ counters from $P$ (for some $\ell$ with $0\le\ell\le k$) and $\ell$ counters from $Q$ and interchanged the two sets of $\ell$ counters. For each $\ell$ this operation is symmetric between $P$ and $Q$, so even though we don’t know just what value of $\ell$ will occur, we know that overall we’ve simply traded some of $P$’s counters for an equal number of $Q$’s counters. Clearly the probability of ending up with both black counters in $P$ must be the same as the probability of ending up with both of them in $Q$.
A: I have a hand-written image of the solution, let me know if it is legible.


