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??
 A: $$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$.
A: There are several problems with your question and the supposed "correct" answer.


*

*You have not defined what "$T$" is.

*The probabilities do not add to unity (which makes the supposedly "correct" answer incorrect).

*Your calculation of the mean and variance (using your approach) is incorrect.  
If we solve Problem 1 and define $T$ as the number of tosses made, where we assume that the tosser will never toss more than four times (i.e. if he/she gets four consecutive heads, no more tosses are made), then the probability distribution of the random variable $T$ is given by
$P(T=1)=1/2, P(T=2)=1/4, P(T=3)=1/8, P(T=4)=1-1/2-1/4-1/8=1/8$, where the last probability is calculated as such because if the tosser does not toss it once, twice, or thrice, he/she will necessarily toss it four times since he/she will not exceed tossing it four times as per his/her rule. This solves Problem 2.
Regarding problem 3, the expected value or mean is the probability-weighted (not equally weighted) average of the values that the random variable takes.  The variance is the mean of the squared deviations between the values that the random variable takes and its mean. In mathematical terms,for random variable $X$ with probability distribution $P(x)$ for $x\in X$,
$E(X)=\sum_{x\in X} x P(x)$
$Var(X)=E(X-E(X))^2=\sum_{x\in X} (x-E(X))^2 P(x)$
The mean is then given by $E(X)=1*1/2+2*1/4+...$ and variance by $1/2*(1-E(X))^2+1/4*(2-E(X))^2+...$.  The variance can also be calculated using the approach your answer key has using the identity: $Var(X)=E(X-E(X))^2=E(X^2)-(E(X))^2$
