I need number of ways to place $k$ balls in $F$ boxes where exactly $r$ boxes contain exactly one ball. It means that exactly $r$ boxes should contain exactly one ball and another $F - r$ boxes should contain either $0$ or at least 2 balls $(0,2,3,4,5...)$.
In addition, I should say that balls are distinguishable and boxes are distinguishable.
Actually, that's all.
Well, I can tell you my solution.
Let's consider that $N(r,k,F)$ - the answer to my question. i.e. number of ways to place $k$ balls in $F$ boxes where exactly $r$ boxes contain exactly one ball.
Well, let's compute it. Firstly, I can choose with $\binom k r$ ways my favourite balls (which I want to be lonely) and $\binom F r$ my favourite boxes (which I want to contain my lonely balls) and I can make with $r!$ ways concordance between $r$ balls and $r$ boxes. According to a combinatoric rules all of it give $\binom k r \cdot \binom F r \cdot r!$ ways of doing it.
After this, what should I do now? Now I have $F-r$ boxes and $k-r$ balls. And I should place them under condition that ZERO boxes contain exactly one ball. See similarity? It is exactly $N(0, k-r, F-r)$. Hm, Well, now I have equation:
$$ N(r,k,F) =\binom k r \cdot \binom F r \cdot r! \cdot N(0, k-r, F-r) $$
of course $r$ should be $r\le\min(k,F)$ here.
Now I have some recursion. Well, let's think of initial conditions.
$$N(0,0,F) = 1$$
$$N(0,k,0) = 0$$
It is not enough. If I did not have this strange condition about favourite balls I would have $ F^k $ ways to place $k$ balls into $F$ boxes according to a famous basic combinatoric task. However, It means that the whole sum equals
$$ \sum_{s=0} ^{\min(k, F)} N(s,k,F) = F^k $$
Consequently, let's think of $N(0, k, F)$ here. $$ N(0,k,F) = F^k - \sum_{s=1} ^{\min(k, K)} N(s,k,F) $$
NOW I have again 4 equations with some difficult recursion. I really do not like them. I can't do anything with these formulas. I want some help to simplify this or another solution. By the way, now my Python code does solve it. But I want to get some beautiful solution to this problem.
PS I have already asked similar question and get a perfect answer for the case of indistinguishable balls.
Number of ways to place $k$ balls in $F$ boxes where exactly $r$ boxes contain exactly one ball.
But now I am trying to get solution for this case of distinguishable balls. I do not get how I should change solution of Markus with generating functions.
Here is an approach based upon generating functions.
Next we focus on the remaining $F-r$ boxes which shall contain zero or more than one ball. We use generating functions to encode the configurations and since we have distinguishable objects we take exponential generating functions. We encode the number of balls in one of these $F-r$ boxes as exponent and we consider \begin{align*} 1+\frac{x^2}{2!}+\frac{x^3}{3!}+\frac{x^4}{4!}+\cdots=e^x-x\tag{1} \end{align*} Note that $\frac{x^1}{1!}$ is explicitely excluded guaranteeing that a box will not contain precisely $1$ ball. As we don't know how many balls can be placed in a box, we do not restrict the number of balls per box, indicated by $+\cdots$ in the series. We use the coefficient of operator $[x^k]$ to denote the coefficient of $x^k$ in a series.
With some effort we can expand the expression (2) and represent the wanted number as expression with multiple sums.
We encode the six balls with $\{1,2,3,4,5,6\}$ and place for illustration purpose the selection $\{1,2\}$ in two out of six boxes.