News for hackers. Stuff that matters.
Re:Pythagorean Theorem Found on Clay Tablet 1k Years Older T... by the_origami_fox on Thursday October 05, 2023 @06:17AM (#37776795)
For anyone wondering how they got the approximation sqrt(2)=1+24/60+51/60^2+10/60^3.

It's based on the simple idea that:

     Z = (a + b)^2 = (a^2 + (2a+b)*b)
  => (2a+b)* b < Z-a^2
Given an initial estimate "a", we need to find the largest "b" such that the term on the left is less than the term on the right. Therefore our estimate will always be slightly less than the actual answer and we can repeat the process to get slightly closer.

For the first iteration, Z=2 and a=1. We choose b=x/60:

  (2+x/60)*x/60 < 2-1^2
  120x + x^2 < 3600
  x = 24 ... 3456 < 3600
  x = 25 ... 3625 > 3600
So our first term is 24/60.

Repeat with a=1+24/60 and b=x/60^2:

  (2(1+24/60)+x/60^2)*x/60^2< 2-(1+24/60)^2
  10080x+x^2 < 518_400
  x = 51 ... 516_681 < 518_400
  x = 52 ... 526_864 > 518_400
Repeat multiple times.

Writing this in code I can easily get: 1;24,51,10,7,46,6,4,44,50,28 = 1.4142135623730951

This whole process can be codified into the long division algorithm for square roots which works quite neatly with base 10.

Edit: formatting

Re:Pythagorean Theorem Found on Clay Tablet 1k Years Older T... by PretzelPirate on Thursday October 05, 2023 @10:35AM (#37779130)
Why do you choose b=x/60 for the first iteration? That isn't obvious to me, but 60 must be an obvious choice to be chosen.
Re:Pythagorean Theorem Found on Clay Tablet 1k Years Older T... by zeroonetwothree on Thursday October 05, 2023 @11:07AM (#37779577)
You can choose any integer > 1

For example if you choose 2 you will get the binary expansion.

Re:Pythagorean Theorem Found on Clay Tablet 1k Years Older T... by the_origami_fox on Friday October 06, 2023 @02:54AM (#37787880)
And if you choose b=x/10, x/100, x/1000 ... then each iteration will add the exact decimal point.
Re:Pythagorean Theorem Found on Clay Tablet 1k Years Older T... by gleapsite2 on Thursday October 05, 2023 @11:16AM (#37779680)
Base 60 was the number system for the Sumarians/Babylonians.

> Sexagesimal, also known as base 60 or sexagenary, is a numeral system with sixty as its base. It originated with the ancient Sumerians in the 3rd millennium BC, was passed down to the ancient Babylonians, and is still used—in a modified form—for measuring time, angles, and geographic coordinates.

Re:Pythagorean Theorem Found on Clay Tablet 1k Years Older T... by LombardBaker on Thursday October 05, 2023 @12:39PM (#37780804)
what evidence do you have that this is how they got it?