Well, I have to say that this one came out of nowhere and took me completely by surprise. This has enthused me with all sorts of ideas that are currently ricocheting their merry way around my poor old noggin.
Let’s start with the fact that I now know more than I ever expected to learn about sashiko, which is a type of traditional Japanese embroidery or stitching that started in the Edo period (1603-1867). In turn, I now know that hitomezashi is a form of sashiko stitching. One use of hitomezashi stitching is to employ pseudo-random patterns, either for decorative purposes or to “invisibly” mend clothes (decorative, if the thread is a different color to the base material; “invisible,” if the thread is the same color as the base material because a pseudo-random pattern is harder to discern than is a regular pattern).
This all started when my chum Jay Dowling pointed me at this video on Numberphile, which — it has to be said — is one of the more interesting channels on YouTube.
As you’ll see in the video, we start out with an X-Y grid of points. We then come up with two sources of pseudo-random values to identify the columns and rows associated with the X and Y axes, respectively. In this case, the presenter — Ayliean MacDonald — uses the digits in Pi for the X axis and the letters in the phrase “May the force be with you” (omitting the spaces) for the Y axis.
The idea is to join the dots with alternating blanks or lines. In the case of the X axis, for example, for each column in the grid, if the corresponding Pi digit is odd, we start with a blank and then alternate between vertical lines and blanks. However, if the digit is even, we start with a vertical line, after which we alternate between blanks and vertical lines.
Similarly, in the case of the Y axis, for each row in the grid, if the corresponding character in our phrase is a vowel, we start with a blank and then alternate between horizontal lines and blanks. But if the character is a consonant, we start with a horizontal line, after which we alternate between blanks and horizontal lines.
Once we’re done, we can enhance the resulting image using a two-color palette. I want to try this for myself. In my case, I would use one of my favorite Dr. Seuss phrases — “How did it get so late so soon?” — as the pseudo-random source for the Y axis. On the basis that this phrase contains 10 vowels and 13 consonants, I’m going to count the ‘?’ as being a vowel to even things out a little.
As an aside, I just had a quick Google while no one was looking. I tried searching on, “Typical ratio of vowels to consonants in written English,” but I couldn’t find anything relevant. On the bright side, I did discover that the Andoke language spoken in Colombia has 10 consonants and 9 vowel qualities, while the Abkhaz language spoken in Georgia (the country, not the US state) has 58 consonants but only 2 vowel qualities. I only hope that I one day find an occasion to drop this tidbit of trivia into a conversation before I shuffle off this mortal coil.
Returning to the point at hand, I’d like to start by generating an image as a combination of my “How did it get so late so soon?” phrase and Pi (3.1415926535 8979323846 2643383279…). Then I’d like to compare this to an image created using the same phrase combined with Euler’s number ‘e’ (2.7182818284 5904523536 0287471352…), and also with the golden ratio (1.6180339887 4989484820 4586834365…).
I think it would be interesting to contrast and compare these different versions (can you think of any other magic numbers with which we might wish to play?). I was also thinking of creating physical incarnations all these various representations using patterns of different colored woods.
In closing this blog to you, I will repeat what Jay said in closing his email to me:
PS It would be awesome to have a website where you could type in the two axis strings, set rules, and be presented with the output on-screen.
PPS She [the presenter] sure knows a lot of Pi digits.
PPPS My daughter would love her [the presenter’s] nails.
I don’t believe any of us could argue with any of these points, especially the first. What say you? Do you have any thoughts you’d care to share about any of this?
I wonder how hard it would be to write a program to create these patterns… I might have a go at it when I retire at the end of the year. I need a project to learn Python and this might just be the thing.
I think this would be a perfect project for that — I like the idea of being able to specify any phrase on the Y axis and then pick an irrational number or something for the X axis — you could even pick the values for both axis by tossing a coin — I’d love to see how they turn out.
Not so hard, I wrote one that outputs an SVG, using python. 305 lines of code, took me about 3 hours (but at least 2 hours of that were invested in knowing how SVG works, because I didn’t want to use the Python SVG libraries, didn’t understand it, so I chose to learn SVG by myself). I am no expert, am just a novice. Am sure it can be done with less lines and way faster.
I can choose if I want to start the pattern with the vowels, consonants, evens or odds.
However, I still need to fix an issue with alphanumeric strings…
Also have an issue in which I need to change something in the program before running it (I know how to fix it, but it’s faster to make the change manually hahaha)… Have to know if I’m going to use numbers only or letters only before running it to make the change. But besides that, it works great.
Try it, it’s a good project to learn the basics of Python.
I tried the ones in the video, “maytheforcebewithyou” and Pi. And it outputs exactly the same pattern! (However, I have to input “ouyhtiwebecrofehtyam” haha, because that’s how she wrote it in her pattern)
I’m still trying to work out what prompted her to write it the way she did — not that it matters, but… LOL
Yea, not sure why she did that either haha.. anyways, I found this generator program… No need to re-invent the wheel, unless you want to learn python or other programming language.
https://glitch.com/edit/#!/hitomezashi?path=README.md%3A1%3A0
Greetings!
This is great — thanks for sharing — but I think I would like to try coding this myself just for fun
Sadly, the first drawing she did looked like a recent circuit simulation I did that was supposed to look orderly and periodic…
Maybe you have an innate skill for Japanese stitching — your mother will be no doubt be delighted to hear that we’ve finally discovered what your innate skill actually is LOL
Is that like a superpower? I might try that explanation with the boss.
Go for it — tell him I said “Hi”