The password can contain: Lowercase(LC), uppercase (UC), digit(D), punctuation(P) & other characters(OC).
Now, the criteria are given as following:
1. LC>any of the other types.
2. P< any of the other types.
3. No consecutive characters in the password are of the same one of these types.
4. The password begins or ends with one of these other characters (OC), of which it contains exactly one
What we are given: M ? G ___ _5th__ ___ __7th_ ___ ____
Now, since LC needs to be greatest => LC can be only 3, since if we take 4 LC's our 3 criteria is violated.
Then, no more UC, since no. of UC types cannot be greater that LC types, as per criteria 1.
No. of Digits(D) can be either 2 since it cannot be greater than LC. It cannot be 1 since it cannot be less than the no. of Punctuation type.
We can only use 1 OC which has to be added as the last character of the password, as per criteria 4.
No. of punctuation has to be the least when compared to no. of LC, UC or D, and " ? " is already present, so at max the no. of Punctuation types can only be 1, otherwise it would violate the 2nd criteria, since no. of digits is already 2.
So, we would exactly be needing: LC =3, D=2, OC= 1.
Next comes the order in which we have to place them, keeping in mind the criteria 3.
So the best combination that comes when we place the characters is:
M ? G _a__ __1_ _b__ _9__ __c_ _$__
Now, we can try arranging in any way possible, it would always violate either criteria 3 or 4. Therefore, 5th and 7th characters of the password will always be digits.
Ans. Digit and Digit