Sunday, February 12, 2012

Set theory and knitting notation

Why am I even still up? Once again, the knitting muse is luring me away from constructive pursuits like practicing or sleeping. I don't even know if this idea is unique, or if it's been done before, but I just came up with a mathematical way of notating knitting patterns: mapping.

It's simple, really. Basics of set theory: elements in the domain (first set) map to elements in the range (second set) according to whatever function you're using. Example:

Domain:     1   2   3   4
Range:       2   3   4   1

In this mapping, 1 "goes to" 2, 2 goes to 3, 3 goes to 4, and 4 goes back to 1.
If you start with the ordered set [1, 2, 3, 4], after one iteration of the function, you'll have [2, 3, 4, 1].  After two iterations, [3, 4, 1, 2]; after three, [4, 1, 2, 3], and four iterations bring us back to [1, 2, 3, 4].
This can also be expressed as the cyclic group (1, 2, 3, 4). This notation illustrates the path of an element. It goes through the numbers in ascending order, as opposed to, for instance, (3, 1, 2, 4). In that case, 3 maps to 1, which maps to 2, which maps to 4, which maps back to 1.
I'd like to add at this point that I have no idea how coherent I am right now. It's late. 

In the case of knitting, the function is the pattern. It determines what stitch (knit or purl) you do based on the stitch in the previous row, in the same position in that row.

Here comes the leap! Let's notate a knit 1, and a purl 2.

A standard pattern will tell you the order of stitches in each row. For example, look at a 3x3 rib pattern worked over 24 stitches. The pattern will say something to the effect of:
Row 1: K3, P3, repeat to end of row.
Repeat.

Or to generalize (because I feel like that might be useful later), let's talk about an n by m rib pattern worked over x stitches, where x = (n + m) times some constant.
The abstract pattern will read:
Row 1: K n, P m, repeat to end of row.
Row 2: K m, P n, repeate to end of row.
Repeat.

Suppose n = 2, m = 3, and x = 20. That is, knit 2, purl 3, repeat over 20 stitches.
Row 1 can be written: KKPPPKKPPPKKPPPKKPPP
Row 2 "       " :           PPKKKPPKKKPPKKKPPKKK

Looks like a domain and range to me!

This rib is a 2-row repeating pattern, and every stitch is the opposite of the stitch in the same position in the previous row. It's pretty easy to express mathematically: K maps to P, and P maps to K. Or in the set theory model I'm making up right now, 1 maps to 2, and 2 maps to 1.

Ladies and gentlemen, we have a cyclic group!
(1, 2)

Yay.

Okay, let's try fancier knitting patterns.

DOUBLE SEED STITCH
This is a 4-row pattern worked over an even number of stitches (meaning the number of stitches in each row is even). Pattern reads:
Row 1: K1, P1, repeat to end of row.
Row 2: Repeat.
Row 3: P1, K1, repeat to end of row.
Row 4: Repeat.

This produces a cool texture because it's basically a 1x1 rib that's reversed every two rows.

In the set theory model, assuming x = 10 (meaning we're knitting something 10 stitches wide, like a headband):
Row 1: KPKPKPKPKP
Row 2: PKPKPKPKPK
Row 3: PKPKPKPKPK
Row 4: KPKPKPKPKP

The cyclic group would be written (1, 2, 2, 1).
Wait, is that even a legitimate group? Excuse me while I consult my Intro to Abstract Algebra book. Groups... Cyclic Groups... here we are.
"If the multiplicative group G contains an element a such that G = {a^k, where k is a positive integer}, we say that G is a cyclic group and that G is generated by a or that a is a generator of G." (McCoy & Janusz, An Introduction to Abstract Algebra, 2001)

And this, kids, is why you take an actual course, instead of winging it like I'm doing now.

To be continued.

No comments:

Post a Comment