Shirley

At the BAA webinar on 20th September 2020, Ray Polivka described a programming test set in the 1950s in the course "Programs1" in the ILLIAC work at Illinois University: "Shirley's weight at birth was X tons stored in location A, For the first 20 weeks her weight increase linearly by 8 oz per week. After that the rate of growth declines by a constant factor, held in location B, every four weeks. What is Shirley's weight at 16 weeks and at 52 weeks?"

Polivka observed that since the pupils were writing binary code with a handful of registers and only 1 Kb of memory, this was quite a stiff problem to encounter on your first course.

The webinar participants discussed this for quite a while at the end of which Curtis Jones said Adám Brudzewsky's approach was a good example of APL as a tool of thought. Ellis Morgan commented that the problem is effectively a sum of a geometric series here. The function  is a traditional function which one might have written in 1970 (except for the Mix in the definition of  ):

Starting with a birth weight of 100 ounces (six pounds four ounces), using a decay factor of 0.9 (meaning that growth in this month is 0.9 times the growth in last month) and using UK Imperial tons we get this answer:

Try it online!

For the  complete months after month 5 the total weight increase is   which we know is   (sum of a geometric series).

Even if Shirley lives to be 100, applying  over all the weeks is unlikely to cause any problematic performance.

Try it online! So we see, with these assumptions, Shirley grows from 6 pounds and 4 ounces at birth to 1 stone and 4 ounces at 16 weeks and to 1 stone, 13 pounds, 15 ounces and 4 drams when a year old.