An Ancient Calculator:
The Quipu
by
Rhiannon Houch, Senior
Ruben Guadiana, Junior
Advanced Computer Class
Silver High School, Silver City, NM
April 1, 2002
Adventures in Supercomputing Challenge
Project Number 092
Teacher: Mrs. Peggy Larisch
Mentor: Mr. Daniel Houch
Acknowledgements
AiS Challenge Final Report April 1, 2002
2
The authors wish to acknowledge the following individuals for the guidance
provided in the selection of a suitable topic, development of the computer
code, adaptation to the computer based analyses, and assistance provided in
the overall preparation of this report:
Mrs. Peggy Larisch Teacher
Mr. Daniel Houch Mentor
Contents
AiS Challenge Final Report April 1, 2002
3
E.0 Executive Summary ................................................................ 4
1.0 Introduction......................................................................... 5
2.0 Problem Statement ................................................................ 6
3.0 Research............................................................................. 7
4.0 Method of Solution................................................................. 9
5.0 Data and Results...................................................................11
6.0 Conclusions.........................................................................12
References..................................................................................13
Appendix 1 Structure of the Quipu .....................................................15
Appendix 2 C++ Program .................................................................16
E.0 Executive Summary
AiS Challenge Final Report April 1, 2002
4
The team has developed a program to represent a virtual quipu. Since
information on the quipu and the Incas is lacking, it was an interesting topic for
the team. The project on Incas began as a class project to understand how the
AiS challenge works. The team decided to take on the project as a challenge
to better understand the Incan culture. First, extensive research was done on
the mysterious civilization through the internet and a book. The team found
research to be a difficult task because of the lack of knowledge in this area of
history. The best, most in depth resource was the book Mathematics of the
Incas: Code of the Quipu by M. and R. Ascher. The research was then used to
develop a program to represent a modern computer version of a quipu while
keeping basic concepts used by the Incas. The program is used to keep a
census and find averages of the number of men, women, and children per
family per village in a civilization. The division of the Incas was used to find
the average, by dividing into parts and using only whole numbers. The division
could be considered a form of reverse adding. The team used C++ to write an
original program, but found limitations that restricted graphic capabilities.
1.0 Introduction
1.1 Abstract
AiS Challenge Final Report April 1, 2002
5
It is often wondered how ancient civilizations kept track of their food stock,
population, or livestock. The Incas used a mechanism called a quipu, a device
made of string tied in knots to represent a number, pronunciation key, or word.
They could be added, subtracted, even multiplied and divided using complex
matrix algebra, or they could tell a story of their history. Quipus are the only
physical records today of the Incas. The goal in this project is to computerize
the quipu and demonstrate the intricate minds of the Incas by using their
original arithmetic to find totals and averages of a census of a community. The
automated quipu will then output the graphics of the data to resemble a real
quipu.
1.2 Purpose
The team has chosen to build a virtual quipu in order represent the ancient
Incan mathematics, which few know about. This project started as a class
assignment to read about, and create quipus in order to get a feel for the AiS
Challenge. After reading the book Mathematics of the Incas: Code of the
Quipu, this team has taken on the challenge of programming the mathematics
that the ancient Incan culture used for census, inventory, etc. The team chose
this project idea because they were drawn into the idea of alternate
mathematics, and the neat recording method the Incas used to employ.
Research over the Internet and other sources was conducted to find out as
much information as possible to get a better idea of Incan culture and later to
apply this information to the program.
1.3 Computer Program
The computer program is written in the C++ language because the Advanced
Computers class was studying this language first semester. The program is
struct oriented with each quipu being a separate struct. The user is allowed to
input data that will keep a census of a civilization that includes many villages
and families. The user then will be able to find totals or averages. C++ could
not be used for the graphics as problems were faced when libraries could not
be loaded into the C++ compiler. This program is a completely original code
developed and prepared by the team.
2.0 Problem Statement
AiS Challenge Final Report April 1, 2002
6
Information about the Incas, the Incan civilization and their society is not
extensive. Actual archeological and historical evidence of their existence is
even less common. Especially in the manner in which the Inca communicated,
that is, it appears that there is very limited written techniques employed;
however, once system that has been discovered is that referred to as the
Quipu. Quipus are the only physical evidence of their semi-written language, or
any other type of records. There are no detailed written records that have
been found to explain exactly how to use a quipu, only the quipus themselves
and occasional references from archeological and historical sources.
Consequently, the quipu, how it was used in daily life and its value to society
are not well understood.
There is no definite support that a quipu was used like we think it does.
Everything is based on hypothesis. Since there is little knowledge of these
quipus, the team decided to try and recreate a virtual quipu to gain a better
understanding of how the quipus worked and were created. The study of
quipus can yield an understanding of the general recording system and some of
the mathematical concepts, structural principles, and expressive techniques
that underlie it
1
.
3.0 Research
AiS Challenge Final Report April 1, 2002
7
3.1 The Incas
The Incas were the largest and most sophisticated civilization of the pre-
Colombian era. They were ruled by a monarchy, which they believed was
granted by divine right. They were centered at Cuzco, Peru and controlled
over 2000 miles throughout the Andes Mountains. The native language was
Quechua. A very advanced aspect of them was that they used storehouses to
keep food for when goods were not available. When crops were good and there
was a surplus of food, it was stored for use when times became rough
1
. Another
interesting fact, which also aided their disappearance, was that they were very
accepting of different cultures and blended in well. Instead of dominating a
region with an iron fist and making the conquered people gain Incan culture,
they adapted their own culture to fit the lifestyles already established by the
captives. Along with this, in 1535 the Spanish army conquered the Incas with
the rifle
2
.
3.2 Quipus
Quipus are the only artifacts of a "written language" that we have today of the
Incas. The quipu, which is Quechua for knot, was a recording device made of
knots on wool or cotton strings. The recording device consists of a main cord,
top cord, pendant cords, subsidiary cords, subsidiaries of subsidiaries, etc. The
quipus were ideal because of their portability and various uses. They were
used to keep inventory, census, loom patterns, or tell a story. Quipus often
recorded numerical data and even folklore or stories of the Incas. Whenever a
quipu was used to relate a story, knots would be placed in arrangement
according to syllables or sounds
3
.
The base of a quipu is the main cord. It is generally much thicker than the
hanging pendant cords. Pendant cords that hang upwards are called top chords
and cords hanging from the pendant cords are subsidiary cords
1
. The top cords
usually associate pendant cords and represent a sum or total
1
. Each cord is
color coded, which makes the quipus so spectacular and expands the utility of
the quipu. The color-coding is used to distinguish among the information
provided on the quipu. The quipumaker would use general colors from dye and
form additional colors by twisting colors together. Twisting in one direction
would cause a candy cane effect, while twisting in the opposite direction will
create a mottled effect
1
.
AiS Challenge Final Report April 1, 2002
8
On each pendant cord, a number is recorded by tying various knots in certain
positions on the cord. The knots are separated into clusters by spaces that
represent different powers of ten (1's, 10's, 100's, 1000's, etc.). A long knot is
used in the single digit position (1-9). In the long knot, the number is the
number of twists in the knot. Therefore, a single twist, or figure eight knot,
would represent the number one. Single knots represent numbers in every
other position
1
. If there is no knot in a position, it represents zero. The way
the quipu is read is the highest value is positioned closest to the main cord
1
.
So, the pendant cords would read from top to bottom and the top cords would
read from bottom to top. (see Appendix 1)
In order to make such elaborate recording devices, the quipumaker had to have
a variety of special skills. The quipumaker was able to use materials from the
environment that were ideal for quipus. Since the quipu was very light it was
very transportable adding to the overall utility of the device. Rather than using
stone or animal skins, the Incas used lightweight cotton or wool
1
. The
quipumaker also had to have a keen eye for color. Unlike the Sumerians who
used no color, or the Egyptians who used two colors, the Incas used hundreds
of colors
1
. Every quipu was made differently, but when read, it would come
out to the same correct summation. Spacing and color of knots were vital to
the data input. Because of the importance of quipus in Incan society, the
quipumaker held a position of privilege
1
. The quipumaker worked in many
places and was usualy responsible for those who worked under him
1
.
Knowledge is very limited in this area, as no one really knows how the story
quipus work
4
. The Spanish destroyed much of the evidence during their
conquest because the quipus were believed to be the work of the devil
1
.
4.0 Method of Solution
AiS Challenge Final Report April 1, 2002
9
3.1 Mathematical Model
The majority of the mathematical concepts used by the Incas were acquired by
studying quipus. It is obvious that the quipu employed traditional addition and
subtraction techniques to find sums; furthermore, there is evidence that the
quipu also incorporated division into parts and use of ratios. The Incas would
evenly divide a number into parts and disregard decimals. For example, the
number 13 evenly divided into three parts would be 4, 4, and 5. The division of
larger numbers would be done by halving the number first, then dividing it into
even parts. The number 102 would first be divided into two parts of 51. Then
51 would be divided into four parts of 12,13,13, and 13
1
. This technique
involves a rather sophisticated system of mathematics; particularly division and
multiplication are intimately connected. Four doubled would be eight and half
of eight would be four. Since the Incas did not use decimals or remainders,
numbers were rounded to the nearest whole number. Therefore, half of nine
would also be four and five
1
. Because of this, the numbers recorded on a quipu
may not be considered as accurate as if done by Western math of today.
The equation used in the C++ program was as follow:
r = x/village; where x is the total number of men, women, or children
and village is the number of villages
r = z + r
div = x z
r is displayed village 1 times
div is displayed as the last part
All math was check numerous times by hand calculations.
3.2 Computational Methods
A computer program was developed to resemble a virtual quipu. The
program was devised in C++ (see Appendix 2). Structs were used to obtain data
and store into vectors and later display the data input. The program first asks
the user to input the number of villages in the civilization he/she is keeping
census for. A for loop follows and for every village the user is then asked to
input the number of families per village, followed by a nested for loop. A
funtion is then called that asks the user to input the number of men, women,
and children per family, which is entered into a vector. While the numbers are
being entered, the variables census, totmen, totwomen, and totkids are added
to find the totals for the entire census, men, women, and children. Once the
figures are entered, a menu is brought up using the switch case that allows the
user to either find the totals, the averages of people per village, or display the
data they have input.
AiS Challenge Final Report April 1, 2002
10
Case 1: Find the totals. A nested switch case is used to find either the total
number of men, women, children, or the entire census. A while statement is
used in order to allow the user to view the totals as long as necessary.
Case 2: Find the averages. If statements and a while statement are used
to find the averages of men, women, children, or all people per village. The
team tried to follow Incan mathematics in the sense of dividing into parts and
using only whole numbers. Although considered a simplified version of
mathematics, it took five variables and two different methods. The first
method is for numbers greater than thirty. The Incans would first halve large
numbers and then proceed to divide into smaller units. The second method is
for numbers less than thirty. The variables used were as follows:
x represented either the total men, women, children, or census
village the number of villages entered by the user
r x divided by village
z the totals of the outputted rs
div x minus z
A for loop was used to output the averages into parts, which simulates the
Inca technique.
Case 3: Display the user input. A function is called that outputs the data
stored in the vector. The number of men, women, and children per family are
displayed, plus, the totals for each.
A while statement surrounding the entire main function allows the user to
either add more information or quit.
The structs used are:
InfoType declares the variables for men, women and children
QuipuType the vector is declared. Also, the variables to resize
the vector when necessary.
The functions used are:
GetData for user input of men, women, children
display cout of men, women, and children stored in the vector
displayquipu displays entire vector
addfamily allows resizing of the vector
All code is completely original written by the team specifically for this project.
5.0 Results
AiS Challenge Final Report April 1, 2002
11
One of the principal uses of the quipu by the Incas was the maintenance of a
census record. Therefore, the virtual quipu developed by this project, also
created a record keeping technique, which could then be compared to actual
quipus to verify technique and application of data. The virtual quipu, like
many quipus of the past, keeps a census. If drawn out, the quipu would be
vertical in structure and have four levels. The first level, or pendant cords,
represents the villages. The second level, or subsidiaries of the village cords,
represents the families. The third level, or subsidiaries of the family cords,
represents men, women, and children. Each level is represented by a different
color, and the knots for men, women, or children are different colors.
The program follows the mathematical concepts used by the Incas. Only whole
numbers were used in finding the averages. Also, rather than simply dividing,
the number was divided into parts. The output of the average number per
village is output in several parts, depending on the number of villages entered.
6.0 Conclusions
AiS Challenge Final Report April 1, 2002
12
6.1 Mathematical Models
The simplified form of arithmetic used by the Incas was incorporated into
the program. Traditional addition was used in order to find the totals of men,
women, children, and the entire census. In order to find the averages, the
total number of people was divided into parts equaling the total number of
villages. If a number was larger than thirty, it was halved first in order to
make it easier to work with. All equations used were verified by hand
calculations to validate the accuracy of the program.
6.2 Computer Program
The team successfully created a virtual quipu using original C++ coding. The
C++ program created by the team was overall useful in understanding the use
of quipus. The program was written in C++ because this language is very
adaptable to a range of applications and is uniquely suitable to developing an
original program as was required for this project. Vectors, structs, fuctions,
and various simple statements were used in developing the program. The
program allows the user to input the number of men, women, and children in a
family in a village where the census is being taken. It displays the numbers per
family and also allows the user to find totals and averages of men, women,
children, and the entire census. The quipu was an important aspect in Incan
communication and by learning more about their beneficial quipu, we can
perhaps learn more about the mystifying culture.
5.4 Recommendations
Since the libraries for graphics were not available in C++, an actual drawn out
quipu is not available. Based on the study performed for this project and the
requirements for visual presentation that was not available with the C++
program, it is recommended that JAVA be utilized coupled with an applet to
display the information input.
AiS Challenge Final Report April 1, 2002
13
References
1. Ascher M and R, Mathematics of the Incas: Code of the Quipu. Mineola,
New York, 1997.
2. Inca. http://emuseum.mnsu.edu/prehistory/latinamerica/south/
cultures/inca.html. Viewed on March 12, 2002.
3. Miller E. Madge. The Quipucamayu. http://www.spanish.sbc.edu/
MMLatAm/Quipus.html. Viewed on March 8, 2002.
4. OConnor, J.J. and E.F. Robertson. Mathematics of the Incas. JOC/EFR
January 2001. http://www.history.mcs.standrews.ac.uk/history/
HistTopics/Inca_mathematics.html. Viewed on March 8, 2002.
5. Storey, Alice. Quipu: A Modern Mystery. Simon Fraser University, 1999.
http://www.sfu.ca/archaeology/museum/laarch/inca/quipue.html.
Viewed on March 8, 2002.
AiS Challenge Final Report April 1, 2002
14
APPENDICES
Appendix 1 The Quipu
Appendix 2 C++ Program
AiS Challenge Final Report April 1, 2002
15
Appendix 1
Structure of the Quipu
This represents a basic quipu. The thick horizontal cord is the main cord, while
the vertical cords are the pendant cords. The thinner cords hanging from
various pendant cords are subsidiary cords.
This is a closer look at the pendant cords. The lines represent the knots on the
cords. The significance of spacing is well represented. The cord to the far
right would be a top cord that represents the sums of the data on the quipu.
AiS Challenge Final Report April 1, 2002
16
Appendix 2
C++ Mathematics Code
/* Rhiannon Houch and Ruben Guadiana
Team #092
An Ancient Calculator
--This program simulates a quipu recording census for a civilization.
It will count the total census, along with total men, women, and
children --
*/
#include <iostream.h>
#include <math.h>
#include <stdlib.h>
#include <vector.h>
struct InfoType
{
int men;
int women;
int kids;
};
struct QuipuType
{
QuipuType();
const int SizeChange;
int NumPeople;
vector<InfoType> census; //quipu info
};
QuipuType::QuipuType()
:SizeChange(5), census(5), NumPeople(0)
{
}
//enter data
void GetData(InfoType &Info)
{
cout<<"Enter the number of men: ";
cin>>Info.men;
cout<<"Enter the number of women: ";
AiS Challenge Final Report April 1, 2002
17
cin>>Info.women;
cout<<"Enter the number of children: ";
cin>>Info.kids;
}
//display data
void display(const InfoType &Info)
{
cout<<"\t "<<Info.men<<" \t "<<Info.women<<" \t "<<Info.kids<<endl;
cout<<"\n"<<endl;
}
void displayquipu(const QuipuType &Quipu)
{
for (int x=0; x<Quipu.NumPeople; x++)
{
cout<<"Family "<<x+1;
display(Quipu.census[x]);
}
}
void addfamily(QuipuType &Quipu, const InfoType &NewFamily)
{
Quipu.census[Quipu.NumPeople]=NewFamily;
Quipu.NumPeople++;
}
int main()
{
//declare variables
QuipuType Quipu;
InfoType Info;
int r; //for while statement
int math; //for switch statement
int w; //for while
//explanation
cout<<"\n";
cout<<"--This program will simulate an Incan Quipu."<<endl;
cout<<"You are back to time before written language. The King has asked
you to take the census of the entire Incan civilization, which spans over
2000 miles. Since carrying a stone would be inconveniant, you make a
quipu, a bundle of tied knots in string.--\n\n\n"<<endl;
AiS Challenge Final Report April 1, 2002
18
//variables for totals
int totmen=0;
int totwomen=0;
int totkids=0;
int census=0;
while (r!=2)
{
//prompt user
int village;
int family;
int V[500];
cout<<"Enter the number of villages you wil be counting: ";
cin>>village;
for (int v=0; v<village;v++)
{
cout<<"\nFor Village "<<v+1<<"...\n"<<endl;
cout<<"Enter the number of families in this village: ";
cin>>V[v];
family=V[v];
for(int f=0; f<family; f++)
{
cout<<"For Family "<<f+1<<"..."<<endl;
//call function
GetData(Info);
addfamily(Quipu, Info);
//totals
totmen = totmen + Info.men;
totwomen = totwomen + Info.women;
totkids = totkids + Info.kids;
census = totmen+totwomen+totkids;
} //close family for loop
} //close village for loop
//do action
int z;
while (z!=0)
{
cout<<"\nWhat would you like to do with this information?\n"<<endl;
cout<<"\t1. Find totals\n"<<endl;
cout<<"\t2. Find Averages\n"<<endl;
AiS Challenge Final Report April 1, 2002
19
cout<<"\t3. Display data\n"<<endl;
cout<<"0 to Quit"<<endl;
cin>>z;
switch(z)
{
case 1: cout<<"\t1. Find the total census\n";
cout<<"\t2. Find the total number of men\n";
cout<<"\t3. Find the total number of women\n";
cout<<"\t4. Find the total number of children\n\t";
cout<<"\t0 to Quit"<<endl;
cin>>math;
while (math!= 0)
{ //open while
switch (math)
{ //open switch
case 1: cout<<"There are "<<census<<" people total."<<endl; break;
case 2: cout<<"There are "<<totmen<<" men total."<<endl; break;
case 3: cout<<"There are "<<totwomen<<" women total."<<endl; break;
case 4: cout<<"There are "<<totkids<<" children total."<<endl; break;
} //close switch
cout<<"\nNow what would you like to find?\n";
cout<<"\t1. Find the total census\n";
cout<<"\t2. Find the total number of men\n";
cout<<"\t3. Find the total number of women\n";
cout<<"\t4. Find the total number of children\n";
cout<<"\t5. Find the total number grandchildren\n";
cout<<"\t\t0 to Quit"<<endl;
cin>>math;
} //close while
;break;
case 2: int x;
int num;
cout<<"What would you like to find the average of?\n"<<endl;
cout<<"\t1. Men\n";
cout<<"\t2. Women\n";
cout<<"\t3. Children\n";
cout<<"\t4. All People\n"<<endl;
cin>>num;
if(num==1)
x=totmen;
AiS Challenge Final Report April 1, 2002
20
else if (num == 2)
x = totwomen;
else if (num == 3)
x = totkids;
else if (num==4)
x = census;
else
cout<<"That's not an option"<<endl;
//declare variables
int y;
int z;
int r;
int s;
int div;
//for #s greater than 30
if (x>30)
{
x=x/2;
cout<<"Since the number is greater than 30, we will split the number in
half"<<endl;
cout<<"The average per village is: "<<endl;
for (int i=1; i<village; i++)
{
r=x/village;
cout<<r<<endl;
z=z+r;
}
div= x-z;
cout<<div<<endl;
}
else
{
cout<<"The average per village is: "<<endl;
for (int i=1; i<village; i++)
{
r=x/village;
cout<<r<<endl;
z=z+r;
}
div= x-z;
cout<<div<<endl;
}; break;
AiS Challenge Final Report April 1, 2002
21
case 3:
cout<<"\n *****************************************\n"<<endl;
cout<<"\t\tMen\t Women\t Children\n"<<endl;
displayquipu(Quipu);
cout<<"Totals: \t "<<totmen<<"\t "<<totwomen<<"\t "<<totkids<<endl;
cout<<"\nTotal Census: "<<census<<"\n"<<endl;
cout<<"\n *****************************************\n"<<endl;
break;
} //close switch
} //close while (z)
//see if the user is done
cout<<"Would you like to (1) Enter new data or (2) Quit?"<<endl;
cin>>r;
}// close while (r)
return(0);
}//close program