Google Analytics

Friday 18 February 2022

Factorials (or Bonding with Brague)

Dear Bob,

As I am sure you know, the factorial of any positive whole number is that number multiplied by all the numbers between it and 1.

So the factorial of 3 = 1 x 2 x 3 = 6
And the factorial of 5 = 1 x 2 x 3 x 4 x 5 = 120

I am also sure that, as a computer programmer, you could quickly write a program to calculate the factorial of any number N. One way to do it would be to set up a counter to cycle through all the numbers between 1 and N, multiplying each by a running total that is initially set to 1. In an imaginary programming language it might look like this:

RunningTotal = 1
FOR Counter = 1 to N
Multiply RunningTotal by Counter; (thereby altering the value of RunningTotal)
The factorial of N = RunningTotal

So, in calculating the factorial of 5, each step of the cycle would produce the following values:

 Counter   Multiplication of
 RunningTotal x Counter 
 New Value of
 RunningTotal 
1 1  x  1 1
2 1  x  2 2
3 2  x  3 6
4 6  x  4 24
5 24  x  5 120

But there is a more elegant way. This involves thinking of the factorial of any number N as being that number multiplied by the factorial of N-1.

So the factorial of 3 = 3 x 2 = 6
And the factorial of 5 = 5 x 24 = 120
And the factorial of 6 = 6 x 120 = 720

In our imaginary programming language, the program to calculate factorials using this method might look like this:

The factorial of 1 = 1
The factorial of N = N x the factorial of (N-1)

This is known as a recursive function because it has to re-use itself at each step of the calculation. For example:

The factorial of 5 = 5 x (the factorial of 4)
    The factorial of 4 = 4 x (the factorial of 3)
        The factorial of 3 = 3 x (the factorial of 2)
            The factorial of 2 = 2 x (the factorial of 1)
                The factorial of 1 = 1 (this causes the calculation to “unwind”)
            So, the factorial of 2 = 2 x 1 = 2
        So, the factorial of 3 = 3 x 2 = 6
    So, the factorial of = 4 x 6 = 24
So, the factorial of 5 = 5 x 24 = 120

Isn’t that just exquisite!

Now, for homework, please would you explain the operation of recursive descent parsing giving examples from the Hebrew and Cherokee languages.

Sincerely yours

Monday 14 February 2022

Sisters

This started out as one of those Google-powered rabbit burrows, beginning with Norma Waterson, the folk singer, who died at the end of January. She was born in ‘ull (American and non-Yorkshire: Hull). Mr YP mentioned her recently, and also, not so long ago, David Bowie’s collaborator Mick Ronson, who was also born in ‘ull. What other singers were born there, we wondered.

It sent me back to my mother’s Light Programme on the wireless in the nineteen-fifties. You would hear Ronnie Hilton singing about a mouse in a windmill with triplets and twins in, going clip-clippety-clop on the stair. He was born in ‘ull. David Whitfield too, the first British singer to have a number one in both Britain and the U.S. with the magnificently emotional Cara Mia.

Dickie Valentine was another of that era. What about him? Well, no, he was from London. What did he sing, then? Finger of Suspicion and Christmas Alphabet. But I thought Christmas Alphabet was by a female American group.

Yes: The McGuire Sisters. I remember them more for Sugartime. It’s on YouTube. Listen to those counter-melodies. Weren’t they good!


What about the Beverley Sisters: that’s near ‘ull. But they weren’t from Beverley; they were from London. Joy, Babs and Teddie. They were good too, and pretty, with distinctive harmonies. Here they are aged 20 and 23 (with 1947 cultural sensibilities): 

The matching qualities, the timbre, of family group voices can make pleasant listening, especially sisters. Take the Dale Sisters: Betty, Hazel and Julie Dunderdale, one of many sister acts that almost made it but not quite. They weren’t quite from ‘ull, but near enough to count. Their dad was a local butcher and Julie married our Geography teacher. They got off the ground in 1959 by winning a talent contest at Butlins holiday camp in Filey. They were also known as the England sisters:


The YouTube links, if you can’t see them are:
McGuire Sisters: https://youtu.be/bRvEHn6fKWE