### The Mathematics of Lavender Wands

I’ve been staying in a little place in Portland for the last few weeks, and I noticed that there’s a lavender bush starting to bloom in the garden outside. In my family when the lavender blooms we all make lavender wands, so I picked up some ribbon and got to work.

The basic notion is:

- Grab a bundle of twenty or so stems,
- Tie the end of the ribbon around the heads,
- Bend the stems down over the ribbon so they cover the buds,
- Weave the ribbon through the stems, making a container around the buds, and
- Tie it off at the bottom of the heads with a bow.
- Optionally wind the ribbon down around the “handle” of the wand for a nice effect.

There’s some cute math to this, though! If you’re weaving 1-over-1-under you’ll
need an *odd number of stems.* Otherwise every stem will have all “overs” or all
“unders” and the whole thing will fall apart.

By modifying the number of stems and the weaving pattern (that is, the number of overs and number of unders) we can weave different patterns.

For example, if we wanted wider visible blocks of ribbon, we could weave 2-over-2-under. If we still wanted a checkerboard pattern, though, we’d need to change the number of stems. The width of the repeated weaving pattern is 4 stems (2-over-2-under), and we want each block to be offset from the series above by 2 stems. So the number of stems must be 2 greater than a multiple of 4.

Mathematically, we’d need the number of stems to satisfy:

Realistically, we’ll also want to be able to repeat our pattern at least three times per go-around. We’ll also want to keep our wands fairly small. Let’s add the further constraint that:

Here’s the set of possible numbers of stems that will satisfy these constraints (and thus work for this weaving pattern):

For a given weaving pattern and offset, how many stems should we use?

Let’s identify the variables and find a general set of constraints. We’ll call the pattern width and the offset . In the above example, (from “2-over-2-under”) and (since we want the pattern on subsequent rows to be shifted over by 2 stems).

We want to find the number of stems satisfying the equations:

As another example, suppose we want to weave a pattern of 2-over-3-under with an offset of 1—this makes a pretty spiraling pattern. Let’s just plug in for and 1 for and solve:

Our pattern should work if our number of stems is equal to any of these solutions (the wand photographed here uses this pattern with 21 stems).

### A Lavender Wand Stem Count Calculator

Now that we’ve got this system of constraints, we might as well whip up some code so we won’t have to solve it by hand any more.

If you’ve got a blooming lavender bush nearby, give it a shot! Weaving a lavender wand is awfully relaxing, and it’s easy to experiment with nifty patterns.