
The mathematics of weaving patterns — symmetry, tessellation, and algorithmic thinking.
The Pattern
In the Riang villages of northern Tripura, every house has a musuk — a woven bamboo and cane wall panel, so tightly constructed that it keeps out rain, wind, and insects. From a distance, a musuk looks like a simple wall. Up close, it is a masterpiece of geometry.
Hamjabai Riang was fourteen and had been weaving cane since she was eight. Her grandmother, Buisu, could weave a musuk panel in a single day — 2 metres wide, 3 metres tall, every strip interlocking at exact right angles, creating a pattern that was both structural and beautiful.
"Each strip goes over two, under one, over two, under one," said Buisu, her fingers moving too fast for Hamjabai to follow. "If you change the count — over three, under two — you get a different pattern. Every combination has a name."
Hamjabai had noticed something. The patterns were not random. They had symmetry — the same motif repeated across the panel in a regular grid. Some patterns looked the same if you flipped them. Others looked the same if you rotated them 90°. Some looked the same under both operations.
"Buisu," she said, "are these patterns mathematics?"
"They're weaving," said Buisu. "If your school wants to call it mathematics, that's the school's business. I call it knowing which strip goes where."
The Binary Logic of Weaving
Hamjabai's mathematics teacher, Sir Debabrata, saw her notebook of weaving patterns and got excited.
"This is binary," he said. "Every intersection in the weave is a choice: the warp strand goes over the weft strand, or under it. Over = 1. Under = 0. The entire pattern can be written as a grid of 1s and 0s."
He showed her a simple 4×4 pattern:
1 0 1 0 0 1 0 1 1 0 1 0 0 1 0 1
"That's a plain weave — the simplest pattern. Over-under-over-under. Now look at your grandmother's musuk pattern:"
1 1 0 1 1 0 0 1 1 0 1 1 1 0 1 1 0 1 1 1 0 1 1 0 0 1 1 0 1 1 1 0 1 1 0 1
"Over-over-under repeating. This is a twill weave — the same structure used in denim jeans and gabardine fabric. Your grandmother independently invented the same weaving algorithm used in textile factories worldwide."
Symmetry Groups
Sir Debabrata taught Hamjabai about the four symmetry operations: - Translation: slide the pattern left/right or up/down - Rotation: turn the pattern 90°, 180°, or 270° - Reflection: flip the pattern across a horizontal or vertical axis - Glide reflection: slide + flip combined
"Every repeating pattern in a flat surface belongs to one of exactly 17 symmetry groups," he said. "Mathematicians proved this in 1891. There are 17, and there can never be more or fewer. The Alhambra in Spain contains all 17. And your grandmother's musuk panels contain at least 7 that I can identify."
Hamjabai was stunned. "Buisu knows 7 out of 17 possible symmetry groups?"
"She doesn't know them by name. But her hands know them. Every time she chooses a pattern, she is choosing a symmetry group — a mathematical structure — without calling it that."
Algorithmic Weaving
Hamjabai realised that weaving instructions were algorithms. An algorithm is a set of precise, repeatable steps that produce a specific result. Her grandmother's instructions — "over two, under one, shift right by one on the next row" — were exactly that.
She wrote a Python program that took a weaving instruction (like "over 2, under 1, shift 1") and generated the full binary grid. Then she added colour: 1s in brown (cane colour), 0s in green (bamboo colour). The screen showed a pattern identical to Buisu's musuk.
"Buisu!" she called. "Look — I made your pattern on the computer!"
Buisu peered at the screen, then at her musuk on the wall, then back at the screen. "Hmm," she said. "The computer's version is uglier. But the pattern is correct."
That was the highest praise Hamjabai could imagine.
The end.
Choose your level. Everyone starts with the story — the code gets deeper as you go.
Here is a taste of what Level 1 looks like for this lesson:
# Weaving Pattern Generator
over, under, shift = 2, 1, 1
width, height = 20, 10
for row in range(height):
pattern = []
offset = (row * shift) % (over + under)
for col in range(width):
pos = (col + offset) % (over + under)
pattern.append("█" if pos < over else "░")
print("".join(pattern))This is just the first of 6 coding exercises in Level 1. By Level 4, you will build: Build a Weaving Pattern Generator.
Free
Level 0: Listener
Stories, science concepts, diagrams, quizzes. No coding.
You are here
Level 0 is always free. Coding levels (1-4) are part of our 12-Month Curriculum.
Binary logic, symmetry groups, and algorithms — the mathematics hidden in Tripura's traditional cane weaving.
The big idea: "The Cane Weavers of Tripura" teaches us about Symmetry, Tessellations & Algorithmic Thinking — and you don't need to write a single line of code to understand it.
At every point where a vertical strand (warp) crosses a horizontal strand (weft), there are exactly two possibilities: the warp goes over the weft, or under it. There is no third option.
This is a binary choice — one of two states. In computer science, binary is represented as 1 and 0. If we assign over = 1 and under = 0, then every weaving pattern can be written as a grid of 1s and 0s — a binary matrix.
A plain weave (over-under-over-under) alternates: 1, 0, 1, 0, 1, 0... Each row is the opposite of the one above. A twill weave (over-over-under) creates diagonal lines: 1, 1, 0, 1, 1, 0... with each row shifted by one position. The pattern is defined entirely by the binary rule and the shift.
Check yourself: Write the binary row for a weave pattern that goes "over 3, under 2" repeating across 10 columns.
Key idea: Every weaving pattern is a binary grid: over (1) or under (0) at each crossing point. The pattern is defined by a rule (over/under count) and a shift between rows — identical to how computers store images as grids of values.
A symmetric pattern looks the same after certain transformations. There are four types of symmetry in flat patterns:
Translation: The pattern looks the same when slid horizontally or vertically by a fixed amount. All repeating wallpaper and weaving patterns have translational symmetry.
Rotation: The pattern looks the same when rotated by a specific angle. A pattern with 4-fold rotational symmetry looks identical at 0°, 90°, 180°, and 270°. A plain weave has 2-fold rotation (180° symmetry).
Reflection: The pattern looks the same when flipped across an axis — like a mirror image. Some weaving patterns are symmetric when reflected horizontally but not vertically, or vice versa.
Glide reflection: A combination of translation and reflection — slide the pattern along an axis, then flip it. This subtle symmetry appears in many woven textiles but is hard to spot without practice.
Key idea: Symmetry means a pattern is unchanged by a transformation. The four types — translation, rotation, reflection, and glide reflection — combine in exactly 17 possible ways to create all repeating 2D patterns.
Access all 130+ lessons, quizzes, interactive tools, and offline activities
In 1891, Russian mathematician **Evgraf Fedorov** proved that every possible repeating pattern on a flat surface belongs to one of exactly **17 symmet...
An **algorithm** is a precise, step-by-step set of instructions that always produces the correct result. A recipe is an algorithm for cooking. A weavi...