A confession: the single hardest thing for me in trying to learn computer programming, specifically loops, is one very, very basic issue - counting.
That's right. I can't count properly.
All my life, I've had problems with the difference between numbers, and the intervals between numbers. Even though I have A's in A Level Mathematics and Further Maths, and I passed the Mensa IQ test. It just shows how meaningful test results are, eh?
1, 2, 3. That's 3 numbers. But, there are 2 steps between them. What are we talking about: how many numbers, or how many steps there are between those numbers? I always have to stop and think about that before I can carry on. The difference is not instinctive: I actually find it very confusing, and I often mix them up. Even though it's basic arithmetic.
So when I'm looking at an example of a loop, or trying to write a loop, I have to work through a couple of actual instances before I know whether it should be < or <= (less than, or less than or equal to), or if it should be > or >=, simply in order to get the correct number of repetitions.
Interestingly, I'm not alone. When I admitted this to my best friend, she told me that in fact she has exactly the same issue.
When she was 4 or 5 years old, she drove her teachers mad. They lined up cardboard pink elephants to illustrate addition and subtraction, and she just couldn't grasp that X number of elephants minus one elephant produced a particular number of remaining elephants. She was more concerned with the interval between the final elephant and the one that had just been removed - what had happened to that? What happened to the space between two objects if you took away one of them (as if the elephant were a bookend), did the space "fall out", where did the space go, doesn't the removal affect everything else? They had to tell her to shut up and stop worrying about that - just worry about the elephants!
And she felt that intervals had properties, and that numbers had "directionality" - that the interval between 2 and 1 is not the same as the interval between 1 and 2. Surely the interval between 2 and 1 isn't 1, it's minus 1. (She also wanted to know: where did the elephant that had been taken away go, what had they done with it, and why? Surely that might have an impact on the elephants that remained? But they weren't interested...)
I must admit I didn't go quite as far as all that, myself. But still I have a problem with things, and the spaces between things, and boundaries / limits - when do you count the thing itself that's at the upper or lower boundary of what you're dealing with, and when do you not.
I think that maybe my friend and I both visualise numbers as actual objects, locations in 2D (or perhaps 3D) space. I'm not sure if that's an example of us both having a kind of number form synaesthesia, or if that's just a child's way of trying to grasp abstract concepts like arithmetic by unconsciously using a number line.
Like, what happens exactly when you add and subtract? What are you doing, what are you counting? The numbers, or the spaces between them?
Does 3 - 1 = 2 means there are 2 steps between the number at location 1, and the number location 3? Is that how subtraction works?
But hang on, what about addition then? 1 + 3 = 4. How does that work, in terms of spaces between locations 1 and 3? Confusion...
Solution: aha, you're counting the number of steps away from 0 that a number is. Addition is just adding up the distance the first number is from 0, to the distance the second number is from 0. And subtraction is the difference between the two distances.
Got it. Sort of.
Oddly enough, I don't have the same sort of problem with multiplication, division etc - probably because I've just memorised the multiplication tables, 3 x 4 is 12, and that's just the way it is.
So effectively this means I've never understood the fundamental hows and whys, why things are the way they are - I've just memorized a few set things, and then I apply them; I can do that at least!
If I could just figure out exactly what I need to memorise for a basic loop - this structure gives you that type of counting / number of iterations, this other structure gives you that other type of iteration - I think I'd be there, at least for the basic stuff.
Relationships, proportions and different types of things
I have also always had a problem with relationships or proportions involving different types of things.
You know, things like, if 3 elephants are equivalent to 20 chickens, how many elephants would equate to 50 chickens? The only way I managed to get through all that (and I still have to do this today), was to be utterly mechanical about it.
I worked out a formula. You line up the "like" things (elephants) on the left, and, in the top line, you put the other thing that you know about on the right.
Known_type2 equates to Known_type1
Unknown_type2 equates to WHAT?
And then I'd know the answer was to go through 2 sides of a triangle which I'd memorised by rote: Top right x Bottom left ÷ Top left. Seriously.
20 chickens = 3 elephants.
50 chickens must be 3 x 50 ÷ 20 elephants.
If they gave me the number of elephants for the second time, I'd have to line it up differently but use the same formula, similar things on the left:
3 elephants = 20 chickens.
8 elephants must be 20 x 8 ÷ 3 (top right x bottom left ÷ top left).
To this day, I've never developed an instinctive feel for what goes with what and how you put them together.
I wonder if all this says something interesting or profound (or not!) about me and my friend compared with other people, or about the concept of numbers, or how children learn to conceptualise numbers - and if so, what on earth that would be.
Are we alone, or do other people have similar issues?
My friend of course looks at it another way. She said, when they asked her: "If it takes 3 men each using a 2.5 litre bucket X minutes to fill a pond, how long would it take 2 men using 7 litre buckets?", she thought - I really don't care; why can't they just use a hose?