**Sumerian Counting Boards, multiplication operation placement strategy, and eTCL demo example, 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] ---- <> **Introduction** [gold] Here is some eTCL starter code for a Sumerian counting board. Transforming some old chess displays into a Sumerian counting board, should have better counting pieces soon. If a token or coin is dropped on a square, then total of the coins on the square or within certain range of the dropped coin is tallied. The columns were thought to represent powers of 60 and the addition operations were down the columns. There were several types of Sumerian counting boards and not limited to three columns. For three columns, the highest number was expr(59*60+5*10+9). A multiplication feature might have to group coins on square a and multiply times the group on square b. The Sumerian counted in base60, so each token or column should have a base60 value of 3600,60,10,1,plus possible fractions 1/60, 1/3600. In proto-cuneiform math, some tokens represented lamb, goat, or ox. The tokens are kept in a storage box and may be thrown away in a separate trash area. 2 "memory storage areas" have been considered, maybe group and grab to staging areas. Ref DeSegnac paper. As a debug, a console window is opened and the various token motions and operations are posted to the console (for cut and paste to text editor). Info should have token name, numeric value, random object tag, and screen position. Additional info could include values and tallies of neighboring chips. As understood here, multiplication operations are the side panels operating on the center panel, which may include reciprocals of previous calculations. The earliest counting tokens were about 10000 BP. The heyday of counting tokens was about 5500 years BP. ---- **Pseudocode Section** ====== # using pseudocode # possible problem instances, initialize algorithm_result = 1. assign value or storage array to various tokens. about 150 known tokens from various eras, loaded 5 or 6 tally worth of picked tokens from storage box area. herd number of cows = N cow tokens herd number of bulls = N bull tokens assign unique random tag to move items on canvas within square, add adjacent tokens from assigned values from squares above, add tally. from squares above, subtract square_a minus square_b for tally store to third square? from square a and square b on adjacent sides, multiply contents put in square c in center how to reciprocate a stack of positive chips? are negative chips possible on counting board? # answer, yes on China stick numbers. save? tally to memory to one of 2 storage areas drag unwanted tokens to waste basket, but waste basket sticking and need extra brain power (from wiki ask?). check algorithm check_sum = a+b+c+d+e 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? ====== ***Testcases Section*** In planning any software, it is advisable to gather a number of testcases to check the results of the program. **** Testcase 1 **** %|table 1|||printed in| tcl wiki format|% &| quantity| value| ||comment, if any|& &|worth= |3600. | tag = lamb | tally_total= |3600.0|& &|worth= |60. | tag = jar_oil | tally_total= |3660.0|& &|worth= |10. | tag = goat | tally_total= |3670.0|& &|worth= |1. | tag = ingot | tally_total= |3671.0|& &|worth= |.01666 | tag = garment | tally_total= |3671.016659|& &|worth= |.0002777 | tag = cow_bull | tally_total= |3671.016937|& **** Testcase 2 **** %|table 2|||printed in| tcl wiki format|% &| quantity| value| ||comment, if any|& &|worth= |.0002777 | tag = cow_bull | tally_total= |0.0002776|& &|worth= |.01666 | tag = garment | tally_total= |0.0169377|& &|worth= |1. | tag = ingot | tally_total= |1.016937|& &|worth= |10. | tag = goat | tally_total= |11.0169377|& &|worth= |60. | tag = jar_oil | tally_total= |71.0169377|& &|worth= |3600. | tag = lamb | tally_total= |3671.0169|& &|worth= |3600. | tag = lamb | tally_total= |7271.0169|& &|worth= |60. | tag = jar_oil | tally_total= |7331.01693|& &|worth= |10. | tag = goat | tally_total= |7341.0169|& &|worth= |1. | tag = ingot | tally_total= |7342.0169377|& &|worth= |.01666 | tag = garment | tally_total= |7342.03359|& &|worth= |.0002777 | tag = cow_bull | tally_total= |7342.0338|& **** Testcase 3 **** %|table 3|||printed in| tcl wiki format|% &| quantity| value| ||comment, if any|& &|worth= |.01666 | tag = garment | tally_total= |0.01666|& &|worth= |1. | tag = ingot | tally_total= |1.016659|& &|worth= |1. | tag = ingot | tally_total= |2.016659|& &|worth= |10. | tag = goat | tally_total= |12.01666|& &|worth= |60. | tag = jar_oil | tally_total= |72.01666|& &|worth= |10. | tag = goat | tally_total= |82.01666|& &|worth= |60. | tag = jar_oil | tally_total= |142.01666|& **** Testcase 4 **** Product of selected doubleclick point and nearest point should be associative. Here p1*p2 = 12960000 and p2*p1 = 12960000, recorded in output from console window. Terms in canvas tags for value_ regular expressions seem to be working. ====== &|worth= |3600. | tag = lamb | tally_total= |3600.0|& &|worth= |3600. | tag = lamb | tally_total= |7200.0|& selected double click point mv xdat_81 ydat_205 obj_98569283 # value_3600. current nearest entity 33 mv xdat_81 ydat_205 obj_98569283 # value_3600. current product of adjacent tokens 3600 X 3600 12960000 1 mv xdat_169 ydat_199 obj_674367737 # value_3600. current 674367737 with tag 30 31 x y 176.0 204.0 selected double click point mv xdat_169 ydat_199 obj_674367737 # value_3600. current nearest entity 31 mv xdat_169 ydat_199 obj_674367737 # value_3600. current product of adjacent tokens 3600 X 3600 12960000 ====== ---- ***Screenshots Section*** ****figure 1. trial counting board**** [Sumerian Counting Boards, multiplication operation placement strategy trial screen screenshot] ****figure 2.trial counting board 2**** [Sumerian Counting Boards, multiplication operation placement strategy trial screenshoot] ****figure 3.trial counting board (2*2=4) **** [Sumerian Counting Boards, multiplication operation placement strategy, and counting pieces] ---- ***References:*** * Possible old Babylonian computing paths some minor observations * D. A. R. DeSegnac, 10Mar2017, shows possible counting boards * [Oneliner's Pie in the Sky] * [One Liners] * [Canvas item selection by mouse click] [brusch] used here, * [Category Algorithm] * see similar 1/(1/nth) terms method used in * [Babylonian Combined Market Rates and eTCL demo example calculator, numerical analysis ] * Proust, Christine "Du calcul flottant en Mésopotamie", * La Gazette des Mathématiciens2015-0910,” English version available, 2013 * Halloran, John Alan “Early Numeration – Tally Sticks, * Counting Boards, and Sumerian ProtoWriting,” August 10, 2009, * Nissen et al.: Archaic Bookkeeping : Early Writing and * Techniques of Economic Administration in the Ancient Near East, Chicago and London, 1993 * Hoyrup, Jens: A Note on Old Babylonian Computational Techniques, * Historia Mathematica 29 (2002), 193–198 * Mathematical Treasure: Mesopotamian Accounting Tokens, Frank J. Swetz , Pennsylvania State University * Reckoning Before Writing by Denise Schmandt-Besserat * (Archaeology. May/June 1979, Vol. 32, No. 3, p. 22-31). * Numbers and Measures in the Earliest Written Records, Jöran Friberg. * Scientific American. February 1984. Volume 250. Number 2. Pages 110-118 * Schmandt-Besserat, Denise. The Earliest Precursor of Writing , * in Scientific American, June 1977, Vol. 238, No. 6, p. 50-58. * Schmandt-Besserat, Denise. Reckoning Before Writing, * in Archaeology. May/June 1979, Vol. 32, No. 3, p. 22-31. * Schmandt-Besserat, Denise. Two Precursors of Writing: * Plain and Complex Tokens», in The Origins of Writing * edited by Wayne M. Senner. 1991: 27-41. ---- **Appendix Code** ***appendix TCL programs and scripts *** **Initial code** ====== # pretty print from autoindent and ased editor # Sumerian counting board Strategy # working under TCL version 8.5.6 and eTCL 1.0.1 # program written on Windows XP on eTCL # gold on TCL WIKI, 10Mar2017 package require Tk package require math::numtheory namespace path {::tcl::mathop ::tcl::mathfunc math::numtheory } set tcl_precision 17 #! /bin/env tclsh console show global xx1 yy2 xxx1 tally_picks set tally_picks 0 set grab 0 set filex "" set colorit blue set coloritx gold set xx 50 set yy 50 set xxx1 50 set yyy1 50 array set worth {lamb 3600. jar_oil 60. goat 10. ingot 1. garment .01666 cow_bull .0002777} set font9 { Helvetica 20} set font10 { Helvetica 40} proc wastebasket {w} { set font9 { Helvetica 50} $w create rectangle 350 550 500 600 -fill beige -tag grid $w lower grid } proc tokenize_lamb {tag} { global font9 font10 colorit coloritx xx yy xxx1 yyy1 .c create text [+ $xxx1 355 ] [+ $yyy1 35 ] -text "\u26AB" -font $font10 -fill $coloritx -tags $tag .c create text [+ $xxx1 355 ] [+ $yyy1 35 ] -text "\u2638" -font $font9 -fill $colorit -tags $tag } proc tokenize_jar_oil {tag} { global font9 font10 colorit coloritx xx yy xxx1 yyy1 .c create text [+ $xxx1 355] [+ $yyy1 78 ] -text "\u26AB" -font $font10 -fill $coloritx -tags $tag .c create text [+ $xxx1 355] [+ $yyy1 78 ] -text "\u2617" -font $font9 -fill $colorit -tags $tag } proc tokenize_goat {tag} { global font9 font10 colorit coloritx xx yy xxx1 yyy1 .c create text [+ $xxx1 355] [+ $yyy1 127] -text "\u26AB" -font $font10 -fill $coloritx -tags $tag .c create text [+ $xxx1 355] [+ $yyy1 127] -text "\u2744" -font $font9 -fill $colorit -tags $tag } proc tokenize_ingot {tag} { global font9 font10 colorit coloritx xx yy xxx1 yyy1 .c create text [+ $xxx1 355] [+ $yyy1 182] -text "\u26AB" -font $font10 -fill $coloritx -tags $tag .c create text [+ $xxx1 355] [+ $yyy1 182] -text "\u26AB" -font $font9 -fill $colorit -tags $tag } proc tokenize_garment {tag} { global font9 font10 colorit coloritx xx yy xxx1 yyy1 .c create text [+ $xxx1 355] [+ $yyy1 243] -text "\u26AB" -font $font10 -fill $coloritx -tags $tag .c create text [+ $xxx1 355] [+ $yyy1 243] -text "\u2617" -font $font9 -fill $colorit -tags $tag } proc tokenize_cow_bull {tag} { global font9 font10 colorit coloritx xx yy xxx1 yyy1 .c create text [+ $xxx1 355] [+ $yyy1 303] -text "\u26AB" -font $font10 -fill $coloritx -tags $tag .c create text [+ $xxx1 355] [+ $yyy1 303] -text "\u2735" -font $font9 -fill $colorit -tags $tag } set state2 1 proc refreshgrid { w state2} { global oscwidth oschorizontal colorite global grid global ind indx set ind 0 set indx 0 set colorite blue . configure -background orange -highlightcolor brown -relief raised -border 30 $w configure -bg tan set dx 100 ;# pixels between adjacent vertical grid lines set dy 100 ;# pixels between adjacent horizontal grid lines set x0 50 ;# pixels between left of canvas and left of grid set y0 50 ;# pixels between top of canvas and top of grid #set win $w ;# name of canvas widget $w create rectangle 350 50 500 500 -fill beige -tag grid $w lower grid foreach i {0 3} { $w create line [expr {$i * $dx + $x0}] $y0\ [expr {$i * $dx + $x0}] [expr {9 * $dy + $y0}] -width 2 -fill green -tag grid } for {set i 1} {$i < 4} {incr i} { $w create line [expr {$i * $dx + $x0}] $y0\ [expr {$i * $dx + $x0}] [expr {9 * $dy + $y0}] -width 2 -fill blue -tag grid } for {set i 0} {$i < 10} {incr i} { $w create line $x0 [expr {$i * $dy + $y0}]\ [expr {3 * $dx + $x0}] [expr {$i * $dy + $y0}] -width 2 -fill purple -tag grid } } proc take_token {tag x y} { global tokenx tokeny set tokenx $x set tokeny $y tokenize_$tag token .c raise token .c bind $tag {drag_token %x %y} .c bind $tag "drop_token $tag %x %y" } proc drag_token {x y} { global tokenx tokeny .c move token [expr {$x - $tokenx}] [expr {$y - $tokeny}] set tokenx $x set tokeny $y } proc drop_token {tag x y} { global grab worth numis xx1 yy2 xxx1 tally_picks #.c delete token set tally_picks [+ $tally_picks $worth($tag)] puts " &|worth= |$worth($tag) | tag = $tag | tally_total= |$tally_picks|&" set tilename [expr {int(rand()*1000000000.)}] .c itemconfigure token -tag [concat mv xdat_$x ydat_$y obj_$tilename # value_$worth($tag) ] } proc onDblClick {x y} { set x [.c canvasx $x] ; set y [.c canvasy $y] set i [.c find closest $x $y] set t [.c gettags $i] set u [.c gettags current] set cumulative_product 0. set cumulative_sum 0. set numero 0. puts "selected double click point $u " puts "nearest entity $i $t" puts " rectangular enclosure [ .c find enclosed $x $y [+ $x 100 ] [+ $y 100 ] ] " foreach item [split [ .c find enclosed $x $y [+ $x 100 ] [+ $y 100 ] ] ] { puts " .c gettags $item [.c gettags $item ]" regexp {value_(\d+)} $item -> numero set cumulative_product [* $cumulative_product $numero] set cumulative_sum [+ $cumulative_sum $numero] puts "cumulative_sum $cumulative_sum" puts "cumulative_product $cumulative_product" } set number1 1. set number2 1. set numberx $t regexp {value_(\d+)} $u -> number1 regexp {value_(\d+)} $numberx -> number2 puts "product of adjacent tokens $number1 X $number2 [* $number1 $number2 ] " } wm withdraw . wm geometry . 600x800 wm resizable . 0 0 pack [canvas .c -width 600 -height 800 -bg orange ] tokenize_lamb lamb .c bind lamb {take_token lamb %x %y} tokenize_jar_oil jar_oil .c bind jar_oil {take_token jar_oil %x %y} tokenize_goat goat .c bind goat {take_token goat %x %y} tokenize_ingot ingot .c bind ingot {take_token ingot %x %y} tokenize_garment garment .c bind garment {take_token garment %x %y} tokenize_cow_bull cow_bull .c bind cow_bull {take_token cow_bull %x %y} .c bind all <1> {set p(X) [.c canvasx %x]; set p(Y) [.c canvasy %y];set info " %x %y "} set haloo 50 .c bind mv {mv .c %x %y} bind .c { onDblClick %x %y } .c bind mv { crasher .c } proc crasher {w} { foreach item [$w find overlapping 400 500 450 600 ] { if {[$w type $item]=="oval"} {$w delete $item} if {[$w type $item]=="text"} {$w delete $item} } } proc mv {w x y} { global p id set x [$w canvasx $x] set y [$w canvasy $y] set id [$w find withtag current] set numberx [$w gettags current] regexp {obj_(\d+)} $numberx -> tilex puts "1" puts $numberx puts $tilex puts " with tag [$w find withtag obj_$tilex ]" foreach item [$w find withtag obj_$tilex ] { $w move $item [expr {$x-$p(X)}] [expr {$y-$p(Y)}] } puts " x y $x $y" if { $y >= 20 && $y <= 70 } { if { $x >= 20 && $x <= 70 } {$w delete obj_$tilex } } foreach item [$w find overlapping 400 500 550 600 ] { if {[$w type $item]=="oval"} {$w delete $item} if {[$w type $item]=="text"} {$w delete $item} } set p(X) $x; set p(Y) $y } wastebasket .c refreshgrid .c state2 wm title . " Sumerian Counting Board Strategy " after idle wm deiconify . .c configure -background orange -highlightcolor brown -relief raised -border 30 .c configure -bg tan ====== ---- [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