From $n$ amount of things, if we take $r$ things in which $2$ special things have to be selected, how many ways can we arrange the things so that the two special things are not in the first or last of the rows?
I want to solve this problem by finding out the (total ways - ways to have the special things at first or last).
I found total ways to be
$$\frac{(n-2)!(2nr-r^2-r)}{(n-r)!}$$
But the problem becomes an algebraic mess from there. I would be forever grateful if anyone provides a solution using the total ways - first or last formula.
Edit : I have found the total amount of ways to be $$\frac{r(r-1)(n-2)!}{(n-r)!}$$ This is because the $1$st special thing can be sorted into $r$ positions , the $2$nd special thing can be sorted into $(r-1)$ positions and the other $(n-2)$ things can be sorted into $(r-2)$ positions.
Edit(2) : Guys I think I got it. The total ways can be calculated by $$\frac{r(r-1)(n-2)!}{(n-r)!}$$
Now we calculate the number of ways the special letters are at $1$st or last of the row (we name this process point two)
Now, we consider the following cases
Case : $1$
If the $1$st special letter is at the 1st of the row, the $2$nd special letter has $(r-1)$ places to be so in this case, the $(n-2)$ other things/letters have $(r-2)$ places to be in
So in this case , Number of ways = $$\frac{(r-1)(n-2)!}{(n-r)!}$$
Case: $2$
If the 1st special letter is at the last of the row it follow the same process as case 1 . So the number of ways = $$\frac{(r-1)(n-2)!}{(n-r)!}$$
Case: $3$
In this case , we consider the $2$nd special letter being in the first of the row . The process clearly remains the same as Case 1
So, Number of ways = $$\frac{(r-1)(n-2)!}{(n-r)!}$$
Case: $4$
In this case we consider $2$nd special letter being in the last of the row . The process clearly remains the same as case 1
So, Number of ways = $$\frac{(r-1)(n-2)!}{(n-r)!}$$
Total number of ways(In these 4 cases) = Case 1 + Case 2 + Case 3 + Case 4 =$$\frac{4(r-1)(n-2)!}{(n-r)!}$$
Some of these cases overlap since when suppose $1$st special letter is at the first of the row , the $2$nd special letter can be at the last of the row . So in this scenario , Case 1 and Case 4 overlap . In order to get rid of this overlapping we consider the following cases
Case $5$
This is the case of the $1$st special letter being in the $1$st of the row and the $2$nd special letter being at the last of the row. Since these two are fixed we have $(n-2)$ other things which can go in $(r-2)$ places. So number of ways = $$\frac{(n-2)!}{(n-r)!}$$
Case $6$
This is the case of the $2$nd special letter being in the $1$st of the row and the $1$st special letter being in the last of the row . This follows the process of case 5 . So number of ways = $$\frac{(n-2)!}{(n-r)!}$$
Adding these two cases we get the total number of ways the cases can overlap = $$\frac{2(n-2)!}{(n-r)!}$$
We subtract these two cases from the first 4 cases =
$$\frac{(4r-6)(n-2)!}{(n-r)!}$$
This is Point $2$ , So we subtract this from the total number of ways and get the result of =
$$\frac{(r-2)(r-3)(n-2)!}{(n-r)!}$$
This is what the question asked