Sunday, December 1, 2013

Useless Knitting Math

I’ve been knitting Martina Behm’s pattern, Hitchhiker.  When Martina designed this pattern, she knit it with 150g of Wollmeise yarn, which allowed for 42 teeth. According to Douglas Adams’s book, The Hitchhiker’s Guide to the Galaxy, 42 is the answer “to the Great Question of Life, the Universe, and Everything.” With 42 teeth, this scarf begged to be named Hitchhiker.

It is a pretty, slightly asymmetrically shaped triangular scarf. It is mostly garter stitch, so your hands can knit while your mind wanders hither and yon. (The only tricky part is keeping track of increases for the teeth. I read a helpful tip on Comanchewmn’s project in Ravelry – see her project page here.)

So, while knitting, my mind wanders a bit. I think about new movies (Can The Book Thief possibly be as good as the book?), and about the Lamb of God oratorio (Kalamazoo folk: you should plan to either sing, or attend). I think about what Christmas presents to buy, what to serve for Christmas Eve dinner. I wonder, what does the fox say?

And I wonder what percentage of my Hitchhiker is done.

It's not as easy as counting teeth. For example, here is an early version of my Hitchhiker, with ten teeth completed. You can see that half of those teeth (five) does not represent half the knitting.


Each row is longer than the previous rows, so... How many of my 42 points do I have to knit, in order to knit half the scarf (half the stitches)?
This is, of course, a Useless Knitting Math question.

There is Useful Knitting Math. Gauge involves useful knitting math. If you need a 20” hat, and the pattern says the proper gauge should be 5 stitches per inch, and you cast on 100 stitches, all is going to be fine, and you will be stylish in your new hat. 100 stitches * 1 inch / 5 stitches = 20 inches.

But if your gauge is 4 stitches per inch, and you blithely cast on those 100 stitches, surprise! Your hat is going to be 25” and will fall over your eyes. You will not be stylish (and you might trip over your beagle). 100 stitches * 1 inch / 4 stitches = 25 inches.

That is Useful Knitting Math.

Still. Some of us are okay with useless math, so I continue to ponder this. And here is the answer I come up with – the equation that will tell you what percentage of your Hitchhiker scarf is complete:
( ( ( ( (t-1) * t ) + t ) * 16 ) + 33t ) / 29610 * 100%
( 16t2 + 33t) / 29610 * 100%
     where t = number of completed teeth1.
So, if a scarf has 21 teeth (half the total teeth), it is 26.17% complete (definitely not 50%).

Here is a recap of some teeth counts and the corresponding percentage complete. My Hitchhiker currently has 30 teeth, which turns out to be approximately the 50% point:
Teeth% Complete
51.91
106.52
1513.83
2023.84
2536.56
3051.98
3570.09
4090.92
Created with the HTML Table Generator
The rest of this post is my effort to explain how I came up with this (so that when I am senile, I can look back in amazement at how my thoughts carried on). You, of course, are free to cover your eyes and run away (screaming, if you like).

* * * * *

To start, I looked for an identifiable pattern. Basically, each tooth consists of 8 rows, with increases and decreases to create the teeth. So each row has two parts – the plain part, which is 8 rows of however many stitches we’re up to. This stitch count starts at 2, then increases by 4 for each tooth. The second part is the set of increases and decreases that creates the tooth itself, and this appears to be 33 stitches (that’s the total for the tooth – not per row). So:
Tooth 1: 8 rows of 2, plus 33
Tooth 2: 8 rows of 2, 8 rows of 4, plus 33
Tooth 3: 8 rows of 2, 8 rows of 4, 8 rows of 4, plus 33
What I really need to know is, with each new tooth, how many total stitches are there? For the tooth part, it’s pretty easy. Since each tooth contains 33 stitches, just multiply t times 33, where t is the number of teeth.

The plain part was the tricky piece. I needed to multiply 8 by some number, and that number wasn’t exactly a multiple of the number of teeth. Mostly it was multiples of 4, plus that first set of 2.


Eventually I came up with this pattern:
2 teeth: (4*1) + 2 + 2 (see the blue outline)
3 teeth: (4*1) + (4*2) + 2 + 2 + 2 (see the green outline)
4 teeth: (4*1) + (4*2) + (4*3) + 2 + 2 + 2 + 2 (see the orange outline)
5 teeth: (4*1) + (4*2) + (4*3) + (4*4) + 2 + 2 + 2 + 2 + 2 (and so forth)
6 teeth: (4*1) + (4*2) + (4*3) + (4*4) + (4*5) + 2+ 2 + 2 + 2 + 2 + 2
(Eventually I realized that for 1 tooth, it was (4*0) + 2.)

Using the associative property (I remembered something from school!), I reduced those calculations to:
1 teeth: 4*0 + 2*1
2 teeth: 4*1 + 2*2
3 teeth: 4*3 + 2*3
4 teeth: 4*6 + 2*4
5 teeth: 4*10 + 2*5
6 teeth: 4*15 + 2*6
Hmmm.  I knew there are different types of functions or sequences in mathematics. (For instance, I’ve used the Fibonacci sequence to define stripes in knitting.) I wondered if 1, 3, 6, 10… was a recognized sequence. So I did what everyone does in this day and age.

I Googled it.


That fourth entry turned out to have just what I needed. It gave the sequence a name (Triangular Number Sequence, and okay, I didn’t really need that); it explained how the sequence was generated (interesting! go read it!); and (most importantly) it provided a rule for calculating any triangular number:
n(n+1)/2
where n specifies which number you’re trying to figure out – in my case, which tooth we’re on.

So now, to figure out how many stitches I have in that plain part, I could use a formula. In my calculations above, I could replace the sequence 1, 3, 6, etc with this formula for the triangular number.  The sequence begins with tooth 2 (not 1), so I had to use t-1, or tooth-1, as my n:
2: 4*1 + 2*2 became (4*(t-1)(t-1+1)/2) + 2*(t), or (4*(1)(2/2) + 2(2) = 8
3: 4*3 + 2*3 became (4*( t-1)(t-1+1)/2) + 2*(t), or (4*(2)(3/2) + 2(3) = 18
4: 4*6 + 2*4 became (4*( t-1)(t-1+1)/2) + 2*(t), or (4*(3)(4/2) + 2(4) = 32
5: 4*10 + 2*5 became (4*( t-1)(t-1+1)/2) + 2*(t), or (4*(4)(5/2) + 2(5) = 50
6: 4*15 + 2*6 became (4*( t-1)(t-1+1)/2) + 2*(t), or (4*(5)(6/2) + 2(6) =72
For tooth 1, this formula works as well:
1: (4*(t-1)(t-1+1)/2) + 2*(t), or (4*(0)(1/2) + 2(1) = 2
I did some reducing, to simplify the equation1:
4*(t-1)*(t-1+1) / 2 + 2t
4*(t-1)* (t/2)          + 2t
2*(t-1)*t                 + 2t
2*    (((t-1)*t)  + t)
2*     ((t * t) - (1 * t)  + t)
2*    (t2)
Now, I had to multiply this by 8 (8 rows per plain part), and add 33t (33 stitches per tooth)
(16 * (t2)) + 33t
Calculating for 42 teeth, there are 29610 stitches. So, to calculate the percentage complete at any tooth:
(16 t2 + 33t) / 29610 * 100%
Voila!

Disclaimer: I got really tired of reading and checking this. So I am going to hit Publish and hope it is correct...

ETA:
1: I was working late last night, and as I finished up, I glanced at these notes, and realized it could be further simplified. So I made that change to this post, as noted. So much simpler...!

1 comment: