The Ikat Weaver of Pochampally
Binary Patterns, Algorithms & Error Correction

The Ikat Weaver of Pochampally

Binary patterns, algorithms, and error correction in the tie-dye looms of Telangana.

Binary Patterns, Algorithms & Error CorrectionAll Tracks 10h

The Story

The Pattern Problem

In the town of Pochampally, about fifty kilometres east of Hyderabad in Telangana, a fourteen-year-old girl named Lakshmi sat beside her mother at a wooden loom and stared at a bundle of yarn that looked like a mess.

The yarn was cotton, dyed in alternating bands of red and white. But it wasn't dyed after weaving — it was dyed before. Each individual thread had been tied tightly at specific intervals with wax-coated string, then dipped in red dye. The wax resisted the dye, so the tied sections stayed white while the exposed sections turned red. When the ties were removed, the thread had a precise pattern of red and white segments along its length.

This process is called ikat — from the Malay-Indonesian word meaning "to tie" — and Pochampally is one of the most famous ikat weaving centres in the world. The Pochampally telia rumal (oil-treated cloth) has been woven here for over five hundred years, and in 2021, it received a Geographical Indication (GI) tag from the Indian government, recognising its unique origin and method.

But Lakshmi had a problem. She was learning to create a new pattern — a geometric diamond design with eight repeating units across the width of the cloth. Her mother, Padma, had shown her the design on graph paper: each diamond was made of diagonal lines that shifted one thread to the left or right on each row, creating a zigzag that formed a diamond shape when you stepped back and looked at the whole cloth.

"I understand the picture," Lakshmi said. "But how do I turn this picture into ties on the yarn?"

From Picture to Instructions

Padma smiled. This was the hard part. The beautiful pattern on the graph paper had to be translated into a sequence of tie and skip instructions for each thread — and there were over six hundred threads in the warp (the vertical threads on the loom).

"Think of each thread as a line of instructions," Padma said. "At each centimetre along the thread, you either tie (the thread stays white at that point) or skip (the thread gets dyed red at that point). Tie means protected. Skip means exposed."

She picked up a single thread and showed Lakshmi the pattern for the first thread: skip, skip, tie, tie, tie, skip, skip, tie, tie, tie, skip, skip... A repeating sequence.

"But the second thread is different," Padma continued. She shifted the pattern by one position: skip, tie, tie, tie, skip, skip, tie, tie, tie, skip, skip, skip... The same pattern, offset by one.

Lakshmi stared. "Each thread has the same basic pattern, but shifted by one position from the thread next to it?"

"Yes. And that shift is what creates the diagonal line. When you weave them together, thread 1's white section is one position higher than thread 2's white section, which is one position higher than thread 3's. The eye connects them into a diagonal line."

The Algorithm

That night, Lakshmi sat at the family's old computer and tried to write down her mother's instructions as clearly as she could. She realised she was writing something very specific: a set of rules that transforms an input (the design) into an output (the tying pattern for each thread) through a defined sequence of steps. Her computer science teacher had a word for this: an algorithm.

The algorithm for the diamond ikat pattern went like this:

Step 1: Define the base pattern for one thread as a sequence of 1s and 0s, where 1 means "tie" (protect from dye) and 0 means "skip" (expose to dye). For the diamond, the base pattern was: 0,0,0,1,1,1,1,1,0,0,0,1,1,1,1,1 — groups of three zeros and five ones, repeating.

Step 2: For each subsequent thread, shift the pattern by one position to the right. Thread 2 starts where thread 1 had its second element. Thread 3 starts at thread 1's third element. And so on.

Step 3: After the pattern has shifted enough positions to reach the widest point of the diamond (the midpoint), reverse the direction of the shift. Now each thread shifts one position to the left, creating the other half of the diamond.

Step 4: Repeat the entire sequence for as many diamonds as needed across the width of the cloth.

Lakshmi realised this was essentially a modular arithmetic operation — each thread's pattern was the base pattern shifted by (thread number modulo pattern length) positions. The "modulo" operation meant the pattern wrapped around, creating seamless repetition.

Binary and Error

Something else struck Lakshmi. The entire pattern could be described using only two symbols: 1 (tie) and 0 (skip). Protected or exposed. On or off. This was exactly what her computer science teacher called binary — the language of computers, where everything is encoded as sequences of 0s and 1s.

She drew out the first ten threads of the diamond pattern as a grid of 1s and 0s. It looked exactly like a bitmap image — a digital picture where each pixel is either on or off. The weavers of Pochampally had been creating binary-encoded images for five centuries, long before the first computer was invented.

But there was a problem with binary systems — one that both weavers and computer scientists struggled with. Errors.

"Amma," Lakshmi said the next day, "what happens if you accidentally tie one extra section on a thread? Or skip one you should have tied?"

Padma nodded gravely. "That's the worst thing that can happen. One wrong tie doesn't just affect one thread — it shifts the whole pattern. The diagonal line breaks. The diamond distorts. And you don't notice until you've woven twenty rows and it's too late to fix."

This was the analog equivalent of a bit error in digital communication — one flipped bit that corrupts the entire message. In computer science, the solution is error detection and correction codes — extra bits of information added to the data that allow the receiver to detect and sometimes correct errors.

The weavers had their own version. Padma showed Lakshmi how experienced weavers used a counting string — a separate reference thread with knots tied at every pattern boundary. After tying each section of the work thread, the weaver checked it against the counting string. If the count didn't match, there was an error. This was essentially a checksum — a simple, redundant check that catches mistakes before they propagate.

"Your grandmother could also tell by feel," Padma added. "She'd run her fingers along the tied thread and know from the spacing whether a tie was in the wrong place. Fifty years of practice gave her an error-detection system in her fingertips."

The Weaving

Weeks later, Lakshmi's threads were ready. Six hundred and forty threads, each one precisely tied and dyed, each one carrying its own shifted copy of the binary diamond pattern. She mounted them on the loom, threaded the shuttle with the weft (horizontal) yarn, and began to weave.

Row by row, the pattern emerged. What had been invisible — hidden in the tied segments of individual threads — became visible as the threads came together in the cloth. The diamonds appeared as if by magic, their diagonal lines crisp and even, their symmetry perfect.

Lakshmi looked at the cloth and thought about two things simultaneously. She thought about her mother and grandmother and the five hundred years of weavers who had perfected this technique through trial and error. And she thought about Alan Turing and binary and algorithms and error correction.

The weavers of Pochampally had discovered these principles in thread and dye. The computer scientists had discovered them in circuits and code. The principles were the same. Only the materials had changed.

A tourist from Hyderabad came to the workshop and asked how the pattern was made. Lakshmi thought about explaining binary encoding and modular shift registers and checksums. Instead, she said what her mother always said:

"We tie and dye. Thread by thread."

It was true. It just wasn't the whole truth.

The end.

Try It Yourself

Choose your level. Everyone starts with the story — the code gets deeper as you go.

Story Progress

0%

Ready to Start Coding?

Here is a taste of what Level 1 looks like for this lesson:

Level 1: Explorer — Python
import numpy as np
import matplotlib.pyplot as plt

# Your first data analysis with Python
data = [45, 52, 38, 67, 41, 55, 48]  # measurements
mean = np.mean(data)

plt.bar(range(len(data)), data)
plt.axhline(mean, color='red', linestyle='--', label=f'Mean: {mean:.1f}')
plt.xlabel("Sample")
plt.ylabel("Value")
plt.title("Binary Patterns, Algorithms & Error Correction — Sample Data")
plt.legend()
plt.show()

This is just the first of 6 coding exercises in Level 1. By Level 4, you will build: Build an Ikat Pattern Generator.

Free

Level 0: Listener

Stories, science concepts, diagrams, quizzes. No coding.

You are here

Enrolled

Levels 1-4

Python, NumPy, Matplotlib, real projects, mentorship.

Sign Up Free

Stay Updated

Join Waitlist

Get notified when enrollment opens for your area.

Notify Me

Level 0 is always free. Coding levels (1-4) are part of our 24-Week Bootcamp.