Firstly, thank you for sharing the link, I tried drawing certain DFA diagrams and understood for the case when nth position from the left side of the string is fixed , the number of states is n+2.

But,

I could not deduce the same for the case when nth position from the right side of the string is fixed, the number of states is 2^n. Is there any way where you could show me via diagrams for certain number of n positions where we can generalize the concept of 2^n positions in DFA?