This is an ugly problem. Usually, such a problem will yield to one of the following lines of attack:
- Inclusion-Exclusion
- Recursion
- Computer simulations
- The direct approach.
Initially, I regarded this problem as a job for Inclusion-Exclusion, as discussed here and here.
However, ultimately I rejected this approach because each constraint can be violated in two distinct ways. For example, the lowercase letters constraint can be violated by having either $(0)$ lowercase letters, or $(1)$ lowercase letter. This means (for example) that when you are considering the intersection of the violation of $(3)$ of the $(4)$ constraints, you have to analyze $(2^3)$ situations.
I then considered Recursion. I rejected this approach only because I could not find an elegant way to make it work.
Using a Computer simulation against the original problem is probably not feasible. In my experience, the PC will balk at much greater than $(10)^8$ cases.
This leaves the direct approach. The analysis and computations below are straightforward, but very clumsy. If an exact value is required, then I advise using this answer as a guide and having a computer program do all of the computations.
Stars and Bars theory is discussed here and here.
Superficially, one surmises that this is not a Stars and Bars problem. That is not exactly correct. You can use Stars and Bars theory as a guide in determining how many situations need to be explored, and (more importantly) which situations may be grouped together.
Assume that all $(4)$ of the constraints are obeyed.
Let $x_1$ denote $(-2)~ + $ the # of lowercase letters used.
Let $x_2$ denote $(-2)~ + $ the # of uppercase letters used.
Let $x_3$ denote $(-2)~ + $ the # of numerical characters used.
Let $x_4$ denote $(-2)~ + $ the # of special characters used.
Then, the number of different situations to explore is equal to the number of non-negative integer solutions to
$$x_1 + x_2 + x_3 + x_4 = 7 ~: \binom{10}{3} = 120 ~\text{solutions}. \tag2 $$
These $(120)$ solutions will be grouped in common patterns.
I will use the syntax $(a,b,c,d)$ to denote that these $4$ amounts represent the values assigned to the $(4)$ variables $x_1, x_2, x_3, x_4$, in some order.
I will use the variable $T_k$ to denote the computation associated with Case $k$, below.
In each Case below, I will identify how many of the $(120)$ distinct solutions are represented by that Case.
I will use the syntax of $[(a,b,c,d)]$ to denote specifically that $x_1 = a, x_2 = b, x_3 = c, x_4 = d.$
$\underline{\text{Helper Function} ~: f([a,b,c,d)]}$
I will use the function $f([a,b,c,d)]$ to denote the number of valid passwords associated with $[(a,b,c,d)].$
The general formula is
$$f([a,b,c,d)] =$$
$$\binom{15}{a+2} \times (26)^{(a+2)}
\times \binom{13-a}{b+2} \times (26)^{(b+2)} $$
$$\times \binom{11-a-b}{c+2} \times (10)^{(c+2)}
\times \binom{9-a-b-c}{d+2} \times (35)^{(d+2)}. \tag3 $$
$\underline{\text{Case 1: Pattern} ~= (7,0,0,0)}$
Number of solutions $~= 4.$
$T_1 = $
$f[(7,0,0,0)]$
$+ ~f[(0,7,0,0)]$
$+ ~f[(0,0,7,0)]$
$+ ~f[(0,0,0,7)].$
$\underline{\text{Case 2: Pattern} ~= (6,1,0,0)}$
Number of solutions $~= 12.$
$T_2 = $
$f[(6,1,0,0)]$
$+ ~f[(6,0,1,0)]$
$+ ~f[(6,0,0,1)]$
$+ ~f[(1,6,0,0)]$
$+ ~f[(0,6,1,0)]$
$+ ~f[(0,6,0,1)]$
$+ ~f[(1,0,6,0)]$
$+ ~f[(0,1,6,0)]$
$+ ~f[(0,0,6,1)]$
$+ ~f[(1,0,0,6)]$
$+ ~f[(0,1,0,6)]$
$+ ~f[(0,0,1,6)].$
$\underline{\text{Case 3: Pattern} ~= (5,2,0,0)}$
Number of solutions $~= 12.$
$T_3 = $
$f[(5,2,0,0)]$
$+ ~f[(5,0,2,0)]$
$+ ~f[(5,0,0,2)]$
$+ ~f[(2,5,0,0)]$
$+ ~f[(0,5,2,0)]$
$+ ~f[(0,5,0,2)]$
$+ ~f[(2,0,5,0)]$
$+ ~f[(0,2,5,0)]$
$+ ~f[(0,0,5,2)]$
$+ ~f[(2,0,0,5)]$
$+ ~f[(0,2,0,5)]$
$+ ~f[(0,0,2,5)].$
$\underline{\text{Case 4: Pattern} ~= (5,1,1,0)}$
Number of solutions $~= 12.$
$T_4 = $
$f[(5,0,1,1)]$
$+ ~f[(5,1,0,1)]$
$+ ~f[(5,1,1,0)]$
$+ ~f[(0,5,1,1)]$
$+ ~f[(1,5,0,1)]$
$+ ~f[(1,5,1,0)]$
$+ ~f[(0,1,5,1)]$
$+ ~f[(1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,1,0)}$
Number of solutions $~= 12.$
$T_8 = $
$f[(1,0,3,3)]$
$+ ~f[(1,3,0,3)]$
$+ ~f[(1,3,3,0)]$
$+ ~f[(0,1,3,3)]$
$+ ~f[(3,1,0,3)]$
$+ ~f[(3,1,3,0)]$
$+ ~f[(0,3,1,3)]$
$+ ~f[(3,0,1,3)]$
$+ ~f[(3,3,1,0)]$
$+ ~f[(0,3,3,1)]$
$+ ~f[(3,0,3,1)]$
$+ ~f[(3,3,0,1)].$
$\underline{\text{Case 9: Pattern} ~= (3,2,2,0)}$
Number of solutions $~= 12.$
$T_9 = $
$f[(3,0,2,2)]$
$+ ~f[(3,2,0,2)]$
$+ ~f[(3,2,2,0)]$
$+ ~f[(0,3,2,2)]$
$+ ~f[(2,3,0,2)]$
$+ ~f[(2,3,2,0)]$
$+ ~f[(0,2,3,2)]$
$+ ~f[(2,0,3,2)]$
$+ ~f[(2,2,3,0)]$
$+ ~f[(0,2,2,3)]$
$+ ~f[(2,0,2,3)]$
$+ ~f[(2,2,0,3)].$
$\underline{\text{Case 10: Pattern} ~= (3,2,1,1)}$
Number of solutions $~= 12.$
$T_{10} = $
$f[(3,2,1,1)]$
$+ ~f[(3,1,2,1)]$
$+ ~f[(3,1,1,2)]$
$+ ~f[(2,3,1,1)]$
$+ ~f[(1,3,2,1)]$
$+ ~f[(1,3,1,2)]$
$+ ~f[(2,1,3,1)]$
$+ ~f[(1,2,3,1)]$
$+ ~f[(1,1,3,2)]$
$+ ~f[(2,1,1,3)]$
$+ ~f[(1,2,1,3)]$
$+ ~f[(1,1,2,3)].$
$\underline{\text{Case 11: Pattern} ~= (2,2,2,1)}$
Number of solutions $~= 4.$
$T_{11} = $
$f[(1,2,2,2)]$
$+ ~f[(2,1,2,2)]$
$+ ~f[(2,2,1,2)]$
$+ ~f[(2,2,2,1)].$
Final Computation:
$$\sum_{r=1}^{11} T_r.$$