Counting Ants

This is not about how to count ants but how ants count.

The post follows research by Zhanna Reznikova and Boris Ryabko that investigates the numerical capacities of ants using ideas from Information Theory such as Shannon entropy and Kolmogorov complexity.  (Reznikova & Ryabko 2012)


Some species of red wood ant, that live in colonies of approximately 800 – 2000 individuals,  have a highly specialised social structure that includes having stable foraging teams of 5 to 9 ants. These teams are lead by a scout ant whose function is to find food sources, the location of which is then communicated to the other members of the foraging team.

A scouting ant contacting members of its team. Photo by Nail Bikbaev.

A scouting ant contacting members of its
team. Photo by Nail Bikbaev.

Experimental Procedures

In the experiments the ants in the foraging teams are individually identified with coloured dots. Sugar syrup is is placed  in one of the small reservoirs on the terminal leaves of floating mazes of various designs. All the other terminal locations have water in their reservoirs.

/Users/grahamshawcross/Documents/blog_drafts/animal counting/Ant

A scout ant is placed at a randomly selected location of the food and then allowed to return through the maze to its foraging team in the colony. The maze is then replaced by a new but identical maze but with the food source replaced with water. This prevents the foragers simply following any scent trail left by the returning scout or being directly attracted by the smell of the sugar syrup.

The scout ant sometimes needs up to four trips before he contacts his foraging team. Once he has contacted them, he is given time to communicate the location of the food to his foragers, and is then temporally isolated. The foraging team then have to find the location on their own using the scout’s instructions. After they find the correct location, food is given to them. No ants are harmed in these experiments although during the experiments the ants could only obtain food from the maze and only once every 2 to 3 days.

The lack of food on the replacement maze(s) means that the last lap of the foragers’ search cannot be guided by the sight or smell of the food.

With maze type A in the diagram above, the communicated message might be something like “walk forward distance X then turn left and food is in front of you”. With maze B, the message might be “after turning right walk forward distance Y then turn left and the food is in front of you”. For maze C this might be “after turning left walk forward distance Z then turn left and the food is in front of you”

Alternatively the distance and direction could be given as an absolute bearing plus a distance, so the message would always be “walk distance X along bearing A from the sun or magnetic north”. This might be interpreted as trying to keep as near as possible to the bearing whilst consuming the travel distance.

/Users/grahamshawcross/Documents/blog_drafts/animal counting/Ant

In the experiments 2 things were measured:-

1. how long the scouts took to communicate the location of the food source to the other members of their foraging team. This was measured from first antenae contact to at least 2 foragers leaving to recover the food.

2. the success of the foragers in finding the location of the food source.

Information Content

In rational communications systems the length of a message is a measure of its information content.

The information content of messages like “turn right, walk forward distance X, turn left etc” depends on the number of turns, more turns result in longer messages.

With the bearing and distance method “walk distance X along bearing A”, the message length and information content remain constant for all target positions, unless longer distances require longer messages such as would be the case in tapping out the number of steps to be taken.

So what is required is a maze design in which the experimenters know the amount of information that has to be transmitted. Such a design is the binary tree maze where the subject only has to repeatedly decide whether to turn left or right.

/Users/grahamshawcross/Documents/blog_drafts/animal counting/Ant

The simplest binary tree maze, with 1 fork and 2 leaves, is the Y-shaped maze . This has 1 fork representing 1 binary choice, turn left or right. This corresponds to 1 bit of information which the scout ant has to transmit to the foragers. In the experiments the number of forks was increased incrementally from 2 to 6. So the number of turns required to choose the correct path was equal to the number of bits of information that had to be transmitted.

Artificial ant nest and a binary tree maze placed in a bath with water. Photo by Nail Bikbaev.

Artificial ant nest and a binary tree maze
placed in a bath with water. Photo by Nail Bikbaev.


335 scout ants and their foraging teams took part in all the experiments with the binary tree mazes, and each scout took part in ten or more trials.

338 trials were carried out with mazes with 2, 3, 4, 5 and 6 forks.

The scout ants took progressively longer to communicate paths in deeper mazes  (with more turns) that is they transmitted more information.

In simple terms, if t is the time taken to transmit the required information then

           t = ai + b

Where i is the number of forks (the depth of the maze)

a is the amount of time required to transmit 1 bit of information

and b is an introduced constant used to represent extra information that might be transmitted such as the signal “food”.

The rate of information transmission a derived from the above equation was approximately 1 minute per bit in three ant species.

/Users/grahamshawcross/Documents/blog_drafts/animal counting/Ant


In the 4 bit binary tree maze diagram above, the highlighted path to the food source is represented by the coded leaf string [RLRR] meaning start [, turn right [R, then left [RL, then right [RLR and right again [RLRR and finish [RLRR].

All the possible routes through a 4 bit deep maze can be represented by the 16 combinations of its possible end leaf codes. The question arises “are any of these routes less complex than some of the others?”. The authors attempt to investigate this by seeing if any of the coded end strings can be compressed. They call this Kolmogorov complexity but it is perhaps easiest to understand in terms of run-length encoding where repeated values are replaced, wherever possible, by a count of the values plus the value.

[LLLL] –>[4L]          [LLLR]–>[3LR]       [LLRL]–>[2LRL]     [LLRR]–>[2L2R]    

[LRLL]–>[LR2L]     [LRLR]–>2[LR]       [LRRL]–>[L2RL]    [LRRR]–>[L3R]

[RLLL]–>[R3L]        [RLLR]–>[R2LR]    [RLRL]–>2[RL]       [RLRR]–>[RL2R]    

[RRLL]–>[2R2L]     [RRLR]–>[2RLR]    [RRRL]–>[3RL]      [RRRR]–>[4R]

So for instance turn right 4 times [RRRR]–>[4R] is a less complicated route than right, left, right and right again, [RLRR]–>[RL2R]. The first example [RRRR]–>[4R] shows a compression ratio of 50%, from 4 to 2 characters. On the other hand the second example [RLRR]–>[RL2R] shows 0% compression. This is because the original and compressed strings both have 4 characters.

In total in a 4 bit maze there are 2 routes with 50% compression, 6 with 25% compression (4 to 3 characters) and 8 with 0% giving a total compression ratio for the maze of ((2 x 2) + (6 x 1)) / (16 x 4) = 15.6%.

There are 8 combinations of possible routes through a 3 bit deep maze

[LLL]–>[3L]             [LLR]–>[2LR]           [LRL]                         [LRR]–>[L2R]

[RLL]–>[R2L]          [RLR]                           [RRL]–>[2RL]        [RRR]–>[3R]

[LLL]–>[3L] and [RRR]–>[3R] both represent 33% compression from 3 to 2 characters with a total compression for the maze of (2 x 1) / (8 x 3) = 8.3%.

Finally their are 4 possible routes through a 2 bit maze.

[LL]–>[2L]               [LR]                              [RL]                             [RR]–>[2R]

No compression is possible with this maze because with [LL]–>[2L] the original and compressed strings both have 2 characters as does [RR]–>[2R]. In general more compression is possible with longer strings.

Complexity Experiments

A number of experiments were carried out with the express purpose of seeing if scout ants recognised some routes as being less complex than others. This was done by using selected paths that were thought to be more or less complex (I have added the Run-Length Compression columns to the authors’ data below).


The authors judged the routes in the lower shaded portion of the table as being more complex than the unshaded part. These results are represented in the graph below.

/Users/grahamshawcross/Documents/blog_drafts/animal counting/ComThe authors claim that where the maze depth is 6, and most compression is possible, the communication time for the simpler, more repetitive (more compressible) routes is significantly less than the communication time for the more complex (less compressible) routes.


In assessing the ability of ants to do arithmetic another piece of information theory was used. This says that in any reasonable communication system the frequency of use of a message is inversely correlated to its length.

The informal pattern is quite simple: the more frequently a message is used in a language, the shorter is the word or the phrase coding it. Professional slang, abbreviations, etc. can serve as examples. This phenomenon is manifested in all known human languages as well as in technical systems of information transmission. (Reznikova and Ryabko, 2011)


With this in mind, the following series of experiments were carried out where the statistical distribution of the location of the food source was deliberately manipulated. Using the set-up illustrated above, all the experiments were undertaken in 3 stages:-

Stage 1. where the location of the food source was selected randomly with an equal chance of being in any particular location. The chance is 1 in 30 or 3.33%.

Stage 2. in which the statistical location of the food source was manipulated. In some experiments locations 7 and 14 were favoured and locations 10 and 20 in others. In both cases the 2 favoured locations had a 30% chance of being selected and the remaining locations a (100% – (30% x 2)) divided by 28 or a 1.43% chance. In other experiments one location, number 15, had a 50% chance of being selected and the others a (100% – 50%) divided by 29 or a 1.73% chance.

Stage 3. in which the location was again randomly selected exactly as in Stage 1.

  ArithmeticGraphAfter Ryabko and Reznikova, 2009

Stage 1 results were consistent with the binary maze experiments described earlier with a near linear relationship between the number of the branch with the food i and the amount of time t needed to transmit the necessary information and  t = ai +b. Stage 1 results are indicated by the black dots in the graph.

In Stage 2, by design, the supposed messages the food is on branch 7 (or 10) and the food is on branch 14 (or 20) was transmitted many more times than the food is on any other branch. In fact more than 40 times as often. With the one favoured selection on branch 15 the message the food is on branch 15 is transmitted a little less than 30 times as often as the food is on any other branch. In the graph the favoured branch indices are 10 and 20.

In Stage 3 the results are different to those in Stage 1. Times are much shorter and there is no linear relation between time and branch number. There is also a reduction in time around the favoured position(s) of Stage 2. Stage 3 results are indicated by pink squares in the graph.

In the first stage of  the experiments for example the ants took 70 to 82 seconds to transmit the information that the syrup was on branch number 11 and only 8 to 12 seconds for when it was on branch number 1. At the third stage, it only took 5 to 15 seconds to transmit the information that branch number 11, which was nearest to the favoured branch number 10, had the syrup on it.

The authors suggest that this means the ants  have changed their mode of presenting the data about the number of the branch containing the food. They suggest that the information is transmitted in two parts; firstly information about the index number of the nearest favoured location and secondly the offset which has to be added to or subtracted from this number.

The number of the favoured location has to be communicated because the scout ant has no other way of marking it. This is because the maze is replaced as soon as the scout makes contact with his scouts in the nest. The fact that the favoured index and offset are communicated in some way is vouched for by the forager ants’ remarkable success in finding the correct location.

Statistical analysis (Ryabko & Reznikova, 2009) supports the hypothesis that at the third stage of the experiment the transmission time is shorter when the branch is near a favoured branch.

The authors’ interpretation is that at this stage of the experiment the ants used simple additions and subtractions, achieving economy in a manner reminiscent of the human numerical system. When using numerical systems, people unconsciously have to perform simple arithmetical operations, for example, 13 = 10 + 3. They suggest that this is particularly obvious with Roman numerals, for example, VII = V + II and IV = V – I.


As  illustrated here with ants, mazes are useful in experimental situations where verbal communication is impossible or undesirable. Mazes can be designed to require precise amounts of information to be communicated.

Information Theory provides a number of useful paradigms for the investigation of numerical capabilities. In particular that information content and message length are positively correlated and that frequency of use and message length are inversely correlated.

In all the experiments extreme care was taken to ensure that the foraging ants could only find the location of the food by receiving information  communicated directly to them by the scout ant.

It is not clear in the binary maze experiments or Stage 1 of the arithmetic experiments if distance alone, or in combination with a bearing, could account for the increased length of the messages transmitted. In the binary maze experiments, where distance to every leaf was the same, it seems likely that sequences of left and right  turns were being communicated but in Stage 1 of the arithmetic experiment distance alone might be sufficient, for instance by recalling the number of steps to be taken.

This is similar to the somewhat controversial bee-waggle dance where distance is communicated by the length of the dance or in some accounts the number of cycles performed. (Frisch 1968) (Gould 1979) In bees and ants sound also seems to be important in the recruitment process.


Kolmogorov complexity or run-length encoding is an interesting way of investigating complexity. Is the degree of compression possible a good measure of the complexity of an image?

The complexity experiments show that ants are able to modify their communications to take advantage of repetitions in the messages. This is particularly so when the binary maze depth is 5 or 6 and more compression is possible.

In the arithmetic experiments the authors suggest that ants are able to perform addition and subtraction with small numbers and have numerical capacities that are approximately equivalent to those of 2 year old children, rhesus monkeys and chimpanzees.


Frisch, K. Von, 1968. The role of dances in recruiting bees to familiar sites. Anim. Behav., 16: 531-533.

Gelman, R. & Gallistel, C., 1978. The Child’s Understanding of Number. Harvard University Press, Cambridge M.A.

Gould, J., 1976. The Dance-Language Controversy. The Quarterly Review of Biology, Vol. 51, No. 2 (Jun., 1976), pp. 211-244

Shannon, C.E., 1948.  A mathematical theory of communication. Bell Sys. Tech. J.  27, 379-423, 623-656.

Reznikova, Z. and Ryabko, B. 2011.  Numerical competence in animals, with an insight from ants. Behaviour 148, 405-434

Reznikova, Z. and Ryabko, B. 2012.  Ants and Bits.  IEEE Information Theory Society Newsletter March 2012

Ryabko, B.and  Reznikova, Z. 2009. The Use of Ideas of Information Theory for Studying “Language” and Intelligence in Ants. Entropy 11, 836-853; doi:10.3390/e1104083

About Graham Shawcross

Architect PhD student at Edinburgh University Interested in order, rhythm and pattern in Architectural Design
This entry was posted in Architecture, Enumeration, Randomness and tagged , , . Bookmark the permalink.

1 Response to Counting Ants

  1. Johnc58 says:

    Hey very nice blog!! Man .. Beautiful .. Amazing .. I’ll bookmark your website and take the feeds alsoI am happy to find a lot of useful info here in the post, we need work out more techniques in this regard, thanks for sharing. . . . . . ebdbfakcebek


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s