# Enigmatic Code

Programming Enigma Puzzles

## Enigma 976: This happy breed

From New Scientist #2131, 25th April 1998 [link]

At the end of 1991 the Society for the Protection of Our Obscure Furry Friends (SPOOFF) released a trial number of breeding pairs (born in March of that year) of the spotted tree-rat Sciurus maculatus incastus in the small forested island of Yorkiddin.

The result is a doubtful success. In 1997 they found that the island was being overrun: the local foresters were seeking compensation for damage and local rare species of birds were near extinction.

Tree-rats are born in March, and are driven from the patch of forest of their birth at the end of that year. They find a new patch, always of 2500 square metres, and immediately start breeding. They die in the fourth December of their lives. The society realised too late that every year each pair invariably produces 2 pairs of young, each of which incestuously produces 2 more pairs next year. In 1998 the number of pairs will reach nearly 6000.

The process will continue until the population reaches its limit at the beginning of 2000, when the whole forested area will have been partitioned into occupied territories.

What is the forested area in hectares? (One hectare is equal to 10,000 square metres).

[enigma976]

### One response to “Enigma 976: This happy breed”

1. Jim Randell 10 January 2020 at 8:26 am

Each pair is born in March of year 0. In March of year 1, they give birth to two pairs. In March of year 2, they give birth to two more pairs. In March of year 3 they give birth to two more pairs, and in December of year 3 they die.

This Python program keeps track of the number of pairs in their 1st, 2nd, and 3rd breeding years at the end of each calendar year. It runs in 84ms.

Run: [ @repl.it ]

from enigma import irange, divf, printf

# the number of pairs in their 1st, 2nd, 3rd year
ps = [ 1, 0, 0 ]

# number of initial pairs
k = None

# consider years
for y in irange(1991, 1999):
t = sum(ps)
printf("[year end {y}: pairs = {ps}, total = {t}]")
# Mar: all pairs give birth to two more pairs
ps.insert(0, 2 * t)
# during 1998 the total number of pairs is nearly 6000
if y == 1997: k = divf(5999, sum(ps))
# Dec: all 4th year pairs die off
ps.pop()

printf("[initial pairs = {k}]")

# each pair requires a 0.25 ha territory
area = k * t * 0.25
printf("year beginning {y1}: territories = {t}; total area = {area} ha", y1=y + 1)

Solution: The forested area is 4143 hectares.

Each initial pair leads to a separate dynasty. We can consider the population of a single dynasty at the end of each year.

By the end of 1991 there will be 1 pair.

By the end of 1992 that pair will have given birth to 2 new pairs, so there will be 3 pairs in total.

By the end of 1993 each of the 3 pairs will have given birth to an additional pair, so there are 6 new pairs, and 3 + 6 = 9 pairs in total.

By the end of 1994 each of the 9 pairs will have given birth to an additional pair, so there are 18 new pairs, but the initial pair will have died off, so there are 8 + 18 = 26 pairs in total.

The number of pairs in the dynasty continues as follows:

1991: 1
1992: 3
1993: 9
1994: 26
1995: 76
1996: 222
1997: 648
1998: 1892
1999: 5524

(See: OEIS A119826 [ @oeis.org ]).

At the beginning of 1998 there are 648 pairs in each dynasty, after March there will be 1944 pairs, and at the end of the year there will by 1892 pairs.

If we look at the maximum number of pairs during 1998 we find 1944n is nearly 6000 when n = 3. So there are 3 separate dynasties, each originated by one of 3 initial pairs.

So, at the very beginning of 2000 there are 5524 × 3 = 16572 pairs that need a territory, at 0.25 ha per territory this is 4143 ha.

This site uses Akismet to reduce spam. Learn how your comment data is processed.