My daughter is studying computing at university - as I'm a programmer she is coming to me for help but I'm struggling with some of the maths she is asking me.
She's asking me for help in converting 0.9 in binary to decimal form. First I had an issue as 0.9 isn't actually representable in binary accurately - but now her tutor has advised to use 0.1110012 as an approximation.
I can convert this in excel or in python, but to show her how to do it by hand is beyond me. Can someone help with a simple explainer to me that I can relay?
You can evaluate the term like $$ (0.d_1 d_2 d_3 \dotsb)_2 = \sum_{k=1}^{\infty} d_k 2^{–k} = \sum_{k=1}^{\infty} \frac{d_k}{2^{k}} $$ so $$ (0.111001)_2 = \frac{1}{2}+\frac{1}{4}+\frac{1}{8}+\frac{1}{64}= \frac{32+16+8+1}{64}= \frac{57}{64}= 0.890625 $$ The precise binary representation of $0.9$ has infinite many digits $$ (0.1\overline{1100})_2 = (0.1)_2 + (0.0\overline{1100})_2 = \frac{1}{2} + \frac{1}{2} (0.\overline{1100})_2 = \\ \frac{1}{2} + \frac{1}{2} \left( 12 \sum_{k=1}^{\infty} \frac{1}{16^k}\right) = \frac{1}{2} + 6 \left( -1 + \frac{1}{1–\frac{1}{16}} \right) = \frac{1}{2} +\frac{6}{15} = \frac{9}{10} = 0.9 $$ where the bars indicate repetition and we used the formula for a geometric series $$ \sum_{k=0}^{\infty} q^k = \frac{1}{1-q} \quad (\lvert q \rvert < 1) $$