Seaching for Babylonian Triplets Slot Calculator Example

Searching for Babylonian Triplets Slot Calculator Example

This page is under development. Comments are welcome, but please load any comments in the comments section at the middle of the page. Please sign your user-name with the same courtesy that I will give you. Thanks,gold


gold Here is an eTCL script on searching for Babylonian triplets or triples. I have modified a slot calculator in eTCL to handle the search procedure for generating triplets. For now, the calculator works with a generating integer. Tap in N, eg. 1,2,3,...N and the sequence of a Babylonian triplet should be returned.

A clay tablet was discovered in Babylon giving examples of triplet numbers which were the sides of a triangle. eg. 3:4:5, While these clay findings predate Pythagoras, this page will use the accepted modern terminology and punctuation, where possible. Triplets include 3:4:5 and 8:15:17. One of the larger written triplets on the clay tablet was 3367:3456:4825. One paper indicated the order of the Babylonian terms was x?/c**2,a,c,d where c would be the hypotenuse, a the shortest side of a right triangle, and d is the line number (1-15). Given that a**2+b**2=c**2 >> b**2=c**2-a**2 >> b**2= (1-a**2)/c**2 for the right triangle, the first term may represent a solution step for b**2, either in the form of b**2/c**2 or (1-a**2)/c**2.

The calculator and buttons presented here are largely based on the Slot Calculator Demo. See The triplet algorithm was posted by Robert Simms, 11 June 1997, . The console script for triplets at the bottom of page shows what TCL can do in a few simple lines. The best thesis on the triplets was by E.C. Zeeman, referenced below. Another source of triplet info was Dr. Math of Mathforum, listed in refs.

In terms of pseudocode, should find the nearest even numbered power of 2 under N. Add 2**N + 1? for side. then find an odd power of three to add portion for side 3. Since powers of 2 and 3 can hog computer time, will limit searches to small N. (with limit statements in calculator.)

    pseudocode: count integers to N
    pseudocode: count powers of 2 along the way 
    and estimate if  conditions prevail.
    pseudocode:  find the highest and nearest
                 even numbered power of 2 under N.
    pseudocode:  then find an odd power of three
    Pseudocode:  add quantity to raise side.
    Pseudocode: take sqrt(c**2-a**2) to find remaining side
    pseudocode:  to zero
    pseudocode:  load results into 3 answer fields,
    pseudocode:  & zeros display

       Triplet a,b,c & angle in degrees
       from tablet Plimpton 232
       prob. from Senkereh
       ref.E.C.  Zeeman
       119,120,169, 44.8

Best guess is that these triplets were used in astronomy and geography. From Zeeman's paper, the triplets imply tangent ratios for angles descending from 44.8 to 31.8 degrees, in modern terms. From the example of the 3:4:5 triangle, the angle would be arctan (3/4) or 37.4 degrees. A few of the triplets seem to suggest latitudes of ancient cities, though not all.

  Conjectures on possible uses of triplets.
quantity North East
ancient citytriplet degreeslatitudeunitslongitudeunitswebsite
akkad 33.333.1degrees44.1degrees
babylon 32.536389degrees44.420833degrees
eridu31.330.815839degrees 45.996069degrees
Hattusa40.340.019722degrees 34.615278degrees
lagash 31.41139degrees 46.40722degrees
larsa 31.331.28583 degrees 45.85361 degrees
nippur 32.12694degrees 45.23083 degrees
susa 31.932.18922 degrees 48.257785 degrees
ur 30.9625 degrees46.10306degrees
uruk 31.32222degrees 45.63611degrees
umma 31.633degrees 45.867degrees
buildingtriplet degreesslopeunits website
N. Stone Pyramid,Eygpt 43.343.6 degrees
bent pyramid(2),Eygpt43.343.35 degrees
Temple of the Sun,Teotihuacán 31.932.494degrees

Another issue was the Babylonian tables of reciprocal or inverse numbers. This paragraph relies heavily on Melville's paper referenced below. In the Babylonian 60 base system, pairs of numbers like 2:30 have a product of 60 in base 10 and a product of 1 in base 60. Some inverse pairs are easy to remember and some are not. Some easy inverse pairs are 2:30,3:30,4:15,5:20;6:10,10:6. The Babylonians seem to have used these inverse tables for multiplication like the logarithm tables were used before the computer.

If one looks at the easy pairs found, there is an algorithm that would find some more inverse pairs. For example, a double operation on 2:30 of doubling the first number and having the second would produce would produce 4:15. Lets express the operation in pseudocode as

     pseudocode: 2*$first:$second*1/2.
     pseudocode: set first 4 ;
     set second 15;
     set salty 3
      set i 0
      while {$i <= $salty} {   
     set first  [>2.*$first];
     set second [>$second*(1./2.)]
     if { [expr {1.*$i} ] >= $salty} { break  }
     incr i 1;};#end

For the pair 4:15, the operation would produce 4:15 > alg. > 8:7+1/2 (base 10). In base 60, the Babylonian would write this new pair in fraction of base 60 as 8:7+30/60. However the Babylonian would not use punctuation, but would use blanks and implied fractions, something like 8 blank 7 blank 30 . In the first column of the clay tablet, there are numbers separated by blanks ( and broken off in some spots).

Of particular note is the Babylonian triplet 12709:13500:18548 Maybe, numerical coincidence, but the diameter of the earth at the poles is 12,756.1 km. Diameter of the earth at the equator is 12713.5 km. On occasion, the Sumerians used length units that seem equivalent to the meter and 10 kilometers. The step unit or sepu was equal to one meter. The Sumerians used unit of distance called a beru which was about 10.8 km, so some of the Sumerian measurement units were multiples of the kilometer. Earth's circumference between N&S poles is (40,008 km), as a km is defined... Makes one think about what the Babylonians were measuring?

After looking at the babylonian clay map, it was not too obvious how the circle overlapped the acute heptagon. There was one construction where the width of the do-nut seems to equal the diameter of the original circle. Anyway a "four leaf clover oriented + " was tried and seemed to work.

Trying to find some earlier estimates of earth's circumference from other cultures. Most of the early constants were given underived without sources. Scanty sources and circular reasoning , no good text reference, speculates that the Sumerians might have used 3600 beru as circumference, with the earth circumference as 3600*10.8 km. Given ~, the earth radius would be 573 beru 9_33,base 60) and diameter would be 1146 beru (19_6,base 60). Still trying to find out if "miles" on clay tablet BM 92687 are beru or else.

On sumerian clay tablet, there are 655200 "beru ina sama" summed up, akkadian for "beru in sky." This factors to 364*60*30. There are 86400 seconds in a day. There are 655200 beru in sky over 360 conventional degrees or 1820 per degree. The apparent disk of sun or moon was supposed to be 1000 beru (~to 0.5 degree). In conventional astronomy, a degree contains 60*60 or 3600 arcseconds. So a beru in sky may something like a double second (meaning double arcsecond). In modern constants, a double arcsecond would be equivalent to 1800/111.3km or 16.17 double arcseconds per km ( from one latitude degree equals 111.3 km). A sky triangle of one degree and an opposite side of 1800 would have a side of 1800/tan(1) or 103137.638. A second and almost equal side would be 1800/sin(1) or 103121.93. considerations for circle, 360*60*60=1296000 364*60*60=1310400, say 1310400/2=655200.

Arithmetic Classic of the Gnomon and the Circular Paths of Heaven reported triplet as follows.

60000 li 24948 km 15502.2 miles
80000 li 33264 km reputed altitude of sun
100000 li 41580 km reputed distance from measuring stick to sun

Chinese li was 0.4158 km (0.25837 miles). 2* babylonian 12709 =25418 Chen Zi of first century reported indirect numbers leading to earth diameter of 911489 li or 378997km. Still trying for original text, but it seems his li in the text has a factor of ten involved. Can only suggest Chen Zi's number for the earth circumference was 37900. km and implied constant was 105.27 km per degree, in modern terms. Eratosthenes third century BCE 46250 km Ptolemy c140CE 28800 km The giant of Chinese legend Pan Gu (or panku, ancient basin) held the earth and sky apart at 90000 li (45000 km). The Egyptians held that the N/S length of Egypt was 1/50 of the globe circumference. The Romans use 75 roman miles as eq to one degree of latitude. The Mogul era "Ain" states the earth's circumference was 8000 farsakh(1600CE). In some texts of Aryabhatiya, the diameter of the earth is mentioned as 3300 yojanams. Brahmagupta ( 7th c) wrote that the circumference of the earth was 36,000 km, in modern units.

The report button calls the eTCL console and adds some functions for inscribed circle. For testing, the triplet 3:4:5 has an inscribed circle of radius one. The radius one is usefull for checking common sphere and volume formulas since the number pi or multiples show obviously in the answer. Most of my functions repeat the input to be sure data being transferred correctly to procedures. Its always advisable to check at the low and high end of the expected inputs. The sphere of radius one is the low end. The big kahuna on the clay tablet was 12709:13500:18548 **console session** & The cir function take the three sides of a Babylonian triplet and returns various parameters of the triplet and inscribed circle. The form is cir aa bb cc.

   eg. cir 3 4 5
    1% cir 3 4 5
    3 side 1 
    4 side 2 
    5  side 3 
    1.0   radius on inscribed circle
    2.0 if available, diameter of circle
    6.283185307179586  if a., circumference of circle
    3.141592653589793  if a., area of circle
    4.1887902047863905  if a., volume of sphere
    12.566370614359172  if a., surface area of sphere
    3% cir 12709 13500 18548
    12709 side 1 
    13500 side 2 
    18548  side 3 
    3833.399264743218   radius on inscribed circle
    7666.798529486436 if available, diameter of circle
    24085.957936787614  if a., circumference of circle
    46165546.72275886  if a., area of circle
    235961297151.32327  if a., volume of sphere
    707883891453.97  if a., surface area of sphere  

Screenshots Section

figure 1.

Searching for Babylonian Triplets Slot Calculator Example screen.png

figure 2.

Searching for Babylonian Triplets Slot Calculator Example figure1.png

figure 3.

tangent angles in degrees from triplets

Searching for Babylonian Triplets Slot Calculator Example figure2.png

figure 4.

Searching for Babylonian Triplets Slot Calculator Example figure3.png

figure 5.

tangent angle differences in degrees from triplets

Searching for Babylonian Triplets Slot Calculator Example tangent diffs.png

figure 6.

alternate star Seaching for Babylonian Triplets Slot Calculator Example alternate star

figure 7.

possible construct for Babylonian world map

Seaching for Babylonian Triplets Slot Calculator Example screen.png

Comments Section

Please place any comments here, Thanks.

What is your purpose in binding the motion event on your main window to execute the wm title command. I.e., this line:

  bind . <Motion> {wm title . "Searching for Bablylonian Triplets"}

The result of that binding is that every time you move the mouse, the "wm title" subcommand is called repeatedly. To set the window title, you just need to call "wm title . title" once, not on every event update upon mouse pointer motion. gold changed to bare "wm title . title"


appendix TCL programs and scripts


Pretty Print VERSION

        # pretty print from autoindent & ased editor
        # searching for Babylonian triplets
        # code from TCL WIKI  Slot_Calculator_Demo
        # 6Aug2010, [gold]
        package require Tk
        proc positionWindow w {
            wm geometry $w +300+300
        set font  {Helvetica 18}
        set colorgrd seashell4
        set colorback bisque
        set colorwarning tomato1
        frame .frame -relief flat -bg aquamarine4
        pack .frame -side top -fill y -anchor center
        set names {{} {guess N:} {not used:} {not used:} {side1:} {side2:} {side3:} possible:}
        foreach i {1 2 3 4 5 6 } {
            label .frame.label$i -text [lindex $names $i] -anchor e
            entry .frame.entry$i -width 35 -textvariable side$i
            grid .frame.label$i .frame.entry$i -sticky ew -pady 2 -padx 1
        proc about {} {
            set msg "Calculator for Searching Babylonian Triplets.
            from TCL WIKI"
            tk_messageBox -title "About" -message $msg
        proc pi {} {expr acos(-1)}
        # 5 = 22 + 12, 13 = 32 + 22,  5 : 12 : 13,
        proc tripletxxx { xx1 yy1 xx3 yy3 xx2   } {
            global side4 side5 side6
            set max 1
            set salty  [expr {$xx1 + 5.}]
            set i 2
            while {$i <= $salty} {
                set max $i
                if { [expr {2.** $i} ] <= $xx1} { set power2   [expr {2**$i}]   }
                if { [expr {3.** $i} ] <= $xx1} { set pow2   $i }
                if { [expr {2.** $i} ] >= $xx1} { break  }
                incr i 2
            set max 1
            set j 0
            while {$j <= $salty} {
                set max $i
                if { [expr {3.** $j} ] <= $xx1} { set power3   [expr {3**$j}]   }
                if { [expr {3.** $j} ] <= $xx1} { set powerx   [expr {2**$j}]   }
                if { [expr {3.** $j} ] <= $xx1} { set pow3   $j }
                if { [expr {3.** $j} ] >= $xx1} { break   }
                incr j 1
            set side4 [expr {$power2+1.}]
            set side5 [expr {$power3+$powerx*1.}]
            set sidex [expr {sqrt($side5**2.-$side4**2.)}]
            set side5 $sidex
            set side6 [expr {$power3+$powerx*1.}]
            return $power2 ;}
        proc triplet { xx1   } {
            global side4 side5 side6
            set nn [ expr { int($xx1) } ]
            set tt [ expr {(int ((3.+sqrt(8.*$nn-7.))/2.))*1. }]
            set ss [ expr { $nn-($tt**2-3.*$tt+2.)/2    } ]
            set side5  [ expr {2.*$ss*$tt   } ]
            set side4  [ expr {$tt**2-$ss**2   } ]
            set side6  [ expr {$tt**2+$ss**2  } ]
        proc calculate {     } {
            global answer2   
            global side1 side2 side3 side4 side5 side6 
            set answer2  [ triplet  $side1   ]
            set pi5 [pi]
            if {$answer2 >= $pi5} { set error5   [expr {100.*$answer2/$pi5-100.}]   }
            if {$answer2 <= $pi5} { set error5   [expr {100.*$pi5/$answer2-100.}]   }
            #$x insert 1.0 " % error $error5 "
            #$t insert 1.0 " % error  $error5 "
        proc fillup {aa bb cc dd ee ff } {
            .frame.entry1 insert 0 "$aa"
            .frame.entry2 insert 0 "$bb"
            .frame.entry3 insert 0 "$cc"
            .frame.entry4 insert 0 "$dd"
            .frame.entry5 insert 0 "$ee"
            .frame.entry6 insert 0 "$ff "
        proc clearx {} {
            foreach i {1 2 3 4 5 6 } {
                .frame.entry$i delete 0 end
        proc pi {} {expr acos(-1)}
        proc inrad {a b c} {return  [expr {(sqrt(($a+$b+$c)*($a+$b-$c)*($a-$b+$c)*($b+$c-$a)))/(2.*($a+$b+$c)) } ] }
        proc pol { xx1 yy1 xx3 yy3 xx2   } {
            return [expr {  ((($xx2-$xx1)*($yy3-$yy1))/($xx3-$xx1))+ $yy1 } ] ;}
        proc cir { aa bb cc } {
            set radius [inrad  $aa $bb $cc  ]
            set cirdiameter [ expr { 2.* $radius }]
            set circlearea [ expr { [pi]*($radius**2) }]
            set circlecircum [ expr {2.*[pi]*$radius }]
            set spherevol [ expr { (4./3.)*[pi]*($radius**3) }]
            set spheresurface [ expr { 4.*[pi]*($radius**3) }]
            puts "$aa side 1 "
            puts "$bb side 2 "
            puts "$cc  side 3 "
            puts "$radius   radius on inscribed circle"
            puts "$cirdiameter if available, diameter of circle"
            puts "$circlecircum  if a., circumference of circle"
            puts "$circlearea  if a., area of circle"
            puts "$spherevol  if a., volume of sphere"
            puts "$spheresurface  if a., surface area of sphere"
        proc reportx {} {
            console show;
            puts "
            & The interpolation function takes
            two know points on a line and
            solves for an intermediate point.
            The points are xx1,yy1,xx2,yy2 and xx3,?yy3?
            The interpolation function loaded as
            proc pol. User should be able
            to cut and paste (c&p)
            pol 50. 1000. 200. 1200. 150.
            and save answer (1133.3) on console.
            & The inrad function take the three
            sides of a Babylonian triplet
            and returns the radius of the
            inscribed circle.
            The form is inrad aa bb cc.
            eg. inrad 3 4 5
            & The cir function take the three
            sides of a Babylonian triplet
            and returns various parameters of the
            triplet and inscribed circle.
            The form is cir aa bb cc.
            eg. cir 3 4 5
        frame .buttons -bg aquamarine4
        ::ttk::button .calculator -text "Solve" -command { calculate   }
        ::ttk::button .test2 -text "Testcase1" -command { clearx;fillup 1. 4. 5. 3.  4. 5. }
        ::ttk::button .test3 -text "Testcase2" -command { clearx;fillup  3. 12. 13. 5.  12. 13. }
        ::ttk::button .test4 -text "Testcase3" -command { clearx;fillup 6. 24. 25. 7.  24. 25. }
        ::ttk::button .clearallx -text clear -command {clearx  }
        ::ttk::button .about -text about -command about
        ::ttk::button .report1 -text report -command { reportx }
        ::ttk::button .exit -text exit -command {exit}
        pack .calculator  -in .buttons -side top -padx 10 -pady 5
        pack  .clearallx .about .report1 .exit .test4 .test3  .test2   -side bottom -in .buttons
        grid .frame .buttons -sticky ns -pady {0 10}
        . configure -background aquamarine4 -highlightcolor brown -relief raised -border 30
        wm title . "Searching for Bablylonian Triplets"