Almost Sure and Mean Square Convergence (Check My Answer) Let $X_n$ be a random variable sequence defined as below
$$
P(X_n=x_n)=
\begin{cases}
1-\left(\dfrac{1}{2}\right)^n&\text{for }x_n=0 \\
\left(\dfrac{1}{2}\right)^n&\text{for }x_n=1
\end{cases}
$$
for $n=1,2,3,\ldots$.
(a) Show that $X_n$ almost sure converges.
(b) Show that $X_n$ mean square converges.
(a) $$
\lim\limits_{n\to\infty} P(X_n=0) =\lim\limits_{n\to\infty}\left( 1-\left(\dfrac{1}{2}\right)^n\right) = 1-0 = 1.
$$
$$
\lim\limits_{n\to\infty} P(X_n=1) =\lim\limits_{n\to\infty}\left(\dfrac{1}{2}\right)^n= 0.
$$
So, I conclude that $X_n=0$ is almost sure convergent, but $X_n=1$ is not almost sure convergent.
Is it true? Please check my answer.
(b)
$$
\lim\limits_{n\to\infty} E\left((X_n-X)^2\right) = \lim\limits_{n\to\infty} E\left(X_n^2-2X_nX+X^2\right)
=
\lim\limits_{n\to\infty} E\left(X_n^2)-2E(X_nX)+E(X^2)\right).
$$
I know how to check mean square convergence, is 
$$\lim\limits_{n\to\infty} E\left((X_n-X)^2\right)=0.$$
Now, I confuse about $E(X)$. How to find $E(X)$? 
 A: I guess you are a beginner in this topic, so I'll write my answer as clearly as possible. You must have missed something during your study about the convergence of random variables. The terms in my answer are based on this Wikipieda page.
For (a), what you proved is that $X_n$ converges to $0$ in probability. But your "conclusion" I conclude that $X_n=0$ is almost sure convergent, but $X_n=1$ is not almost sure convergent does not make any sense. Think carefully about that.
Now I move to the proof of your problem.
(a) Since 
$$\sum_{n=1}^\infty P(|X_n|>0)=\sum_{n=1}^\infty \left(\frac12\right)^n<\infty,$$
we know that $P(\limsup_{n\to\infty}\{|X_n|>0\})=0$ by Borel-Cantelli lemma. This implies that $P(\text{events }\{|X_n|>0\} \text{ take place only for finitely many times})=1,$ which means that $X_n$ converges to $0$ almost surely.
(b) In this case $X=0$ so $E((X_n-X)^2)=E(X_n^2)=(\frac12)^n\to 0$. Therefore $X_n$ converges to $0$ in mean square.
A: You cannot prove almost sure convergence by just showing that $P(X_n=0) \to 1$ and $P(X_n=1) \to 0$. Note that $\sum_m P(X_n \neq 0)=\sum_n \frac 1 {2^{n}} <\infty$. By  Borel Cantelli Lemma this implies that with probability $1$ the sequence $(X_n)$ becomes $0$ after some stage. Hence $X_n \to 0$ almost surely. 
Also $EX_n^{2}=\frac 1 {2^{n}} \to 0$ so $X_n \to 0$ in mean square. 
