<s>[INST] Variance of a Fair Coin Consider Vamshi decides to toss a fair coin repeatedly until he gets a tail. He makes atmost $4$ tosses.The value of variance $T$ is ($T$ denoted number of tosses) ______

I tried like this Standard Deviation on marks of students
$x-----1 ----- 2 ------3-----4$
$P(x)----\frac{1}{2}-----\frac{1}{4}------\frac{1}{8}----\frac{1}{16}$
Mean is $\frac{1}{4}\left ( \frac{1}{2}+\frac{1}{2^{2}}+\frac{1}{2^{3}} +\frac{1}{2^{4}}\right )=\frac{15}{64}$
So, variance will be,
$\frac{1}{4}\left [ \left ( \frac{15}{64}-\frac{1}{2} \right )^{2}+\left ( \frac{15}{64}-\frac{1}{4} \right )^{2}+\left ( \frac{15}{64}-\frac{1}{8} \right )^{2} +\left ( \frac{15}{64}-\frac{1}{16} \right )^{2}\right ]=$$\frac{460}{16384}$

But answer given like this 
$E\left ( X^{2} \right )=1^{2}\times \frac{1}{2}+2^{2}\times \frac{1}{4}+3^{2}\times \frac{1}{8}+4^{2}\times \frac{1}{16}$
$E\left ( X \right )=1\times \frac{1}{2}+2\times \frac{1}{4}+3\times \frac{1}{8}+4\times \frac{1}{16}$
$V\left ( X \right )=E\left ( X^{2} \right )-\left ( E\left ( X \right ) \right )^{2}$$=\frac{252}{256}$

Why my approach is giving incorrect result??
 [/INST] $$P(X=4)=1-P(X\le3)=\frac18\ne\frac1{16}$$ It is clear that one of the probabilities must be wrong as you currently don't have $\sum_{\forall x} P(X=x)=1$.
</s>