Skip to content

← Math Further 6–8

Can You Solve the Puzzles of the Lilavati?

Topic 30 · Grades 6–8 · Bhaskara’s verse problems

What this builds on from class
  • Grade 8: Equation and Graph (linear equations)
  • Grade 7: Plane Figures (Pythagoras relation)
In this unit 7 sections
  1. Guess, then fix the guess
  2. Working backwards
  3. Bees and a square root
  4. The peacock and the snake
  5. Where this is used
  6. Questions
  7. Where to go next

Picture a flowering bush in a Bhaktapur courtyard on a spring morning, loud with bees. Now here is a puzzle about bees that is almost 900 years old. It comes from the Lilavati, a book of arithmetic that the astronomer Bhaskara finished in 1150, written in Sanskrit verse, with puzzles that speak to a clever reader. In Henry Colebrooke’s English translation of 1817:

“Out of a swarm of bees, one-fifth part settled on a blossom of Cadamba; and one-third on a flower of Silind’hri: three times the difference of those numbers flew to the bloom of a Cutaja. One bee, which remained, hovered and flew about in the air, allured at the same moment by the pleasing fragrance of a jasmin and pandanus. Tell me, charming woman, the number of bees.”

So a fifth of the swarm goes to the kadamba, a third to the silindhri, three times the gap between those two to the kutaja, and exactly one bee is left, unable to choose. How many bees were there?

Guess first, before any working. How big was the swarm?

Pick an answer to see why.

Try it

Send out the swarm

Move the slider to change the size of the swarm, and watch the bees share themselves out. Each dot is a bee. Can you find a swarm that splits into whole bees and leaves exactly one hovering?

Kadambaa fifth4Silindhria third6⅔Kutaja3 × the gap8Hoveringthe rest1⅓
At the flowers
18⅔
Left hovering
1⅓
Whole-bee swarms you found
60606060

A third of 20 bees is 6⅔: this swarm can’t split into whole bees.

Guess, then fix the guess

The Lilavati’s own guess

The worked solution printed with this verse in Colebrooke’s translation doesn’t try 1, 2, 3, 4… bees until one works. It chooses a handy number, 30, because a fifth and a third of it are both whole numbers, and follows the puzzle’s steps with it:

Swarm Kadamba (a fifth) Silindhri (a third) Kutaja (3 × the gap) Left hovering
30 6 10 3 × 4 = 12 30 − 28 = 2

Two bees hover, but the puzzle says one. So 30 is twice too big, and the swarm must be half of 30: 15. One guess, one division, done.

Try the same with the slider. Find every swarm up to 60 that splits into whole bees, and write down how many hover each time.

Why one guess is enough

Every part of the swarm in this puzzle is a fraction of the swarm: a fifth, a third, three times the gap between a third and a fifth. Double the swarm and every flower gets twice as many bees, so the bees left over double too. The whole picture just grows or shrinks, keeping its shape, like a photo zoomed in.

So any guess will do. Compare your guess’s leftover with the real one, and scale your guess by the same amount:

swarm=your guess×the real leftoveryour guess’s leftover=30×12=15 \text{swarm} = \text{your guess} \times \frac{\text{the real leftover}}{\text{your guess's leftover}} = 30 \times \frac{1}{2} = 15

This method is called the rule of false position: you start from a number you know is probably false, and its error tells you the answer. Bhaskara called it ishta-karma (इष्टकर्म), “working with a chosen number”.

The same thing as an equation

In Grade 8 you would call the swarm x and write the puzzle as an equation. A fifth of x is x5 \frac{x}{5} , a third is x3 \frac{x}{3} , and the kutaja gets three times their gap:

x5+x3+3(x3−x5)+1=x \frac{x}{5} + \frac{x}{3} + 3\left(\frac{x}{3} - \frac{x}{5}\right) + 1 = x

In fifteenths, the flowers take 315x+515x+615x=1415x \frac{3}{15}x + \frac{5}{15}x + \frac{6}{15}x = \frac{14}{15}x . The one bee left is the last fifteenth: 115x=1 \frac{1}{15}x = 1 , so x = 15. The equation says the same thing your slider found: whatever the swarm, a fifteenth of it hovers.

When the guess goes wrong

False position works only when the whole puzzle grows in proportion with the number. Watch it fail on a puzzle that adds a fixed amount.

“I think of a number, add 10, and halve the result. I get 25.” A student guesses 10: 10 + 10 = 20, half is 10. Since 25 is two and a half times 10, she scales her guess to 2.5 × 10 = 25. Is 25 the answer?

Pick an answer to see why.

Working backwards

The puzzle of the ten steps

Bhaskara has a puzzle for a different method. In Colebrooke’s English:

“Pretty girl with tremulous eyes, if thou know the correct method of inversion, tell me, what is the number, which multiplied by three, and added to three quarters of the quotient, and divided by seven, and reduced by subtraction of a third part of the quotient, and then multiplied into itself, and having fifty-two subtracted from the product, and the square root of the remainder extracted, and eight added, and the sum divided by ten, yields two?”

Guessing would be slow here: there is a square and a square root in the middle, so the steps don’t grow in proportion. But you know where the chain ends: at 2. So start from the end and undo each step, last step first.

Try it

Undo the chain

The steps run down from the unknown number to 2. Start at the bottom: choose how to undo each step, and the number before it appears.

  1. The number ?
  2. × 3 84
  3. add ¾ of itself 147
  4. ÷ 7 21
  5. take away ⅓ of itself 14
  6. square it 196
  7. − 52 144
  8. square root 12
  9. + 8 20
  10. ÷ 10 2

Undo “× 3” by:

Undo “add ¾ of itself” by:

Undo “÷ 7” by:

Undo “take away ⅓ of itself” by:

Undo “square it” by:

Undo “− 52” by:

Undo “square root” by:

Undo “+ 8” by:

Undo “÷ 10” by:

Check it forwards, from the top of the list.

The last step was “÷ 10”, and it gave 2. Which step undoes it?

Undo, in reverse order

Bhaskara called this inversion (viloma, विलोम, “against the grain”), and his rule says exactly what to swap: “make the divisor a multiplicator: and the multiplier, a divisor; the square, a root; and the root, a square; turn the negative into positive; and the positive into negative.”

Two things make it work. First, every step has an undo: × 10 is undone by ÷ 10, + 8 by − 8, squaring by taking the square root. Second, the undos go in reverse order, like getting undressed: you put on your socks and then your shoes, so you take off your shoes first. Here is the whole chain undone:

Step (forwards) Undo it Number before the step
÷ 10 × 10 2 × 10 = 20
+ 8 − 8 20 − 8 = 12
square root square 12 × 12 = 144
− 52 + 52 144 + 52 = 196
square it square root 14
take away a third of itself add half of itself 14 + 7 = 21
÷ 7 × 7 21 × 7 = 147
add three quarters of itself take away three sevenths of itself 147 − 63 = 84
× 3 ÷ 3 84 ÷ 3 = 28

The number is 28. To check it, read the last column from the bottom up: it is the chain going forwards, from 28 to 2.

Bees and a square root

Now Bhaskara’s hardest bee puzzle. In Colebrooke’s words:

“The square-root of half the number of a swarm of bees is gone to a shrub of jasmin; and so are eight-ninths of the whole swarm; a female is buzzing to one remaining male that is humming within a lotus, in which he is confined, having been allured to it by its fragrance at night. Say, lovely woman, the number of bees.”

So the square root of half the swarm, plus eight ninths of the swarm, plus two bees, is the whole swarm.

Try false position

Pick a guess that makes everything whole: 18. Half of 18 is 9, whose square root is 3, and eight ninths of 18 is 16. That is 3 + 16 = 19 bees at the jasmine, one more than the whole swarm: the bees left for the lotus come out as 18 − 19 = −1, where the verse has 2. Scaling the guess by 2 ÷ (−1) would give a swarm of −36 bees. False position has failed, because a square root doesn’t grow in proportion: four times the swarm has only twice the square root.

Search with whole bees

Think about which swarms could work at all. The square root of half the swarm must be a whole number of bees, so half the swarm is a square: 1, 4, 9, 16… and the swarm is twice a square: 2, 8, 18, 32, 50, 72… And eight ninths must be whole, so the swarm is a multiple of 9 as well. That leaves 18, 72, 162, 288… Try them:

Swarm Square root of half Eight ninths Total with the 2 bees
18 3 16 21 (too many)
72 6 64 72 ✓
162 9 144 155 (too few)
288 12 256 270 (too few)

The swarm has 72 bees: 6 at the jasmine by the root, 64 by the eight ninths, and the two in the lotus.

Could a bigger swarm work too? The bees not in the eight ninths, the last ninth, must be the root bees plus the 2. For 18, 72, 162 and 288 that last ninth is 2, 8, 18 and 32; the root plus 2 is 5, 8, 11 and 14. From one swarm on the list to the next, the root plus 2 grows by 3 each time, but the ninth grows by 6, then 10, then 14, more each time. So once the ninth catches up, at 72, it pulls ahead for good, and 72 is the only answer.

The worked solution of the same puzzle in the Bijaganita makes the same move as you: it writes the swarm as twice a square, so that half of it has a whole square root, and then solves for the root, 6. The swarm is 2 × 6 × 6 = 72.

The peacock and the snake

The Lilavati also has puzzles about right-angled triangles. Two of the most famous, the lotus in the lake and the broken bamboo, are in How Many Ways Can You Prove Pythagoras’ Theorem?. Here is a third, in Colebrooke’s words:

“A snake’s hole is at the foot of a pillar, and a peacock is perched on its summit. Seeing a snake, at the distance of thrice the pillar, gliding towards his hole, he pounces obliquely upon him. Say quickly at how many cubits from the snake’s hole do they meet, both proceeding an equal distance?”

The pillar is 9 cubits high (a cubit is a forearm, elbow to fingertip), so the snake starts 27 cubits away. The peacock flies in a straight line, slanting down; the snake glides straight along the ground. They cover the same distance.

Try it

Where do they meet?

Drag the yellow meeting point along the ground. The readouts give how far the snake glides and how far the peacock flies to reach it. Find the point where the two are equal.

9091827cubits
Snake from:
Meeting point from the hole
20.0 cubits
Snake glides
7.0 cubits
Peacock flies
21.9 cubits

The snake’s glide is 14.9 cubits shorter: it would get there first. Move the point towards the pillar.

CC0, via PhyloPic
Beth Reinke, CC0, via PhyloPic

Squares that cancel

Call the meeting point x cubits from the hole. The snake glides the rest, 27 − x. The peacock flies the slanting side of a right triangle with sides 9 and x, so by Pythagoras its flight squared is 92+x2 9^2 + x^2 . The two distances are equal, so their squares are too:

x2+81=(27−x)2 x^2 + 81 = (27 - x)^2

That looks like an equation with squares in it. But open up the right side with Grade 8’s (a−b)2=a2−2ab+b2 (a - b)^2 = a^2 - 2ab + b^2 :

x2+81=729−54x+x2 x^2 + 81 = 729 - 54x + x^2

There is an x2 x^2 on both sides, so take it away from both. What is left is an ordinary linear equation: 81 = 729 − 54x, so 54x = 648 and x = 12. They meet 12 cubits from the hole. The snake glides 27 − 12 = 15 cubits, and the peacock flies 81+144=225=15 \sqrt{81 + 144} = \sqrt{225} = 15 cubits. Equal, as the verse says.

Bhaskara’s shortcut

Bhaskara’s rule is shorter: “The square [of the height] of the pillar is divided by the distance of the snake from his hole; the quotient is to be subtracted from that distance. The meeting of the snake and peacock is from the snake’s hole half the remainder, in cubits.” Here: 81 ÷ 27 = 3; 27 − 3 = 24; half of 24 is 12. Why does dividing the pillar’s square by the distance help? A picture shows it.

151212 × 1234536151227 long, area 81
Figure 30.1 The peacock’s flight (15) squared, minus the ground part (12) squared, leaves an L-shaped strip 3 wide. Cut the L into two pieces and lay them end to end: a strip 3 wide and 15 + 12 = 27 long. Its area is the pillar squared, 81.

By Pythagoras, the square on the peacock’s flight is the square on the pillar plus the square on the ground part. So the L-shaped strip between the two squares in Figure 30.1 has the same area as the pillar’s square, 81. Cut it into two rectangles and line them up: the strip is as long as the flight and the ground part together, which is the snake’s whole distance, 27, and as wide as their difference. So the difference is 81 ÷ 27 = 3. Two numbers that add to 27 and differ by 3 are 15 and 12: take away the difference and halve, (27 − 3) ÷ 2 = 12. That is Bhaskara’s rule, step by step, and it works for any pillar and any distance.

Colebrooke noted that the puzzle is older than Bhaskara: Brahmagupta had set it with a cat and a rat.

A twist: when the snake gets home first

In the widget, change where the snake starts. From 15 cubits the rule gives (15 − 81 ÷ 15) ÷ 2 = 4.8 cubits from the hole. From 9 cubits, the pillar’s own height, it gives 0: they meet at the hole.

The snake starts only 6 cubits from its hole. What does Bhaskara’s rule give, and what really happens?

Pick an answer to see why.

Four long, narrow pages of a handwritten manuscript in the Newar script, black ink on yellowed paper, with a drawing of triangles on the first page and a circle on the third among the lines of text and numbers
Figure 30.2 Four pages of the Lilavati, copied in Sanskrit in the Newar script in about the 16th century, from the Asa Archives in Kathmandu. Among the verses are worked numbers and drawings for the geometry: triangles on the first page, a circle on the third. Photo: Unknown author, Public domain

Where this is used

Questions

A swarm of bees: a quarter goes to a mango tree, a third to a sunflower, and the 10 bees left buzz around your head. How big was the swarm? (Try a false guess of 12.)

Pick an answer to see why.

a.★

I think of a number, add 3, multiply by 4, take away 8 and halve the result. I get 18. What was my number?

Hint
Answer
b.★★

A pilgrim, in another verse of the Lilavati, gave half his money at Prayaga, two ninths of what was left at Kashi, a quarter of what remained in taxes on the road, and six tenths of the rest at Gaya. He came home with 63 nishkas (gold coins). How much did he set out with?

Hint
Answer
c.★★

A flock of geese, from the Lilavati: seven times half the square root of the flock walk to the shore, and one pair is left playing in the water. How many geese? (The flock must be a square number. Why?)

Hint
Answer
d.★★★

From a tree 100 cubits high, one monkey climbs down and walks to a pond 200 cubits from the tree. Another jumps straight up from the top of the tree, then flies in a straight line to the pond. Both travel the same distance. How high did the second one jump? (From the Lilavati, where they are apes.)

Hint
Answer
e.★★★

Bhaskara again: two numbers differ by 8, and their squares differ by 400. Find them, using the L-shaped strip of Figure 30.1.

Hint
Answer

Where to go next

Where these facts come from
  • The bee puzzles (§ 54 and § 68), the lotuses (§ 52), the pilgrim (§ 53), the rule of supposition and its example (§§ 50–51, which Colebrooke glosses as “the rule of false position”), the rule of inversion and the puzzle answered 28 (§§ 47–49), the two numbers from their difference and the difference of their squares (§ 58), the geese (§ 64), the peacock and the snake (§§ 149–150, with Colebrooke’s note that it comes from Brahmagupta with a rat and a cat), the apes (§§ 154–155), “Dear intelligent Lilavati” (§ 13) and Colebrooke’s note that commentators read the name as “charming”, the Bijaganita’s root that “is two-fold, positive and negative” (§ 10) and its bees written as twice a square (§ 132), the date 1072 Shaka, AD 1150, and Faizi’s Persian translation of 1587: H. T. Colebrooke, Algebra, with Arithmetic and Mensuration, from the Sanscrit of Brahmegupta and Bhascara (London, 1817) (Internet Archive), read October 2026. The verses quoted are Colebrooke’s 1817 English (public domain); the puzzles retold are in our own words.
  • Bhaskara’s dates (1114–1185), Faizi’s story of the cup and the pearl and that “it is hard to see that there is any evidence for it being true”: MacTutor, “Bhaskara II”, read October 2026.
  • Verse made for memorization and recitation, the puzzles’ bees, swans and peacocks, no contemporary evidence for the daughter, the school set up in 1207 by his grandson: Wikipedia, “Bhāskara II”, read October 2026; Lilavati meaning “playful”: Wikipedia, “Līlāvatī”, read October 2026.
  • The Newar-script manuscript, 16th century, from the Asa Archive, public domain: Wikimedia Commons; the Asa Archives (Asa Saphu Kuthi) in Kathmandu, a library of Nepal Bhasa manuscripts: Wikipedia, “Asa Safu Kuthi”, both read October 2026.
  • False position in the Rhind papyrus’s problem 26 (guess 4, answer 12), double false position in the Nine Chapters (Chapter 7) and in Fibonacci’s Liber Abaci (1202), the name regula falsi, and its use as a root-finding method in numerical analysis: Wikipedia, “Regula falsi”, read October 2026; the Rhind papyrus’s date, about 1550 BC, and the British Museum: Wikipedia, “Rhind Mathematical Papyrus”, read October 2026.
  • Every number and answer in this topic (the swarms that split into whole bees, the leftover always a fifteenth, the lotuses, the failed guess for “add 10”, the ten steps forwards and backwards and the widget’s wrong undos, the root bees and the table, the failed guess 18 (−1 left), the peacock for 27, 15, 9 and 6 cubits, the L-shaped strip, and every question) was computed in checks/textbooks/math-further-6-8/30/tmp/lilavati_numbers.py.