Monday, February 13, 2012

Set theory and knitting notation: update

Previously on Arachne's Loom....
I got stuck when this question came up: Can a cyclic group have repeating elements, such as (1, 2, 2, 1) or equivalently, (1, 1, 2, 2)?
See, in the set theory model of knitting I'm working on, there are only two elements: knit and purl. Obviously, those repeat a lot in knitting patterns. So the pattern/cycle of stitches in a given position in the row is going to have repetitions.

I emailed my professor, and he said he'll "have to give it some thought." Crazy!

Also, I have to clean up some mistakes from last night.

Consider the 2x3 rib pattern over 20 stitches.
Knitting notation:
Row 1: K2, P3, repeat to end of row.
Row 2: K3, P2, repeat to end of row.

In set theory terms, I notated the domain (Row 1) and range (Row 2) as follows:
Row 1: KKPPPKKPPPKKPPPKKPPP
Row 2: PPKKKPPKKKPPKKKPPKKK

MAJOR IMPORTANT NOTE: Row 1 is written left to right; Row 2 is written right to left.

That's because in knitting, you turn the work at the end of each row. Alternating rows having you facing the "right side" (outside) or "wrong side" (inside) of the garment. That's just the mechanical nature of knitting.

So your progress goes like this:

--> -->  --> --> --> -->     End of row!
<-- <-- <-- <-- <-- <--

[Clearly I'm a legit graphic designer. You get the idea.]

What do knit and purl mean, anyway? A stitch is just a loop of yarn pulled through the loop in the previous row. The loop faces you. Knit: the new loop is pulled through from back to front. Purl: from front to back.

So it follows that purling from the back (wrong side) is the equivalent of knitting from the front (right side).
That's why a rib pattern, which I notated

Row 1: KKPPPKKPPPKKPPPKKPPP
Row 2: PPKKKPPKKKPPKKKPPKKK

Looks like this:

 

The neat little rows are the result of knitting 2 stitches, then purling 2 right below them, and so on. Stitches you knit on a given side will stand OUT on that side; stitches you purled will recede. Flip it over and you have the reverse. (Knitting exploits this property to get all kinds of different textures.)

So if you purl on the even rows (facing the wrong side), the resulting stitches look like knitting on the right side.
So in the set-theory model, it might make more sense to represent the stitches AS THEY APPEAR from the right side.

The ribbing pattern becomes:
Row 1:  KKPPPKKPPPKKPPPKKPPP
Row 2:  KKPPPKKPPPKKPPPKKPPP

Looks more like the picture, doesn't it? Each rib looks like it's made of the same kind of stitch.

Ribbing is usually reversible, as long as each rib is the same width; for example, K3, P3, etc. That's called a 3x3 rib, as opposed to the 2x3 rib I used as an example.

Let's look at some-reversible patterns to confirm that this all-left-to-right notation makes more sense.

DOUBLE SEED STITCH (again), 10 stitches per row
Knitting notation:
Row 1: K1, P1, repeat to end of row.
Row 2: "        "
Row 3: P1, K1, repeat to end of row.
Row 4: "       "

Set theory notation:
Row 1: KPKPKPKPKP
Row 2: KPKPKPKPKP
Row 3: PKPKPKPKPK
Row 4: PKPKPKPKPK

Okay, that's just making it more confusing because the two coincide. Next.


DIAMOND BROCADE
17 stitches per row (can be any 8x + 1), repeat every 8 rows.





Knitting notation:
Row 1: K4, [P1, K7], P1, K4
Row 2: P3, [K1, P1, K1, P5], K1, P1, K1, P3
Row 3: K2, [P1, K3, P1, K3], P1, K3, P1, K2
Row 4: P1, [K1, P5, K1, P1], K1, P5, K1, P1
Row 5: [P1, K7], P1, K7, P1
Row 6: P1, [K1, P5, K1, P1], K1, P5, K1, P1
Row 7: K2, [P1, K3, P1, K3], P1, K3, P1, K2
Row 8: P3, [K1, P1, K1, P5], K1, P1, K1, P3
(The segments in brackets can be repeated to make the work wider.)

Set theory notation:
Row 1: KKKKPKKKKKKKPKKKK
Row 2: KKKPKPKKKKKPKPKKK
Row 3: KKPKKKPKKKPKKKPKK
Row 4: KPKKKKKPKPKKKKKPK
Row 5: PKKKKKKKPKKKKKKKP
Row 6: KPKKKKKPKPKKKKKPK
Row 7: KKPKKKPKKKPKKKPKK
Row 8: KKKPKPKKKKKPKPKKK

There's a different cycle for each column (position in the row).
Column 1 goes (1, 1, 1, 1, 2, 1, 1, 1). So do columns 9, 17, etc.
Column  2 (or any column 8x + 2): (1, 1, 1, 2, 1, 2, 1, 1, ).
Column 3: (1, 1, 2, 1, 1, 1, 2, 1).
Column 4: (1, 2, 1, 1, 1, 1, 1, 2).
Column 5: (2, 1, 1, 1, 1, 1, 1, 1)
Column 6: same as Column 4
Column 7: same as Column 3
Column 8: same as Column 2

....






ZOMG! It's a cycle of cycles!







Not just that, but the columns and rows repeat in the same pattern.
Symmetry jackpot.



To be continued.

Sunday, February 12, 2012

Set theory and knitting notation, cont.

Still working out the details, but seriously, rows of stitches are like sets, and knitting patterns are like groups or functions that act on the sets! It's just like transformation theory in music!

Say you have a tone row, where the notes C through B are represented as pitch classes 0 to 11.

Random tone row: 3 7 6 2 1 9 5 8 11 10 4 0

Function: T3 (transpose up 3 chromatic steps).

Elements in the domain (original tone row) map to elements in the range (resulting tone row) according to the function x + 3 (add 3).

Resulting tone row: 6 10 9 5 4 0 8 11 2 1 7 3

In other words, 3 maps to 6, 7 maps to 10, etc.
You could write this as three cycles: (0, 3, 6, 9), (1,4, 7, 10), (2, 5, 8, 11)
These are called orbits: an element can't map to anything outside its orbit, no matter how many times you apply the function.

Anyhoo, the function turns one tone row into another that is a rearrangement of the same elements. Similarly, in knitting, any function (pattern) will take a row of knits and purls and produce another row of knits and purls in some other order. And that's how you knit cool textiles. Just two different stitches, but mix them up and the possibilities are endless!

Off to geek out. I mean, sleep.

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.