\(M=\frac{1}{2}+\frac{1}{4}+\frac{1}{8}+...+\frac{1}{512}\)
\(2M=1+\frac{1}{2}+\frac{1}{4}+...+\frac{1}{256}\)
\(2M-M=\left(1+\frac{1}{2}+\frac{1}{4}+...+\frac{1}{256}\right)-\left(\frac{1}{2}+\frac{1}{4}+\frac{1}{8}+...+\frac{1}{512}\right)\)
\(M=1-\frac{1}{512}=\frac{511}{512}\)