
Every dawn in South India, something magical happens at countless doorsteps.
Before the world wakes, women (and sometimes men too) take a pinch of rice flour or chalk powder, bend down gracefully, and begin to draw. Dots appear first, neatly arranged. Then a line begins to dance — looping, weaving, and curling around those dots — until an intricate pattern emerges: the rangoli.
To the casual eye, it’s art. To mathematicians, it’s a blackboard of geometry, symmetry, and topology. And to cultural historians, it’s proof that deep mathematics has been practiced for centuries — not in classrooms, but at the threshold of homes.
Let’s dive into this beautiful overlap of ritual and reasoning, where every stroke is both prayer and proof.
The Language of Dots
Rangoli begins with dots. Laid in rows and columns, or in triangles and circles, these dots are like coordinates on a graph paper. Each dot is a fixed point in space, and together they form a lattice — the same idea mathematicians use when they study crystals, grids, and networks.
Once the dots are in place, the line takes over. But here’s the twist: the line must obey rules. It should wrap around dots, flow smoothly, and often return to its starting point. Suddenly, the drawing becomes a combinatorial puzzle — how many possible paths can you take around this dot arrangement? How many distinct rangoli can be made from the same lattice?
Why is this powerful? Because a dot lattice converts freehand artistic intent into discrete combinatorial choices. Each local choice—go left or right of a dot, loop tight or wide—has a finite set of possibilities and a clear geometric effect. That discrete ↔ continuous bridge makes rangoli an excellent teaching playground for geometry and combinatorics.
This is mathematics at its core: infinite creativity inside finite rules.
Symmetry
Symmetry is easy to see in rangoli patterns: rotation, reflection, repeating motifs. The mathematics describing these symmetries is group theory. For an n-fold rotational symmetry (plus reflections) the relevant group is the dihedral group
Practically:
- A rangoli with 6-fold rotational symmetry (like many circular rangoli) is invariant under rotation by 60 degrees
- Reflectional symmetry means the motif is unchanged when mirrored about a line.
Two useful mathematical consequences:
- Design reduction: To create a symmetric rangoli you only design one fundamental sector and copy it using the symmetry operations — this reduces human work and creates coherence.
- Counting distinct designs: Using tools like Burnside’s Lemma or Pólya’s Enumeration Theorem, we can count how many essentially different rangolis there are under the action of a symmetry group (distinct modulo rotations/reflections). This turns a craft question into a computation in group actions.
Loops, Knots, and Topology
Topology studies properties preserved under continuous deformation—exactly the kind of properties rangoli lines exhibit.
Common topological ideas in rangoli:
Knot and link relation: If we add over/under crossing information to a rangoli curve (as in knot diagrams), rangoli motifs can be interpreted as link diagrams. Knot theorists analyze such diagrams using invariants like linking number or the Jones polynomial. (In folk practice the crossing convention is usually implicit or absent, but the combinatorial skeleton is similar.)
Closed loops: Many rangolis are a single continuous closed curve (a “one-line” rangoli) that weaves around dots and returns to its starting point. From a topological viewpoint, we are drawing a simple closed curve (or a set of closed curves) in the plane minus the set of dots.
Connectedness and components: A rangoli divides the plane into regions (faces). How many regions depend on how the curves cross and loop; counting regions relates to classical planar graph theory.
Graph theory and algorithms
You can model a rangoli precisely using graphs:
- Vertices correspond to curve intersections or to cell centers in a dual graph.
- Edges represent curve segments between vertices.
- A typical rangoli curve drawn with intersections (when we record them) produces a planar graph in which many vertices have even degree (often degree 4 at crossings).
This leads to algorithmic questions:
- Eulerian circuits: A closed one-line rangoli corresponds to an Eulerian circuit in an appropriate graph (a closed trail using every edge exactly once) if edges correspond to passage segments and all vertices have even degree. The classical necessary-and-sufficient condition: a connected graph has an Eulerian circuit iff every vertex has even degree.
- Backtracking / constraint search: Computational generation of rangolis is often done with backtracking searches that enforce local rules (avoid certain crossings, maintain symmetry, keep the line continuous).
- Medial/dual graphs: There are standard constructions (graph duals, medial graphs) that convert a grid of dots into a graph whose cycles correspond to valid rangoli loops. Exploiting these transforms simplifies both human design and computer generation.
Counting the Possibilities- Combinatorics
How many rangolis can you make with a 4×4 dot grid? Or a 5×5?
This is where combinatorics — the mathematics of counting — comes alive.
- If you have 2n dots on a circle, the number of ways to connect them with non-crossing lines is given by the famous Catalan numbers.
- If you allow rotations and reflections, you must use Burnside’s Lemma, a tool mathematicians use to count symmetrical designs.
In other words: even a small grid hides millions of possible rangolis. Artists, by instinct, choose only the most beautiful and symmetric ones. That’s not just aesthetics — it’s optimization.

Fractals and recursion
Rangoli practice often uses motifs that repeat at multiple scales. Iterative decoration — surround a central motif with a larger ring repeating the motif — creates self-similar structures that can appear fractal-like.
From a mathematical lens:
- Iteratively applying a local transformation (replace each line segment by a small motif) is exactly the philosophy of L-systems (used to generate plants), producing potentially fractal limit sets.
- Although classical rangolis are finite, the design rules can be extended recursively to produce patterns that resemble known fractals (self-similarity, non-integer scaling behavior in the visual texture).
Curves, splines, and Beziers
Even though rangoli starts from discrete dots, the finished line is a smooth continuous curve. When digitizing or drawing programmatically we replace polygonal or arc segments with smooth interpolants — typically splines or Bézier curves.
Using such splines lets you:
- Smoothly join local arc segments.
- Control curvature and visual weight.
- Convert a combinatorial rangoli description into vector graphics suitable for printing or CNC drawing.
An algorithmic recipe
A common description of constructing a rangoli is the “pulling a thread” metaphor: imagine laying a thread through the grid and pulling it taut around dots. Here’s a simplified algorithmic version you can implement or do by hand:
- Place dots in a chosen pattern (rectangular m×nm\times nm×n, circular rings, triangular lattice).
- Define local passage rules: at each side of a dot, the line may pass between two adjacent dots, go around a dot, or arc away. Encode allowed moves.
- Choose a starting edge on the boundary of the grid.
- Walk: move along an allowed edge; at each decision point prefer a deterministic rule (e.g., keep the obstacle to your left, or follow clockwise-first) unless branching is necessary.
- Avoid illegal crossings (unless your style allows crossings with an over/under convention).
- Backtrack if you reach a dead end; continue until you return to start and all local constraints (encircle required dots) are satisfied.
This is essentially a constrained path-finding/backtracking problem. Adding symmetry reduces the search by forcing decisions in one sector and copying them.
A 3×3 dot rangoli
Enclose each dot by a small loop that touches or almost touches neighboring loops without overlapping; or
Draw a single continuous curve that weaves around the interior dots leaving the corner dots partly encircled. A typical one-line 3×3 rangoli can be constructed by:
1. Start just outside the top-left corner.
2. Move right, looping down and around the top row of dots in a smooth arc.
3. Turn and weave around the central dot, ensuring the curve passes between pairs of dots following a consistent handedness (e.g., always keep the dot to your right as you move).
4. Continue to the bottom-left, then sweep back to the top-left, closing the loop.
Mathematically, you can analyze the resulting drawing by recording every time the path crosses a line between dots and building the planar graph. Then check Euler characteristic or degree parity to verify it’s a valid closed loop (all vertex degrees even).

From folk craft to computation
Rangoli has inspired computational projects:
- Pattern generation: search algorithms, constraint solvers, and grammar-based systems (L-systems) can produce rangoli-like motifs.
- Vectorization & smoothing: after generating a combinatorial skeleton, splines and Bézier curves give aesthetic, drawable results.
- Recognition and OCR: detecting rangoli patterns from photos is a computer vision challenge (dot detection, curve tracing, symmetry detection).
From a mathematician’s point of view, programmatic rangoli creation is a satisfying blend of discrete search (combinatorics, graph traversal) and continuous optimization (curve fitting, curvature minimization).
Two final thoughts:
- Mathematical training through ritual. Each rangoli is a short, repeated lesson in spatial reasoning: counting, symmetry recognition, planning a continuous path. Children who learn rangoli often practice combinatorial thinking and problem-solving without formal classroom talk — the ritual teaches math by doing.
- Cognitive and aesthetic constraints. Rangoli is not math alone; it’s a cultural practice shaped by local preferences (which edges to emphasize, how dense the pattern should be). These constraints are exactly what make rangoli interesting mathematically: the art imposes rules that reduce the enormous space of possible curves down to the beautiful, structured subset humans prefer.
Rangoli as Encryption
Dots as the “plaintext” alphabet
- In encryption, we begin with a message (plaintext).
- In rangoli, the grid of dots can be seen as the “data space”.
Each dot (or position) is like a symbol or bit waiting to be encoded. - The size and arrangement of the dot lattice (square, triangular, circular) define the keyspace (the possible ways information can be structured).
- Example: A 5×5 times 5×5 dot grid has 25 possible positions, which can represent 25 letters (A–Y), or even binary states if we assign 1/0 to whether a dot is used in the final design.
Rangoli drawing rules as the “encryption key”
- The rules of how the curve weaves around dots are essentially the cipher key.
- Different families of rules can generate very different patterns:
- Always keep the dot on your left/right → deterministic cipher.
- Allow optional crossings or loops → adds entropy.
- Symmetry constraints (rotations, reflections) → reduce or control redundancy.
Thus, the same dot grid can produce very different rangolis depending on which key (rule set) is chosen.
Closed loops = Encrypted message
- Many rangolis are drawn as a single continuous loop that encloses dots in a structured way.
- Imagine this loop as an encoded path that hides the underlying plaintext.
Unless you know the exact traversal rules, you cannot reconstruct the original dot data.
This is very similar to:
- Route ciphers in classical cryptography (where text is arranged in a grid and read along a particular path).
- Hamiltonian/Eulerian path ciphers, where the secrecy lies in which path was chosen.
Rangoli as Steganography (hiding in plain sight)
- A rangoli on a doorstep looks purely decorative, but it could secretly encode a message.
- By varying:
- Number of dots in rows/columns
- Loop style (tight/loose, clockwise/anticlockwise)
- Sequence of enclosed regions
we can hide numerical/textual information inside an innocent-looking pattern.
For instance:
- A 4×4times 4×4 dot Rangoli could encode a 16-bit binary sequence depending on whether each dot is encircled by the curve or not.
- This could be mapped to ASCII or Unicode, transmitting words invisibly.
Rangoli Encryption Framework (Conceptual)
Here’s how you could design a rangoli-based cipher:
- Key Generation
- Decide grid size (e.g., 6×66 \times 66×6).
- Choose symmetry rules (rotation/reflection allowed?).
- Pick traversal rule (left-hand rule, clockwise-first, etc.).
- Plaintext Encoding
- Convert message → binary or numbers.
- Map numbers → dot configuration (active/inactive dots, or encoded by loop order).
- Encryption
- Draw rangoli using chosen key (weaving around active dots).
- Output: the final geometric pattern (image/vector).
- Decryption
- With the correct key, trace back the curve.
- Extract dot activity, loop sequence, or symmetry encoding.
- Reconstruct plaintext.
Rangoli, is far more than an ornamental tradition; it is a living embodiment of mathematics woven into daily life. The dots, lines, and curves are silent carriers of geometry, symmetry, and algorithmic thinking — a cultural form of problem-solving expressed through art. Though never meant for encryption in the past, its structured logic shows us how beauty itself can become a cipher, where art and security meet. Most importantly, rangoli reminds us that mathematics is not a cold abstraction but a deeply human practice, flowing through rituals, creativity, and cultural memory. In every fading pattern at dawn, we see both the fragility of art and the timeless strength of mathematical thought.
