Mathematica Project II
An introduction to Abacus using Mathematica

Name: Jin Shen Yap (Sam)
Email: actexsam@gmail.com
Date: December 01, 2009
Instructor: Christopher Hanusa
Class: Math 213W - Mathematics with Mathematica, Fall 2009

Purpose:
1. To draw an Abacus by using Mathematica.
2. To acknowledge how to add and subtract using an Abacus.

Part 1:
A presentation about Abacus

What is an Abacus?
An abacus, which is a counting board that consists of beans, is used before the existence of calculator.
Abacus existed in many countries. In Chinese term, Abacus is called "Suan Pan".
Abacus was commonly used by mercenaries, or traders to do simple calculation such as add or subtract numbers.
Interestingly, Chinese Abacus is known for its ability to do multiplication, division, square root, and cube root.
The upcoming manipulation will show a picture of an Chinese Abacus and how does it represents one number.
Note that an Abacus can have more than ten columns as big numbers become famous.
For elementary purposes, we will just consider four columns.
Moreover, one row of bean on the top of Abacus is enough to do addition or subtraction.
However, two rows of bean looks better than one row of beans.
*The detail about the function used in the upcoming manipulation is in part 2.

Section 1.1: Different Abacus

Manipulate[
Switch[x,
Modern,Graphics3D[{
Black,Cuboid[{-1.4,0,4},{20.4,1,4.4}],
Black,Cuboid[{-1.4,0,-1.4},{20.4,1,-1}],
Lighter[Black],Cuboid[{-1.4,0,2.2},{20.4,1,2.6}],
Black,Cuboid[{-1.4,0,-1.4},{-1,1,4.4}],
Black,Cuboid[{20,0,-1.4},{20.4,1,4.4}],
Black,
Table[Cylinder[{{p,0.5,-1.4},{p,0.5,4.4}},0.2],{p,0,19,1}],
Gray,
Table[Sphere[{y,0.5,3.6},0.4],{y,19,0,-1}],
Table[Sphere[{y,0.5,x},0.4],{y,19,0,-1},{x,1.2,-0.6,-0.6}],
Red,
Table[Sphere[{y,0.5,1.2},0.4],{y,17,0,-3}]}],
Japan,Graphics3D[{
Brown,Cuboid[{-1.4,0,4},{20.4,1,4.4}],
Brown,Cuboid[{-1.4,0,-1.4},{20.4,1,-1}],
Brown,Cuboid[{-1.4,0,2.2},{20.4,1,2.6}],
Brown,Cuboid[{-1.4,0,-1},{-1,1,4.4}],
Brown,Cuboid[{20,0,-1},{20.4,1,4.4}],
Brown,
Table[Cylinder[{{p,0.5,-1},{p,0.5,4.4}},0.2],{p,0,19,1}],
Lighter[Black],
Table[Sphere[{y,0.5,3.6},0.4],{y,19,0,-1}],
Table[Sphere[{y,0.5,x},0.4],{y,19,0,-1},{x,1.2,-0.6,-0.6}]}],
Chinese,Graphics3D[{
Brown,Cuboid[{-1.4,0,4.6},{20.4,1,5}],
Brown,Cuboid[{-1.4,0,-2},{20.4,1,-1.6}],
Brown,Cuboid[{-1.4,0,2.2},{20.4,1,2.6}],
Brown,Cuboid[{-1.4,0,-2},{-1,1,5}],
Brown,Cuboid[{20,0,-2},{20.4,1,5}],
Brown,
Table[Cylinder[{{p,0.5,-2},{p,0.5,5}},0.2],{p,0,19,1}],
Lighter[Black],
Table[Sphere[{y,0.5,x},0.4],{y,19,0,-1},{x,4.2,3.6,-0.6}],
Table[Sphere[{y,0.5,x},0.4],{y,19,0,-1},{x,1.2,-1.2,-0.6}]}],
Russia,Graphics3D[{
Brown,Cuboid[{-1.4,0,7.6},{20.4,1,8}],
Brown,Cuboid[{-1.4,0,-2},{20.4,1,-1.6}],
Brown,Cuboid[{-1.4,0,-2},{-1,1,8}],
Brown,Cuboid[{20,0,-2},{20.4,1,8}],
Brown,
Table[Cylinder[{{p,0.5,-2},{p,0.5,7.6}},0.2],{p,0,19,1}],
Lighter[Black],
Table[Sphere[{y,0.5,x},0.4],{y,19,0,-1},{x,4.2,-1.2,-0.6}]}]],
{{x,Modern,"Choose different type of Abacus"},{Modern,Chinese,Japan,Russia}}]

Section 1.2: My Abacus

(*
The function, f, draws a unique image of an abacus given an integer.
As I manipulate the integer, the beans starts to move the beans according to the integer.
*)
Manipulate[
Column[{
"This is a pictorial view of an Chinese Abacus 'Suan Pan'!
Right now, this abacus is showing the value of:",
Style[n,Italic,FontSize->20],
F[n,m,o,p],
Style["A tutorial to read or use Abacus given an integer:",Bold,FontSize->15],
"This given number has independent integer on the order of:",
Style[IntegerDigits[n],Italic,FontSize->20],
"We read this Abacus from right column to the left column.
Starting from the last element in this set!
Each column takes one integer according to the order of the element in this set.
The top two rows represent heaven while the bottom four rows represent earth.
For each earth's bean that moves to the center, one is added.
For each heaven's bean that moves to the center, five is added."}],
{{n,0,"The integer value:"},0,9999,1,Appearance->"Open"},
Button["Click here to reset the Integer Value to ZERO!",n=0],
Button["Click here to randomly generate an Integer!",n=RandomInteger[9999]],
{{m,Red,"This is the Color Slider for the beans"},Red,ColorSlider},
{{p,200,"To change the image size:"},200,800,100},
{{o,False,"Check to show Axes!"},{True,False},ControlType->Checkbox}]

Section 1.3: Steps To Drawing An Abacus

How to use Mathematica to draw an Abacus?
First of all, we need some rectangle bars, cylinder and sphere.
Fortunately, Mathematica is able to easily draw these objects.
The next manipulation shows the steps I used to draw Abacus.

(*
An introduction of me developing the Abacus.
Using switch function, I`m able to put down different steps on drawing the Abacus.
*)
Manipulate[
Column[{
Switch[n,
1,"Step 1: Draw a simple rectangle bar.",
2,"Step 2: Draw another rectangle bar on top of the previous bar.",
3,"Step 3: I need a middle bar.",
4,"Step 4: I want a side bar, first the left.",
5,"Step 5: Then, the right!",
6,"Step 6: Now I need a cylinder that can actually hold the beans!",
7,"Step 7: I need more cylinder!",
8,"Step 8: Start making a sphere that looks like a bean!",
9,"Step 9: I need four of them on the bottom, here's the second!",
10,"Step 10: I need four of them on the bottom, here's the third!",
11,"Step 11: I need four of them on the bottom, here's the fourth!",
12,"Step 12: And I need it four beans in each column!",
13,"Step 13: Carefully place one bean on the top of the Abacus.",
14,"Step 14: I need one more bean to make it look good!",
15,"Step 15: Now, it's a complete Abacus!"],
Graphics3D[Switch[n,
1,{Black,Cuboid[{-1.4,0,4.6},{4.4,1,5}]},
2,{Black,Cuboid[{-1.4,0,4.6},{4.4,1,5}],Black,Cuboid[{-1.4,0,-1.4},{4.4,1,-1}]},
3,{Black,Cuboid[{-1.4,0,4.6},{4.4,1,5}],Black,Cuboid[{-1.4,0,-1.4},{4.4,1,-1}],
Black,Cuboid[{-1.4,0,2.2},{4.4,1,2.6}]},
4,{Black,Cuboid[{-1.4,0,4.6},{4.4,1,5}],Black,Cuboid[{-1.4,0,-1.4},{4.4,1,-1}],
Black,Cuboid[{-1.4,0,2.2},{4.4,1,2.6}],Black,Cuboid[{-1.4,0,-1.2},{-1,1,5}]},
5,{Black,Cuboid[{-1.4,0,4.6},{4.4,1,5}],Black,Cuboid[{-1.4,0,-1.4},{4.4,1,-1}],
Black,Cuboid[{-1.4,0,2.2},{4.4,1,2.6}],Black,Cuboid[{-1.4,0,-1.2},{-1,1,5}],
Black,Cuboid[{4,0,-1.2},{4.4,1,5}]},
6,{Black,Cuboid[{-1.4,0,4.6},{4.4,1,5}],Black,Cuboid[{-1.4,0,-1.4},{4.4,1,-1}],
Black,Cuboid[{-1.4,0,2.2},{4.4,1,2.6}],Black,Cuboid[{-1.4,0,-1.2},{-1,1,5}],
Black,Cuboid[{4,0,-1.2},{4.4,1,5}],Cylinder[{{0,0.5,-1.4},{0,0.5,5}},0.2]},
7,{Black,Cuboid[{-1.4,0,4.6},{4.4,1,5}],Black,Cuboid[{-1.4,0,-1.4},{4.4,1,-1}],
Black,Cuboid[{-1.4,0,2.2},{4.4,1,2.6}],Black,Cuboid[{-1.4,0,-1.2},{-1,1,5}],
Black,Cuboid[{4,0,-1.2},{4.4,1,5}],Table[Cylinder[{{p,0.5,-1.4},{p,0.5,5}},0.2],{p,0,3,1}]},
8,{Black,Cuboid[{-1.4,0,4.6},{4.4,1,5}],Black,Cuboid[{-1.4,0,-1.4},{4.4,1,-1}],
Black,Cuboid[{-1.4,0,2.2},{4.4,1,2.6}],Black,Cuboid[{-1.4,0,-1.2},{-1,1,5}],
Black,Cuboid[{4,0,-1.2},{4.4,1,5}],Table[Cylinder[{{p,0.5,-1.4},{p,0.5,5}},0.2],{p,0,3,1}],
Red,Sphere[{0,0.5,-0.6},0.4]},
9,{Black,Cuboid[{-1.4,0,4.6},{4.4,1,5}],Black,Cuboid[{-1.4,0,-1.4},{4.4,1,-1}],
Black,Cuboid[{-1.4,0,2.2},{4.4,1,2.6}],Black,Cuboid[{-1.4,0,-1.2},{-1,1,5}],
Black,Cuboid[{4,0,-1.2},{4.4,1,5}],Table[Cylinder[{{p,0.5,-1.4},{p,0.5,5}},0.2],{p,0,3,1}],
Red,Sphere[{0,0.5,-0.6},0.4],Sphere[{0,0.5,0},0.4]},
10,{Black,Cuboid[{-1.4,0,4.6},{4.4,1,5}],Black,Cuboid[{-1.4,0,-1.4},{4.4,1,-1}],
Black,Cuboid[{-1.4,0,2.2},{4.4,1,2.6}],Black,Cuboid[{-1.4,0,-1.2},{-1,1,5}],
Black,Cuboid[{4,0,-1.2},{4.4,1,5}],Table[Cylinder[{{p,0.5,-1.4},{p,0.5,5}},0.2],{p,0,3,1}],
Red,Sphere[{0,0.5,-0.6},0.4],Sphere[{0,0.5,0},0.4],Sphere[{0,0.5,0.6},0.4]},
11,{Black,Cuboid[{-1.4,0,4.6},{4.4,1,5}],Black,Cuboid[{-1.4,0,-1.4},{4.4,1,-1}],
Black,Cuboid[{-1.4,0,2.2},{4.4,1,2.6}],Black,Cuboid[{-1.4,0,-1.2},{-1,1,5}],
Black,Cuboid[{4,0,-1.2},{4.4,1,5}],Table[Cylinder[{{p,0.5,-1.4},{p,0.5,5}},0.2],{p,0,3,1}],
Red,Sphere[{0,0.5,-0.6},0.4],Sphere[{0,0.5,0},0.4],Sphere[{0,0.5,0.6},0.4],Sphere[{0,0.5,1.2},0.4]},
12,{Black,Cuboid[{-1.4,0,4.6},{4.4,1,5}],Black,Cuboid[{-1.4,0,-1.4},{4.4,1,-1}],
Black,Cuboid[{-1.4,0,2.2},{4.4,1,2.6}],Black,Cuboid[{-1.4,0,-1.2},{-1,1,5}],
Black,Cuboid[{4,0,-1.2},{4.4,1,5}],Table[Cylinder[{{p,0.5,-1.4},{p,0.5,5}},0.2],{p,0,3,1}],
Red,Table[Sphere[{y,0.5,x},0.4],{y,3,0,-1},{x,1.2,-0.6,-0.6}]},
13,{Black,Cuboid[{-1.4,0,4.6},{4.4,1,5}],Black,Cuboid[{-1.4,0,-1.4},{4.4,1,-1}],
Black,Cuboid[{-1.4,0,2.2},{4.4,1,2.6}],Black,Cuboid[{-1.4,0,-1.2},{-1,1,5}],
Black,Cuboid[{4,0,-1.2},{4.4,1,5}],Table[Cylinder[{{p,0.5,-1.4},{p,0.5,5}},0.2],{p,0,3,1}],
Red,Table[Sphere[{y,0.5,x},0.4],{y,3,0,-1},{x,1.2,-0.6,-0.6}],Sphere[{0,0.5,3.6},0.4]},
14,{Black,Cuboid[{-1.4,0,4.6},{4.4,1,5}],Black,Cuboid[{-1.4,0,-1.4},{4.4,1,-1}],
Black,Cuboid[{-1.4,0,2.2},{4.4,1,2.6}],Black,Cuboid[{-1.4,0,-1.2},{-1,1,5}],
Black,Cuboid[{4,0,-1.2},{4.4,1,5}],Table[Cylinder[{{p,0.5,-1.4},{p,0.5,5}},0.2],{p,0,3,1}],
Red,Table[Sphere[{y,0.5,x},0.4],{y,3,0,-1},{x,1.2,-0.6,-0.6}],
Sphere[{0,0.5,3.6},0.4],Sphere[{0,0.5,4.2},0.4]},
15,{Black,Cuboid[{-1.4,0,4.6},{4.4,1,5}],Black,Cuboid[{-1.4,0,-1.4},{4.4,1,-1}],
Black,Cuboid[{-1.4,0,2.2},{4.4,1,2.6}],Black,Cuboid[{-1.4,0,-1.2},{-1,1,5}],
Black,Cuboid[{4,0,-1.2},{4.4,1,5}],Table[Cylinder[{{p,0.5,-1.4},{p,0.5,5}},0.2],{p,0,3,1}],
Red,Table[Sphere[{y,0.5,x},0.4],{y,3,0,-1},{x,1.2,-0.6,-0.6}],
Table[Sphere[{y,0.5,x},0.4],{y,0,3,1},{x,3.6,4.2,0.6}]}],Axes->o,ImageSize->p]}],
{{n,1,"This is how I create my Abacus using Mathematica!"},1,15,1,Appearance->"Open"},
{{o,False,"Click to turn on the axes:"},{True,False}},
{{p,500,"This number will effect the image size:"},200,800,100}]

Part 2:
The function I used to move the beans

Section 2.1: Functions and Tables

How to move the beans?
Important: 
This is what I need to allow all the manipulations to work properly.
Note that in creating these Abacus:
- All objects are in a unique position in three dimension, a wise move is to use axes that show x-plane, y-plane, and z-plane.
- Other objects are fixed in position but the beans need to be flexible, that means the beans will have to move according to an integer.
- There are two sections to consider, the bottom section, that has four beans and the top section, that has two beans.
- Create a table that has all the spheres' position in for each section. A good way to view it is to use "TableForm".
- Use "ReplacePart" to replace one of the element in the table with a suggested element.
The next manipulation shows how I use "For" loop and "If" to select a "bean" that need be changed.
If I want to move two beans to the center, instead of actually moving two beans, I can just move the second bean to the top.
The next tutorial shows a visual manipulation about how I move the beans.

(*
This is to show how I replace/move the beans.
The reset button is crucial.
Since for some reason, the manipulation keeps on evaluating even after expressing the result.
I still don't know why it keeps on evaluating when the integer value is not zero.
*)
Manipulate[
Module[{
Topball=Table[Sphere[{y,0.5,x},0.4],{y,3,0,-1},{x,4.2,3.6,-0.6}],
Bottomball=Table[Sphere[{y,0.5,x},0.4],{y,3,0,-1},{x,1.2,-0.6,-0.6}]},
For[i=0,i<IntegerLength[n],i++,
If[IntegerLength[n]==i,Break[],
Bottomball=ReplacePart[Bottomball,{IntegerLength[n]-i,
If[Mod[IntegerDigits[n][[i+1]],5]==0,
5,Mod[IntegerDigits[n][[i+1]],5]]}->Sphere[{4-IntegerLength[n]+i,0.5,1.8},0.4]];
If[IntegerDigits[n][[i+1]]≥5,
Topball=ReplacePart[Topball,{IntegerLength[n]-i,2}->Sphere[{4-IntegerLength[n]+i,0.5,3.0},0.4]]]]];
Column[{
"The top two rows represents the 'Heaven's bean'.
The bottom four rows represents the 'Earth's bean'."
TableForm[{Topball,Bottomball}]}]],
{{n,0,"The integer value:"},0,9999,1,Appearance->"Open"},
Button["Click here to reset the Integer Value to ZERO!",n=0],
Button["Chick here to generate a Random Integer!",n=RandomInteger[9999]]]

Section 2.2: Explanation

From the top manipulation we have two table. Here the default overview of the two tables:

TableForm[
{Table[Sphere[{y,0.5,x},0.4],{y,3,0,-1},{x,4.2,3.6,-0.6}],
Table[Sphere[{y,0.5,x},0.4],{y,3,0,-1},{x,1.2,-0.6,-0.6}]}]

*Note: The left column in the above table correspond to the right column in Abacus.
Before we start, we have to consider breaking an integer into a set of integers base ten.
Such as a form of polynomial "a+b(10)+c(10)^2+d(10)^3+e(10)^4+..."
With the help of "IntegerDigits", {a,b,c,d,e,...} can easily determine, but it will be in reverse mode.

IntegerDigits[9865]

Now we need to take each element and decide which beans to move.
Suppose we begin by using the last element from the set, the number 5.
We need to move one bean from the top and no bean from the bottom to the center.
So, in the first column, I need to replace "Sphere[{3,0.5,3.6},0.4]" by "Sphere[{3,0.5,3},0.4]".
Note that "Sphere[{0,0.5,3.6},0.4]" is located in coordinate {1,2}.
Now we look at the element before the last element, the number 6.
We need to move one bean from the top and one bean from the bottom to the center.
So, in the second column, I need to replace "Sphere[{2,0.5,3.6},0.4]" by "Sphere[{2,0.5,3},0.4]".
And I need to replace "Sphere[{2,0.5,1.2},0.4]" by "Sphere[{2,0.5,1.8},0.4]".
Same process continues to test the next element, so we need to use "For" loop to keep track.
Using For loop, I will start by edit the first column.
"If" is being used to test the element in the first column.
Since the element in the first column equal to five, a replacement needs to be made.

IntegerDigits[98765][[IntegerLength[9865]-0]]

If[IntegerDigits[9865][[IntegerLength[9865]-0]]≥5,True,False]

ReplacePart[Table[Sphere[{y,0.5,x},0.4],{y,3,0,-1},{x,4.2,3.6,-0.6}],
{1,2}->Sphere[{3,0.5,3},0.4]]//TableForm

A same idea is used to test and edit the second column and the following columns.
After getting the right formula to move the beans, I put everything together

(*
In order to run properly, F has to be define!
This function draws an abucus of a value equal to the given integer.
*)
F[n_,m_,o_,q_]:=Module[{
Topball=Table[Sphere[{y,0.5,x},0.4],{y,3,0,-1},{x,4.2,3.6,-0.6}],
Bottomball=Table[Sphere[{y,0.5,x},0.4],{y,3,0,-1},{x,1.2,-0.6,-0.6}]},
For[i=0,i<IntegerLength[n],i++,
If[IntegerLength[n]==i,Break[],
Bottomball=ReplacePart[Bottomball,{IntegerLength[n]-i,
If[Mod[IntegerDigits[n][[i+1]],5]==0,
5,Mod[IntegerDigits[n][[i+1]],5]]}->Sphere[{4-IntegerLength[n]+i,0.5,1.8},0.4]];
If[IntegerDigits[n][[i+1]]≥5,
Topball=ReplacePart[Topball,{IntegerLength[n]-i,2}->Sphere[{4-IntegerLength[n]+i,0.5,3.0},0.4]]]]];
Graphics3D[{
Black,Cuboid[{-1.4,0,4.6},{4.4,1,5}],
Black,Cuboid[{-1.4,0,-1.4},{4.4,1,-1}],
Black,Cuboid[{-1.4,0,2.2},{4.4,1,2.6}],
Black,Cuboid[{-1.4,0,-1.2},{-1,1,5}],
Black,Cuboid[{4,0,-1.2},{4.4,1,5}],
Black,
Table[Cylinder[{{p,0.5,-1.4},{p,0.5,5}},0.2],{p,0,3,1}],
m,
Topball,
Bottomball},Axes->o,ImageSize->q]];

F[9865,Red,True,200]

Part 3:
Using an Abacus to count

Section 3.1: Using Abacus to Add

Now that Mathematica knows how to use Abacus. We'll use Abacus to do simple calculation.
We'll start with adding two numbers and show three Abacus represents the two numbers and the total.
Note that our four columns Abacus can only count an integer between 0 to 9999.
If I am to add two numbers using four columns Abacus, the total must be less than or equal to 9999.
So, I put a limit where the decided number must be less than or equal to 4999.
I want to manually decide which two digits I want or randomly generates two integers.
The next manipulation shows it all.

(*
Randomly generate a set of two integers and outputs it and the total.
Then for each of the three integers, it draws three abacus that corresponds to each integer.
*)
Manipulate[
Topball=Table[Sphere[{y,0.5,x},0.4],{y,0,3,1},{x,3.6,4.2,0.6}];
Bottomball=Table[Sphere[{y,0.5,x},0.4],{y,3,0,-1},{x,1.2,-0.6,-0.6}];
Column[{
"The two integers will be:",
{a,b},
"And for each number, Abucus will gives such result:",
Row[{
F[a,Red,False,q1],
F[b,Red,False,q1]}],
"And the sums of those integers will be:",
a+b,
"Where the Abacus give such result:",
F[a+b,Red,False,q2]}],
{{a,0,"The first Integer value:"},0,4999},
{{b,0,"The second Integer value:"},0,4999},
Button["Two Integers Random Generator",{a,b}=RandomInteger[4999,2]],
Button["Click here to reset the Integer Value to ZERO!",{a,b}={0,0}],
{{q1,200,"To change the Abacus image size for the top two:"},100,500,100},
{{q2,200,"To change the Abacus image size for the bottom one:"},100,500,100}]

Section 3.2: Using Abacus To Subtract

The way to add using Abacus is simple:
1. Consider 771+1451. First use Abacus to generate a value of 771.
2. Start from the right column, the first column, we need to add 1 to 771. So we move one earth's bean to the center.
3. Now we need to add 50 to 771, so we put one heaven's bean from the second column to the center.
4. It is not allowed to have two heaven's beans in the center. So we have to return them back to heaven.
5. As we remove two heaven's beans back to heaven, we move one earth's bean to the third column to the center.
7. Now we need to add 400 to 771, but there is only one bean left on the earth of the third column!
8. Note that 5-4=1. So, we still add one heaven's bean to the center in the third column and return one earth's bean back.
9. It is not allowed to have two heaven's beans in the center. So we have to return them back to heaven in third column.
9. As two heaven's bean return back to heaven and one earth's bean from the fourth column moves to the center.
10. Now we need to add 400 to 1000, which is just adding one earth's column from the fourth column to the center.
Overall, it seemed complicate, but there are actually individuals that can add faster using Abacus than calculator.
Now to the last manipulation, we come to learn how to get the difference between two integers.
For learning purposes, we will avoid negative numbers by taking the larger number minus the smaller number.

(*
Randomly generate a set of two integers and outputs it and the differences (the large minus the small).
Then for each of the three integers, it draws three abacus that corresponds to each integer.
*)
Manipulate[
Topball=Table[Sphere[{y,0.5,x},0.4],{y,0,3,1},{x,3.6,4.2,0.6}];
Bottomball=Table[Sphere[{y,0.5,x},0.4],{y,3,0,-1},{x,1.2,-0.6,-0.6}];
Column[{
"The two integers will be:",
{a,b},
"And for each number, Abucus will gives such result:",
Row[{
F[a,Red,False,q1],
F[b,Red,False,q1]}],
"And the difference between those integers will be:",
If[a≥b,n=a-b,n=b-a],
"Where the Abacus give such result:",
F[n,Red,False,q2]}],
{{a,0,"The first Integer value:"},0,9999},
{{b,0,"The second Integer value:"},0,9999},
Button["Two Integers Random Generator",{a,b}=RandomInteger[9999,2]],
Button["Click here to reset the Integer Value to ZERO!",{a,b}={0,0}],
{{q1,200,"To change the Abacus image size for the top two:"},100,500,100},
{{q2,200,"To change the Abacus image size for the bottom one:"},100,500,100}]

Part 4:
Why Abacus?

Section 4.1: Reference

Abacus." Wikipedia.org. 1 Dec. 2009.
<http://en.wikipedia.org/wiki/Abacus>.

Section 4.2: About Me

Back to the past when I was in my elementary school in Malaysia.
I was taught to use Abacus in Mathematics.
At that time, calculators are widely use in my country.
During the exams when we were told to use Abacus to count,
there were students who cheat by using the calculator in their cell phones.
Interestingly, when I was in my high school, 
there were students who can calculate square roots with only Abacus.
Yet, until now, I have no idea how to even do multiplication using Abacus.
I wish to learn, but right now, I can't even buy one Abacus.
Even if I buy one, I am too lazy to learn.
Slowly, in the future, I may forgotten the existence of Abacus.
But at least, I can show you not to underestimate the tools the ancient people use.
No matter how modern we are, things like Abacus can be useful sometime.
Because before calculators, the ancient people already using Abacus to do cube roots.

Section 4.3: Future Idea

1. Abacus can be used as a tool to record numbers.
Not just natural numbers or integers, but real numbers.
Hence, there is a way to represent irrational numbers using Abacus.
2. If Abacus can show irrational number, then it can show rational numbers.
If it can present rational number, then one can use Abacus to do division.
3. If Abacus can divide, then it can do multiplication.
4. If Abacus can show irrational number, then one can try do square root.
5. If Abacus can do square root, then one can try do cube root.
6. What more can you get from an Abacus?