26
May 04

Our sister blog

Proven By Science4 comments • 700 views

Our sister blog Pumpkin Publog just hit on my party trick: figuring out what a fraction is based on the first few places of the decimal version. It can be done pretty quickly with a bit of spare paper and a calculator that supports x->1/x (or if you’re hardcore and the numbers are small, log tables).

First, the science bit: It’s based on a method by Euler (I think) for finding the highest common factor (HCF) of two integers: you take the larger one, and subtract the little one from it until you you get to the remainder. You write down “big number is made out of this many of small number and one remainder) then because it’s smaller, you switch and continue. Eventually, you get down to an integer and zero, so everything further up the chain must be a combination of the two numbers, IE a multiple of the HCF.

Next: the other science bit: you have this string of digits, so you keep inverting it and subtracting the integer parts:

0.566265 = a1/a0
a0 = 1.765958 * a1, so say a0 = a1 + a2 -> a2 = .765958 * a1. now invert
a1 = 1.305555 * a2, so say a1 = a2 + a3 -> a3 = .305555 * a2. “”
a2 = 3.272731 * a3, so say a2 = 3*a3 + a4 -> a4 = .272731 * a3
a3 = 3.666666 * a4, and we can go on, but we can see where this is going, and in fact we’re there already.

a3 = 11/3 * a4, so because we’re looking for numbers without common factors, we’ll stick to a3 = 11 and a4 = 3. and work our way back up the chain 3->11->36->47->83. All you need to jot down is the bits left of the decimal point: 1,1,3,(3,1,2 would be the numbers you get next) then stick in the numbers as you go back up.

Superfast way: this takes two columns of numbers, atarting with 1 0(after infinity, everything’s a good guess). The first time you get a number left of the decimal point, write it down below 1, and write 1 below 0. From then on, instead of writing these whole numbers down, just mutiply them by the bottom row and add the top row. Your approximation will get better with each step.

start: 1  0
1:     1  1
1:     2  1
3:     7  4
3:     23 13
1:     30 17
2:     83 47

And we’re there.

Because you can stop when you want, this is a great way of finding approximations of irrational numbers: for pi you get the old standard 22/7 immediately, then a couple of places down 113/355, accurate to six decimal places, and you only have to remember the first three odd numbers.

Note: if you actually try this example and don’t stop at the point where it becomes “obvious”, you’ll find a problem: instead of 3.666 -> 1.5 -> 2.0, the last number comes in at slightly less than two, and then then next one comes in at slightly more than 1, then the tiny remainder inverts to 2410! But that’s what you’d expect: 1,1,3,3,1,1,2410 is exactly the right sequence for 566265/1000000, which is the actual number we started from. But in practice machine error will creep in, and you won’t hit the eventual integer exactly, so you’ll have to decide yourself at what point to take the numerator and run.

Comments

  1. 1
    JerryGreen on 2 May 2007 #

    How green is the grass on the other side of the fence?
    Not much. Don’t believe it I tell you.
    Jerry

  2. 2
    Tanya on 3 May 2007 #

    What a party piece!

    I want to go to one of these parties!

  3. 3
    Andrew Farrell on 3 May 2007 #

    Slick.

  4. 4
    JosesKaraoke on 22 Aug 2007 #

    Just a short note to say I like your blog.

    Good job and keep up the great work!

    Kenneth

Add your comment

(Register to guarantee your comments don't get marked as spam.)


Required

Required (Your email address will not be published)

Top of page