StonedPanda said:
I've never covered converting things to binary and other number systems before, and in a chapter about sequences the book mentions binary and has an exercise to convert the square root of two to six decimal places.
sqrt(2) = 1.4142135623730950488016887242097
First convert the integer part to binary. That's easy. 1 converts to 1.
Now take the remainder, and multiply it by 2 a bunch of times, each time keeping the integer part (which will be zero or one) as the binary bit:
1.4142135623730950488016887242097
.
0.8284271247461900976033774484194
1.6568542494923801952067548968388
1.3137084989847603904135097936776
0.62741699796952078082701958735517
1.2548339959390415616540391747103
0.50966799187808312330807834942068
1.0193359837561662466161566988414
0.038671967512332493232313397682708
0.077343935024664986464626795365416
0.15468787004932997292925359073083
0.30937574009865994585850718146166
0.61875148019731989171701436292333
1.2375029603946397834340287258467
0.47500592078927956686805745169332
0.95001184157855913373611490338664
1.9000236831571182674722298067733
1.8000473663142365349444596135466
1.6000947326284730698889192270931
1.2001894652569461397778384541862
0.40037893051389227955567690837245
0.8007578610277845591113538167449
...
That should be enough for 6 decimal places. The answer is read off the left hand column, namely (and rounding the last bit):
sqrt(10) = 1.011010100000100111101
To check this, just convert it into decimal and square it. Yep, it works.
Another fun thing to do: Figure out what sqrt(2) is to six decimal places written out in base "pi".
Carl