**Babylonian Brothers Inheritance Problems Algorithm and eTCL demo example calculator, numerical analysis** This page is under development. Comments are welcome, but please load any comments in the comments section at the bottom of the page. Please include your wiki MONIKER in your comment with the same courtesy that I will give you. Its very hard to reply intelligibly without some background of the correspondent. Thanks,[gold] ---- <> [gold] Here is some eTCL starter code for Brothers Inheritance Problems Algorithm in calculator shell. The initial console program was used to check the false shares concept and generate testcases before loading the calculator shell. The eTCL calculator used Babylonian single false position methods for the brother inheritance problem, but that is probably not the only method the Babylonians could use. The Babylonians did not use algebra notation, so the reader will have to bear some anachronisms in the eTCL pseudocode. Generally, the brothers inherit land or silver pieces in arithmetic progression with the eldest brother receiving the greatest share and the youngest brother the least. In the extant problems, the number (n) of brothers range from 3 to 10 brothers. Each brother received an integral fraction of his next elder in a stair step fashion. The nominal fraction was 1/. The share of the younger brothers would be x-x/n or x*(1-1/n) in succession. The normal solution was presented from elder brother to youngest brother and lowest amount, down the staircase. However, there are some brother inheritance solutions that are presented youngest to elder brother, up the staircase. In some cases, the beginning or setup of the problem is available, without a worked method of solution. The most consistent error check should be that the sum of the brother shares should equal the original bequest. The eTCL calculator computes a false share for each brother, sums the false shares, and rescales the false shares for the solution. Since the Babylonian problem is set up for integer fractions, the initial false share for elder brother is set to be factored by 1/n. Allowing for multiplication by 1/n or dividing n times for the number (n) of the brothers, the initial false share is set to n**n in the eTCL code (for the eldest brother). From an initial false share of n**n, the share x*(1-1/n) for successive brothers is calculated in an iterative solution. The stored shares are summed and the scale factor used for the false shares is real_estate over the sum of false shares. Algebraic peg points for the brother shares and solution can be developed. The ratio of brother n-1 over n is < x*(1-1/n)*(1-1/n) > / . The share of brother n-1 is ratio < x*(1-1/n)*(1-1/n) > / times the share of brother n. The average of brother n-1 and n is << x*(1-1/n)*(1-1/n) > * > / 2. The average of two brothers shares reduces to (1-1/n)/2. The average share for all brothers is real_estate / number of brothers, which should be in order of magnitude with the elder shares. For the initial testcase of 5 brothers, some approximate formulas were developed. The average share for all 5 brothers was 60/5 or 12. The exact fraction for younger brother5 was or 0.40960. The share of younger brother5 was elder brother1 times 0.409 was 7.2802 ( for youngest brother5). The average share between eldest and youngest is (17.85+7.3)/2 or 12.575. Within an order of magnitude , the average share between eldest and youngest approximates the average share for all 5 brothers. By observation, the average share for all 5 brothers equaled int (average share between eldest and youngest brother ). The ratios for real_estate/ number_brothers approximated (brother1 + brother5) /2. Rearranging terms, brother1 approximated 2*(real_estate/ number_brothers ) - brother5. Rearranging terms, brother5 approximated 2*(real_estate/ number_brothers ) - brother1. ---- **Pseudocode Section** ====== # using pseudocode # possible problem instances, 3 to 10 brothers initialize algorithm_result = 1. nominal fraction was 1/ eldest share is n**n, so factorable n times in Babylonian integer math share of the younger brothers would be x-x/n or x*(1-1/n) in succession. ??? code [expr xxx*(1.-1./5.)*(1.-1./5.)*(1.-1./5.)*(1.-1./5.)*(1.-1./5.)], ?.32768? scale factor = real_estate over the sum of false shares check algorithm check_sum = a+b+c+d+e = original real estate set answers and printout with resulting values pseudocode: need test cases > small,medium, giant pseudocode: need testcases within range of expected operation. pseudocode: are there any cases too small or large to be solved? [expr (1.-1./5.)*(1.-1./5.)*(1.-1./5.)*(1.-1./5.)] =0.40960 elder brother1 * 0.409 = 7.2802 ( youngest brother5) average share for all 5 brothers = 60/5 = 12 average share between eldest and youngest is (17.85+7.3)/2 or 12.575 theorem that average share for all 5 brothers = int (average share between eldest and youngest ) within order of magnitude , average share between eldest and youngest ~~ average share for all 5 brothers real_estate/ number_brothers ~~~ (brother1 + brother5) /2 brother1 ~~ 2*(real_estate/ number_brothers ) - brother5 brother5 ~~ 2*(real_estate/ number_brothers ) - brother1 ====== ***Testcases Section*** In planning any software, it is advisable to gather a number of testcases to check the results of the program. The math for the testcases can be checked by pasting statements in the TCL console. Aside from the TCL calculator display, when one presses the report button on the calculator, one will have console show access to the capacity functions (subroutines). **** Testcase 1 **** %|table 1|printed in| tcl wiki format|% &| quantity| value| comment, if any|& &| 1:|testcase_number | |& &| 60.0 :|initial real estate | |& &| 5.0 :|number of brothers | |& &| 5.0 :|less fraction 1/b (usually number of brothers) | |& &| 17.848 :|answers: elder brother | |& &| 14.278 :|2nd brother | |& &| 11.423 :|3ird brother | |& &| 9.138 :|4th brother | |& &| 7.310 :|5th brother | |& **** Testcase 2 **** &| 2:|testcase_number | |& &| 120.0 :|initial real estate | |& &| 5.0 :|number of brothers | |& &| 5.0 :|less fraction 1/b (usually number of brothers) | |& &| 35.697 :|answers: elder brother | |& &| 28.557 :|2nd brother | |& &| 22.846 :|3ird brother | |& &| 18.277 :|4th brother | |& &| 14.621 :|5th brother | |& **** Testcase 3 **** &| 3:|testcase_number | |& &| 3600.0 :|initial real estate | |& &| 5.0 :|number of brothers | |& &| 5.0 :|less fraction 1/b (usually number of brothers) | |& &| 1070.918 :|answers: elder brother | |& &| 856.734 :|2nd brother | |& &| 685.387 :|3ird brother | |& &| 548.310 :|4th brother | |& &| 438.648 :|5th brother | |& **** Testcase 4 **** ====== 4 brothers receive 60? at fraction (1-1/7) elder brother has 7*3 for false share. brother brother4 inherits 294.0 (elder brother) brother brother3 inherits 252.0 brother brother2 inherits 216.0 brother brother1 inherits 185.142 (youngest brother) sum of false shares is 1105.836 scale factor for false shares is 0.0332 elder brother's share is (7**3)*(36.8 / 1105.836) answer = 11.414 younger brother's share is last*(36.8 / 1105.836) answer = 5.281 # hand calculations follow (good) [expr (1.-1./7.)*(1.-1./7.)*(1.-1./7.)]= 0.6297 youngest brother4 = [expr 0.6297* 11.433]= 7.1993 1st brother[expr (5.*60+43.)*(2./60.)] = 11.433 2nd brother=[expr (4.*60+54.)*(2./60.)]= 9.8 3ird brother=[expr (4.*60+12.)*(2./60.)]=8.4 4th brother=[expr (3.*60+36.)*(2./60.)]= 7.2 [expr 11.43+9.8+8.4+7.2] = 36.830 ====== **** Testcase 4 **** ====== 10 brothers receive 100? at fraction (1-1/10)? brother brother10 inherits 900.0 false shares brother brother9 inherits 810.0 false shares brother brother8 inherits 729.0 false shares brother brother7 inherits 656.10000000000002 false shares brother brother6 inherits 590.49000000000001 false shares brother brother5 inherits 531.44100000000003 false shares brother brother4 inherits 478.29690000000005 false shares brother brother3 inherits 430.46721000000002 false shares brother brother2 inherits 387.42048900000003 false shares brother brother1 inherits 348.67844010000005 false shares sum of false shares is 5861.8940391000006 scale factor for false shares is 0.017059332586529214 elder brother's share is (10**3)*(100. / 5861.894) 17.059332586529216 younger brother's share is last*(100. / 5861.894) 5.9482214754181051 # hand calculations follow (good) average = 120/10 = 12 [expr (1.-1./10.)*(1.-1./10.)*(1.-1./10.)*(1.-1./10.)*(1.-1./10.)*(1.-1./10.)*(1.-1./10.)*(1.-1./10.)*(1.-1./10.)]= 0.38742 = factor for youngest brother. 8th brother cited as 8 silver pieces 8th brother calculated as 430.46*0.01705 or 7.3 silver pieces as computer solution stands above. elder brother1 approximates [expr 2*(100./10.)-3.] or 17, order of magnitude This problem has factor 1+1/n omitted or obscured, Another problem cited factor of eleventh part or algebraic 1+1/11. Maybe this factor should be 11 instead of 10. Note that the 1+1/n factor may be set at a prime number, even when there are 4 brothers, the factor is seventh or 1+1/7. ====== **** Testcase 5 **** ====== 4 brothers receive 72? at fraction (1-1/6)? This problem has the inheritance omitted or obscured. However, almost certain number is 1 mina (60 bucks) and some 1/6 fraction multiple, like 72 silver pieces. Solution is not repeat not given. brother brother4 inherits 213.333 false shares brother brother3 inherits 177.777 false shares brother brother2 inherits 148.148 false shares brother brother1 inherits 123.456 false shares sum of false shares is 662.716 scale factor for false shares is 0.108 elder brother's share is (10**3)*(72. / 662.716) 27.812 silver pieces for elder brother younger brother's share is last*(72. / 662.716) 13.412 silver pieces for youngest brother # hand calculations follow (good) average = 72/4 = 18 silver pieces [expr (1.-1./6.)*(1.-1./6.)*(1.-1./6.)] or fraction 0.5787037 for youngest brother elder brother1 approximates [expr 2*(72./4.)-3.] or 33 silver pieces, order of magnitude younger brother4 approximates [expr 33*.5787] or 19.097 silver pieces, order of magnitude ====== ---- ***Screenshots Section*** ****figure 1.**** [Babylonian Brothers Inheritance Problems Algorithm and eTCL demo example screenshot png] ---- ***References:*** * The Algebra of Inheritance: A Rehabilitation of Al-Khuwarizmi, * Solomon Gandz Source: Osiris, Vol. 5 (1938), pp. 319-391 * A Note to Kazuo Muroi, Inheritance Problems in * Susa Mathematical Text No. 26, Jens Hoyrupt * Mathematical Cuneiform Texts, Neugebauer and Sachs * Extraction of Cube Roots in Babylonian Mathematics, Kazuo Muroi, Centaurus Volume 31, issue 3, 1988 * Babylonian Mathematical Texts II-III Author(s): A. Sachs Source: Journal of Cuneiform Studies, Vol. 6, No. 4 * (1952), pp. 151-156 Published by: The American Schools of Oriental Research * Computing the Cube Root, Ken Turkowski, Apple Computer Technical Report #KT-32 10 February 1998 * Approximating Square Roots and Cube Roots , Ali Ibrahim Hussenom, 2014/11/04 * Aryabhata’s Root Extraction Methods, Abhishek Parakh , Louisiana State University, Aug 31st 2006 * Another Method for Extracting Cube Roots, Brian J. Shelburne, * Dept of Math and Computer, Science Wittenberg University * Jeanette C. Fincke* and Mathieu Ossendrijver* BM 46550 – a Late Babylonian Mathematical Tablet with * Computations of Reciprocal Numbers,Zeitschrift für Assyriologie 2016; 106(2): 185–197 * Interpretation of reverse algorithms in several mesopotamian texts, Christine Proust * A Geometric Algorithm with Solutions to Quadratic Equations * in a Sumerian Juridical Document from Ur III Umma * Joran Friberg, Chalmers University of Technology, Gothenburg, Sweden * google search engine * Wikipedia search engine * mathworld.wolfram.com, Trapezoid and right trapezoid * Mathematical Treasure: Old Babylonian Area Calculation, uses ancient method * Frank J. Swetz , Pennsylvania State University * Wikipedia, see temple of Edfu, area method used as late as 200 BC in Egypt. * [Oneliner's Pie in the Sky] * [One Liners] * [Category Algorithm] * [Babylonian Number Series and eTCL demo example calculator] * [Brahmagupta Area of Cyclic Quadrilateral and eTCL demo example calculator] * [Gauss Approximate Number of Primes and eTCL demo example calculator] * Land surveying in ancient Mesopotamia, M. A. R. Cooper * [Sumerian Approximate Area Quadrilateral and eTCL Slot Calculator Demo Example , numerical analysis] * Thomas G. Edwards, Using the Ancient Method of False Position to Find Solutions * Joy B. Easton, rule of double false position * Vera Sanford, rule of false position * www.britannica.com, topic, mathematics trapezoid * [Sumerian Equivalency Values, Ratios, and the Law of Proportions with Demo Example Calculator] * [Babylonian Sexagesimal Notation for Math on Clay Tablets in Console Example] * Babylonians Tracked Jupiter With Advanced Tools: Trapezoids, Michael Greshko, news.nationalgeographic.com * Geometry in Babylonian Astronomy, Cluster of Excellence Topology, Humboldt University of Berlin * Mathieu Ossendrijver: „Ancient Babylonian astronomers calculated Jupiter’s position * from the area under a time-velocity graph“, in: Science, January 29, 2016. * Late Babylonian Field Plans in the British Museum, books.google.com/books * Karen Rhea Nemet-Nejat * Late Babylonian Surface Mensuration Author(s): Marvin A. Powell Source: jstor * translation: trapezoid in two babylonian astronomical cuneiform * texts for jupiter (act 813 & act 817) from the seleucid era , 310 BC -75 AD * Otto Neugebauer, Astronomical Cuneiform Texts, 3 Vols. * Lund Humphreys, London, 1955:405,430-31. * DeSegnac, MS 3908 A RE-CONSTRUCTION, D.A.R. DeSegnac * A draft for an essay * DeSegnac, MENTAL COMPUTING OF THREE ARCHAIC * MESOPOTAMIAN PUZZLES W 20044, 35, W 20044, 20 & W 20214, essay draft * DeSegnac, HARMONY OF NUMBERS I and II, D.A.R. DeSegnac, A draft for an essay ---- **Appendix Code** ***appendix TCL programs and scripts *** ====== # pretty print from autoindent and ased editor # Babylonian Brothers Inheritance Problems Algorithm calculator # written on Windows XP on eTCL # working under TCL version 8.5.6 and 1.0.1 # gold on TCL WIKI, 25jan2017 package require Tk package require math::numtheory namespace path {::tcl::mathop ::tcl::mathfunc math::numtheory } set tcl_precision 17 frame .frame -relief flat -bg aquamarine4 pack .frame -side top -fill y -anchor center set names {{} { initial estate :} } lappend names { number of brothers (b) :} lappend names { next brother etc, his elder share less fraction (usually 1/b ) : } lappend names { answers: elder brother : } lappend names { 2nd brother :} lappend names { 3ird brother : } lappend names { 4th brother : } lappend names { 5th brother :} foreach i {1 2 3 4 5 6 7 8} { 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 Babylonian Brothers Inheritance Problems Algorithm from TCL WIKI, written on eTCL " tk_messageBox -title "About" -message $msg } proc calculate { } { global answer2 global side1 side2 side3 side4 side5 global side6 side7 side8 global testcase_number incr testcase_number set side1 [* $side1 1. ] set side2 [* $side2 1. ] set side3 [* $side3 1. ] set side4 [* $side4 1. ] set side5 [* $side5 1. ] set side6 [* $side6 1. ] set side7 [* $side7 1. ] set side8 [* $side8 1. ] set real_estate $side1 set number_of_brothers $side2 set fraction2 $side3 # initialize placeholder answer set result 1. set side4 0. set side5 0. set side6 0. set side7 0. set side8 0. set brothers $number_of_brothers set decrement [/ 1. $brothers ] set inheritance [** $number_of_brothers $number_of_brothers] set keeper [int [- $number_of_brothers 1] ] set i [int $number_of_brothers ] set total_false_position 0. while {$i>0} { set inheritance [- $inheritance [* $inheritance $decrement]] if { $inheritance < 0 } { break } set side$keeper $inheritance set total_false_position [+ $total_false_position $inheritance ] incr keeper 1 incr i -1 } set scale_factor [/ $real_estate $total_false_position ] set side4 [* $scale_factor $side4 ] set side5 [* $scale_factor $side5 ] set side6 [* $scale_factor $side6 ] set side7 [* $scale_factor $side7 ] set side8 [* $scale_factor $side8 ] } proc fillup {aa bb cc dd ee ff gg hh} { .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" .frame.entry7 insert 0 "$gg" .frame.entry8 insert 0 "$hh" } proc clearx {} { foreach i {1 2 3 4 5 6 7 8 } { .frame.entry$i delete 0 end } } proc reportx {} { global side1 side2 side3 side4 side5 global side6 side7 side8 global testcase_number console show; puts "%|table $testcase_number|printed in| tcl wiki format|% " puts "&| quantity| value| comment, if any|& " puts "&| $testcase_number:|testcase_number | |& " puts "&| $side1 :|initial real estate | |&" puts "&| $side2 :|number of brothers | |& " puts "&| $side3 :|less fraction 1/b (usually number of brothers) | |& " puts "&| $side4 :|answers: elder brother | |&" puts "&| $side5 :|2nd brother | |&" puts "&| $side6 :|3ird brother | |&" puts "&| $side7 :|4th brother | |&" puts "&| $side8 :|5th brother | |&" } frame .buttons -bg aquamarine4 ::ttk::button .calculator -text "Solve" -command { calculate } ::ttk::button .test2 -text "Testcase1" -command {clearx;fillup 60. 5. 5.0 17. 14. 11. 9. 7.0} ::ttk::button .test3 -text "Testcase2" -command {clearx;fillup 120. 5.0 5.0 35. 28. 22. 18. 14.0 } ::ttk::button .test4 -text "Testcase3" -command {clearx;fillup 3600. 5.0 5.0 1070. 856. 685. 548. 438.0 } ::ttk::button .clearallx -text clear -command {clearx } ::ttk::button .about -text about -command {about} ::ttk::button .cons -text report -command { reportx } ::ttk::button .exit -text exit -command {exit} pack .calculator -in .buttons -side top -padx 10 -pady 5 pack .clearallx .cons .about .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 . "Babylonian Brothers Inheritance Problems Algorithm" ====== ---- *** Pushbutton Operation*** For the push buttons, the recommended procedure is push testcase and fill frame, change first three entries etc, push solve, and then push report. Report allows copy and paste from console. For testcases in a computer session, the eTCL calculator increments a new testcase number internally, eg. TC(1), TC(2) , TC(3) , TC(N). The testcase number is internal to the calculator and will not be printed until the report button is pushed for the current result numbers. The current result numbers will be cleared on the next solve button. The command { calculate; reportx } or { calculate ; reportx; clearx } can be added or changed to report automatically. Another wrinkle would be to print out the current text, delimiters, and numbers in a TCL wiki style table as ====== puts " %| testcase $testcase_number | value| units |comment |%" puts " &| volume| $volume| cubic meters |based on length $side1 and width $side2 |&" ====== ---- ** Console program for testing concept ** ====== # pretty print from autoindent and ased editor # initial console program, Babylonian Brothers false shares # written on Windows XP on eTCL # working under TCL version 8.5.6 and eTCL 1.0.1 # gold on TCL WIKI, 10feb2017 package require Tk package require math::numtheory namespace path {::tcl::mathop ::tcl::mathfunc math::numtheory } set tcl_precision 17 console show set brothers 5 set i 5 set decrement [/ 1. $brothers ] set inheritance [expr 5**5] set false_sum 0 set real_estate 60. while {$i>0} { set inheritance [- $inheritance [* $inheritance $decrement]] if { $inheritance < 0 } { break } puts "brother brother$i inherits $inheritance" set side$i $inheritance set false_sum [+ $false_sum $inheritance] incr i -1 } puts " sum of false shares is $false_sum " puts " scale factor for false shares is [expr $real_estate / $false_sum ]" puts " elder brother's share is (5**5)*($real_estate / $false_sum) [expr (5**5)*($real_estate / $false_sum) ]" puts " younger brother's share is last*($real_estate / $false_sum) [expr $inheritance *($real_estate / $false_sum) ]" ====== output for false shares ====== brother brother5 inherits 2500.0 brother brother4 inherits 2000.0 brother brother3 inherits 1600.0 brother brother2 inherits 1280.0 brother brother1 inherits 1024.0 sum of false shares is 8404.0 scale factor for false shares is 0.00713 elder brother's share is (5**5)*(60. / 8404.0) 22.310 younger brother's share is last*(60. / 8404.0) 7.3108 ====== [gold] This page is copyrighted under the TCL/TK license terms, [http://tcl.tk/software/tcltk/license.html%|%this license]. **Comments Section** <> Please place any comments here, Thanks. <> Numerical Analysis | Toys | Calculator | Mathematics| Example| Toys and Games | Games | Application | GUI ---- <> Development | Concept| Algorithm