Chapter One
Why a Computer Science Student Reads a Śāstra
Syllabus topic Module 1, "Concept of śāstra as a formal knowledge system", "aligned with computational thinking"
In one line
This paper asks whether the structured disciplines of classical India were doing computer science before there were computers, and the answer turns out to be yes in five specific, checkable ways and no in several others.
In the wording you can write in an examination: the paper studies six classical Indian knowledge systems as formal, rule-governed, algorithmic constructions, and maps each onto the modern computer science concept it corresponds to.
The honest first question
Why is a Sanskrit treatise on a Computer Science paper?
Not for reverence. The University's own description of this course says what the reason is: these traditions "embody structured, rule-based, and algorithmic principles analogous to contemporary Computer Science concepts". The word doing the work is analogous, and an analogy is a claim that can be true or false.
So this book treats every comparison as a claim to be tested. Where a classical rule really is an algorithm, we run it and show the output. Where it only resembles one, we say so.
The five things that are actually there
Each of these is established later in the book from the text itself, not asserted. They are collected here so you know where the paper is going.
| Classical source | What it contains | The modern name |
|---|---|---|
| Piṅgala's Chandaḥśāstra | a two-valued symbol per syllable, and a rule that enumerates every pattern of n syllables in a fixed order | binary encoding, and exhaustive enumeration |
| Piṅgala, again | a rule that finds the pattern at row r without writing the table, and a rule that finds r from the pattern | index retrieval into an unwritten structure |
| Piṅgala, again | a method that computes 2 to the power n by repeated squaring and doubling | binary exponentiation |
| Pāṇini's Aṣṭādhyāyī | about four thousand rules, six declared rule types, and four stated principles for deciding which rule fires when two could | a rule-based generative system with meta-rules and conflict resolution |
| Nyāya's five-member form | a fixed shape in which an inference must be stated before it counts as established | an inference engine that emits its own proof |
And the three things that are not
A book that only lists the first table is not teaching you the subject, it is selling you something. These are the limits, and a question that asks you to "critically assess" wants them.
There is no machine. Every one of these systems is executed by a trained human being. An algorithm and an implementation are different things, and the gap between them is most of the history of computing.
There is no cipher in the Arthaśāstra. Kautilya names secret writing four times and never states a method. What the treatise gives is a requirement, not an algorithm, and Module II says so in as many words.
Why a Computer Science Student Reads a Śāstra
Ayurvedic classification is not a validated classifier. It is a structured diagnostic vocabulary. Treating it as a tested medical model is a claim nobody in this book makes.
What "computational thinking" means here
MU's first course objective asks you to see śāstra as a knowledge system "aligned with computational thinking". That phrase has four ordinary parts, and you will use all four in this paper.
Decomposition. Break a problem into parts that can be solved separately. Piṅgala breaks "list every metre" into "list every metre of one syllable" plus a rule for growing the list.
Pattern recognition. Notice that two different problems have the same shape. The count of metres with exactly three long syllables and the count of ways to choose three items from a set are the same number, and the Meru-prastāra computes both.
Abstraction. Throw away what does not matter. A syllable has a sound, a meaning and a length; Piṅgala keeps only the length, and that is why his rules are arithmetic.
Algorithm design. State the steps so exactly that someone who does not understand the problem can still carry them out. This is the test that separates a description from an algorithm, and chapter seventeen applies it to Piṅgala's own words.
Worked example, before anything else
Here is the smallest complete instance of the whole paper, so that the rest of the book has something to attach to.
The problem. A Sanskrit metre of three syllables. Each syllable is either short (laghu, written L) or long (guru, written G). List every possible metre.
The classical rule, from Piṅgala's Chandaḥśāstra with Halāyudha's commentary: write a row of all long syllables. Then, to get each next row, find the first long syllable from the left, make it short, make everything to its left long, and leave everything to its right alone. Stop when the row is all short.
Carried out by hand:
GGG
LGG
GLG
LLG
GGL
LGL
GLL
LLL
The observation that makes this a computer science paper. Write 1 for L and 0 for G, and read each row with the leftmost syllable as the units place: 000, 100, 010, 110, 001, 101, 011, 111. Those are 0, 1, 2, 3, 4, 5, 6, 7 in binary. The rule is counting in base two, and it is written down centuries before the positional notation it depends on reached Europe.
That claim is checked, not asserted. The program in chapter nineteen verifies it for every row of every metre up to fourteen syllables.
How to use this book
Read it in order. The chapters follow MU's printed module order exactly, so you can lay the syllabus page beside the contents and tick off labels.
Why a Computer Science Student Reads a Śāstra
Each module's last chapters are practice. They carry worked answers of the length the examination actually wants, which is five marks.
Do the code. Twenty of the fifty marks on this paper are one program you write, run and defend out loud. Every listing in this book has been run, and you should run them too.
Quick revision
- MU's course description calls these traditions "structured, rule-based, and algorithmic" and "analogous" to modern computer science concepts. Analogous is a testable claim.
- Five real correspondences: binary encoding, enumeration, index retrieval, binary exponentiation, and rule-based generation with conflict resolution.
- Three honest limits: no machine, no cipher in the Arthaśāstra, no validated classifier in Ayurveda.
- Computational thinking has four parts: decomposition, pattern recognition, abstraction, algorithm design.
- Laghu and guru, two values in one position, is the hinge of Module I.
Test yourself
1. MU's description uses one word that makes this paper falsifiable rather than decorative. Which word, and why does it matter?
"Analogous." An analogy asserts that two things do the same work. That can be shown or refuted, so every chapter has to argue its case instead of asserting a resemblance.
2. Give one correspondence between a classical Indian text and a modern computer science concept, and one place where the correspondence fails.
Piṅgala's prastāra enumerates every pattern of n two-valued symbols in the order of binary counting, which is exhaustive enumeration over an n-bit space. It fails as an account of computing because nothing executes it but a person: there is an algorithm and no machine.
3. Name the four parts of computational thinking and give the Piṅgala example of one.
Decomposition, pattern recognition, abstraction, algorithm design. Abstraction: a syllable's sound and meaning are discarded and only its length is kept, which is what allows the rules to be arithmetic.
4. Why does this book refuse to say the Arthaśāstra contains a cipher?
Because the text names cipher-writing and never states a method. Naming a requirement is not supplying an algorithm, and the difference is the whole distinction between a specification and an implementation.