[incomplete: must add examples and more discussion]
Most programming languages include a “remainder” or “modulo” function, and also an integer division (“quotient”) function. Given two integers and , let’s call the results of these functions and respectively.
For positive and , it is clear what and should be: is the largest integer such that , and is the remainder which therefore satisfies .
What should we do when, as frequently happens, is negative, or (as less frequently happens) is negative?
For negative and positive , there are two choices when lies between two multiples of (i.e. ):
(1) Set to the lesser value, so that continues to hold, or
(2) Set to the greater (and therefore smaller in magnitude) value.
There are very good reasons why (1) is preferable to (2): it ensures that the function is always positive no matter what the value of , so that, for example, .
And indeed that is what the more recent programming languages do. There is a table on Wikipedia: C, C++, Java, Go(!), OCaml(!), PHP, all have the “bad” behaviour, while Maple, Mathematica, Microsoft Excel, Perl, Python, Ruby have the “good” behaviour. Some languages have separate functions for both behaviours (e.g. Haskell has
divMod functions, similarly Common Lisp, Fortran, MATLAB).
There’s also the question of what to do when is negative, which turns out not to matter much (as long as it’s consistent with the above). One defintion is to continue to have be the lesser value, and the other is to continue to insist that . Both are fine, though sometimes the latter is nicer.
These are elaborated in The Euclidean Definition of the Functions div and mod by Raymond T. Boute, ACM Transactions on Programming Languages and Systems, Vol 14, No. 2, April 1992.
Viṣṇu, appearing before Bali as Vāmana, transformed into Trivikrama, filling the universe, covering all the earth and the heavens in two steps.
The verse that opens the Pūrva-pīṭhikā of Daṇḍin’s Daśakumāracarita plays on this imagination, and on the word daṇda / daṇḍin. Here’s the verse (in Sragdharā metre of pattern GGGGLGG—LLLLLLG—GLGGLGG):
May the leg of Trivikrama,
pole for the parasol that is the universe,
stem of the lotus that is Brahma’s seat,
mast of the ship that is the earth,
rod of the streaming banner that is the river of the Gods,
axle-rod around which the zodiac turns,
pillar of victory over the three worlds,
rod of death for the enemies of the Gods,
favour you with blessings.
brahmāṇḍa-cchatradaṇḍaḥ śata-dhṛti-bhavan’-âmbhoruho nāla-daṇḍaḥ
kṣoṇī-nau-kūpa-daṇḍaḥ kṣarad-amara-sarit-paṭṭikā-ketu-daṇḍaḥ /
jyotiścakr’-âkṣa-daṇḍas tribhuvana-vijaya-stambha-daṇḍo ‘ṅghri-daṇḍaḥ
śreyas traivikramas te vitaratu vibudha-dveṣiṇāṃ kāla-daṇḍaḥ //ब्रह्माण्डच्छत्रदण्डः शतधृतिभवनाम्भोरुहो नालदण्डः क्षोणीनौकूपदण्डः क्षरदमरसरित्पट्टिकाकेतुदण्डः । ज्योतिश्चक्राक्षदण्डस्त्रिभुवनविजयस्तम्भदण्डोऽङ्घ्रिदण्डः श्रेयस्त्रैविक्रमस्ते वितरतु विबुधद्वेषिणां कालदण्डः ॥
[The Mānasataraṃgiṇī-kāra, agreeing with Santillana and von Dechend the authors of Hamlet’s Mill, considers the “pole” or “axis” motif central to the conception of Vishnu (e.g. matsya‘s horn, Mount Meru as the rod on kūrma, nṛsiṃha from the pillar, etc.: see here), sees much more depth in this poem, and that Daṇḍin was remembering this old motif.]
The translation above is mildly modified from that of Isabelle Onians in her translation (“What Ten Young Men Did”) of the Daśa-kumāra-carita, published by the Clay Sanskrit Library:
Pole for the parasol-shell that is Brahma’s cosmic egg,
Stem for Brahma’s lotus seat,
Mast for the ship that is the earth,
Rod for the banner that is the rushing immortal river Ganges,
Axle rod for the rotating zodiac,
Pillar of victory over the three worlds—
May Vishnu’s leg favor you with blessings—
Staff that is the leg of him who as Trivikrama reclaimed those three worlds in three steps,
Rod of time, death itself, for the demon enemies of the gods.
Ryder, in his translation (“The Ten Princes”), takes some liberties and manages verse in couplets:
May everlasting joy be thine,
Conferred by Vishnu’s foot divine,
Which, when it trod the devils flat,
Became the staff of this and that:
The staff around which is unfurled,
The sunshade of the living world;
The flagstaff for the silken gleam
Of sacred Ganges’ deathless stream;
The mast of earth’s far-driven ship,
Round which the stars (as axis) dip;
The lotus stalk of Brahma’s shrine;
The fulcrumed staff of life divine.
For another verse that fully gets into this “filling the universe” spirit, see The dance of the bhairava on manasa-taramgini.
[Originally posted to linguistics.stackexchange.com as an answer to a question by user Manishearth, who asked: “I’ve heard many times that learning German is easier for those who speak Sanskrit, and vice versa. Is there any linguistic basis for this? What similarities exist between the two languages that may be able to explain this?”]
This is an answer not to the part about whether it is easier to learn German after Sanskrit (I don’t know), but rather, a few more assorted points re. “What similarities exist between the two languages”, or even more generally, “Why would people make such a claim?”
As Cerberus [another user] noted, most of these claims come from people whose familiarity, outside of Indian languages, is with mainly English, and perhaps a bit of French (or rarely, Spanish or Italian). So even though many similarities noted between Sanskrit and German are in fact those shared by many members of the Indo-European family, the claim just means that among the few languages considered, German’s similarities are remarkable.
[My background: I have a reasonable familiarity with Sanskrit; not so much with German. For impressions about German I’ll rely on the Wikipedia articles, and, (don’t lynch me) Mark Twain’s humorous essay The Awful German Language — of course I know it’s unfair and not a work of linguistics, but as examples of what the average English speaker might find unusual in German, it is a useful document.]
With that said, some similarities:
German apparently has four cases; Sanskrit has eight cases (traditional Sanskrit grammar counts seven, not counting the vocative as distinct). As Cerberus [another user] notes, “Sanskrit and German have several functional cases, whereas French/Spanish/Italian/Portuguese/Dutch/English/etc. do not. Those are the languages one might be inclined to compare Sanskrit with”.
Although English does have short compound words (like bluebird, horseshoe, paperback or pickpocket), German has a reputation for long compound words. (Twain complains that the average German sentence “is built mainly of compound words constructed by the writer on the spot, and not to be found in any dictionary — six or seven words compacted into one, without joint or seam — that is, without hyphens”) He mentions Stadtverordnetenversammlungen and Generalstaatsverordnetenversammlungen; Wikipedia mentions Rindfleischetikettierungsüberwachungsaufgabenübertragungsgesetz and Donaudampfschiffahrtselektrizitätenhauptbetriebswerkbauunterbeamtengesellschaft. But these are nothing compared to the words one routinely finds in ornate Sanskrit prose. See for example this post. Sanskrit like German allows compounds of arbitrary length, and compounds made of four or five words are routinely found in even the most common Sanskrit texts.
Verb appearing late
It appears that German words tend to come later in the sentence than English speakers are comfortable with. I notice questions on this SE showing that German has V2 word order, not SOV. However, many English speakers seem to find late verbs in German worth remarking on. One of my favourite sentences from Hofstadter goes
“The proverbial German phenomenon of the “verb-at-the-end”, about which droll tales of absentminded professors who would begin a sentence, ramble on for an entire lecture, and then finish up by rattling off a string of verbs by which their audience, for whom the stack had long since lost its coherence, would be totally nonplussed, are told, is an excellent example of linguistic pushing and popping.”
Twain too, says “the reader is left to flounder through to the remote verb” and gives the analogy of
“But when he, upon the street, the (in-satin-and-silk-covered-now-very-unconstrained-after-the-newest-fashioned-dressed) government counselor’s wife met,”
“In the daybeforeyesterdayshortlyaftereleveno’clock Night, the inthistownstandingtavern called `The Wagoner’ was downburnt. When the fire to the onthedownburninghouseresting Stork’s Nest reached, flew the parent Storks away. But when the bytheraging, firesurrounded Nest itself caught Fire, straightway plunged the quickreturning Mother-stork into the Flames and died, her Wings over her young ones outspread.”
Well, this is exactly typical Sanskrit writing. Those sentences might have been translated verbatim from a Sanskrit text. Sanskrit technically has free word order (i.e., words can be put in any order), and this is made much use of in verse, but in prose, usage tends to be SOV.
Of Sanskrit’s greatest prose work, Kādambarī, someone named Albrecht Weber wrote in 1853 that in it,
“the verb is kept back to the second, third, fourth, nay, once to the sixth page, and all the interval is filled with epithets and epithets to these epithets: moreover these epithets frequently consist of compounds extending over more than one line; in short, Bāṇa’s prose is an Indian wood, where all progress is rendered impossible by the undergrowth until the traveller cuts out a path for himself, and where, even then, he has to reckon with malicious wild beasts in the shape of unknown words that affright him.” (“…ein wahrer indischer Wald…”)
(This is unfair criticism: personally, I have been lately reading the Kādambarī with the help of friends more experienced in Sanskrit, and I must say the style is truly enjoyable.) Now, the fact that this was a German Indologist writing for the Journal of the German Oriental Society somewhat goes against the claim of Sanskrit and German being similar. But one could say: for someone familiar with Sanskrit’s long compounds and late verbs that even Germans find difficult, the same features in German will pose little difficulty.
Adjectives decline like nouns
In Sanskrit, as it appears to be in German, an adjective takes the gender, case, and number of whatever it is describing. (Twain: “would rather decline two drinks than one German adjective”)
Gender of nouns has to be learned
By and large, it is so in Sanskrit as well. Twain notes that in German “a tree is male, its buds are female, its leaves are neuter; horses are sexless, dogs are male, cats are female — tomcats included, of course; a person’s mouth, neck, bosom, elbows, fingers, nails, feet, and body are of the male sex, and his head is male or neuter according to the word selected to signify it, and not according to the sex of the individual who wears it — for in Germany all the women either male heads or sexless ones; a person’s nose, lips, shoulders, breast, hands, and toes are of the female sex; and his hair, ears, eyes, chin, legs, knees, heart, and conscience haven’t any sex at all”. (He goes on to write a “Tale of the Fishwife and its Sad Fate.”) It does not seem quite so bad in Sanskrit, but yes, gender of words needs to be learned. (In Sanskrit there exists a word for “wife” in each of the three genders.) However this is a feature common to many languages (including, say, languages like Hindi or French that have only two genders) so I shouldn’t list it among similarities.
This is something quite trivial, and linguists often don’t even consider orthography a part of the language proper, but spelling seems to be a pretty big deal to Indians learning other languages. The writing systems of most Indian languages are phonetic, in the sense that the spelling deterministically reflects the pronunciation and vice-versa. There are no silent letters, no wondering about a word spelled in a particular way is pronounced. Indian learners of English often complain about the ad-hoc inconsistent spelling of English; it seems a bigger deal than it should be. From this point of view, the fact that it is claimed that for German, “After one short lesson in the alphabet, the student can tell how any German word is pronounced without having to ask” means that that aspect of German is easier to learn.
The harmony of sound and sense
This is extremely subjective and will be controversial, and perhaps I will seem biased, but to me, in Sanskrit, it seems possible to pick words whose sounds match the desired feeling, better than in other languages. I have seen people who knew many languages say the same thing, and also Western translators from Sanskrit etc., so it is interesting for me to see Twain make a similar remark about German. Anyway, this is subjective, so I’ll not dwell on this much.
There are of course many; e.g. Sanskrit does not have articles (the, etc.) unlike German. It also has very few prepositions (has only a few ones like “without”, “with”, “before”), as the work of prepositions like “to”, “from”, or “by” is handled by case. The difficulty of German prepositions does not seem to be present in Sanskrit.
Some alleged difficulties of learning German, such as cases, long compounds, and word order, are present to a far greater extent in Sanskrit, so in principle someone who knows Sanskrit may be able to pick them up more easily than someone trying to learn German without this knowledge. However, this may not be saying anything more than that knowing one language helps you learn others.
Found via G+, a new physical experiment that approximates , like Buffon’s needle problem: The Pi Machine.
Roughly, the amazing discovery of Gregory Galperin is this: When a ball of mass collides with one of ball , propelling it towards a wall, the number of collisions (assuming standard physics idealisms) is , so by taking , we can get the first digits of . Note that this number of collisions is an entirely determinstic quantity; there’s no probability is involved!
Here’s a video demonstrating the fact for (the blue ball is the heavier one):
The NYT post says how this discovery came about:
Dr. Galperin’s approach was also geometric but very different (using an unfolding geodesic), building on prior related insights. Dr. Galperin, who studied under well-known Russian mathematician Andrei Kolmogorov, had recently written (with Yakov Sinai) extensively on ball collisions, realized just before a talk in 1995 that a plot of the ball positions of a pair of colliding balls could be used to determine pi. (When he mentioned this insight in the talk, no one in the audience believed him.) This finding was ultimately published as “Playing Pool With Pi” in a 2003 issue of Regular and Chaotic Dynamics.
The paper, Playing Pool With π (The number π from a billiard point of view) is very readable. The post has, despite a “solution” section, essentially no explanation, but the two comments by Dave in the comments section explain it clearly. And a reader sent in a cleaned-up version of that too: here, by Benjamin Wearn who teaches physics at Fieldston School.
Now someone needs to make a simulation / animation graphing the two balls in phase space of momentum. :-)
Or maybe someone has done it already?
Here’s a great, simple write-up aimed at a Western audience, from the Clay Sanskrit Library edition of Kālidāsa’s The Recognition of Shakuntala, written by Somadeva Vasudeva:
Imagine that you find yourself going to see a performance of “Romeo and Juliet.” You are in the right mood for the play, no mundane worries preoccupy your mind, you have agreeable company, and the theatre, the stage, the director and the actors are all excellent—capable of doing justice to a great play. Your seat in the theatre is comfortable and gives an unobstructed view.
The play begins and you find yourself drawn into the world Shakespeare is sketching. The involvement deepens to an immersion where the ordinary, everyday world dims and fades from the center of attention, you begin to understand and even share the feelings of the characters on stage—under ideal conditions you might reach a stage where you
begin to participate in some strange way in the love being evoked.
Now, if at that moment you were to ask yourself: “Whose love is this?” a paradox arises.
It cannot be Romeo’s love for Juliet, nor Juliet’s love for Romeo, for they are fictional characters. It cannot be the actors’, for in reality they may despise one another. It cannot be your own love, for you cannot love a fictional character and know nothing about the actors’ real personalities (they are veiled by the role they assume), and, for the same reasons, it cannot be the actors’ love for either you or the fictional characters. So it is a peculiar, almost abstract love without immediate referent or context.
A Sanskrit aesthete would explain to you that you are at that moment “relishing” (āsvādana) your own “fundamental emotional state” (sthāyi-bhāva) called “passion” (rati) which has been “decontextualised” (sādhāraṇīkṛta) by the operation of “sympathetic resonance” (hṛdayasaṃvāda) and heightened to become transformed into an “aesthetic sentiment” (rasa) called the “erotic sentiment” (śṛṅgāra).
This “aesthetic sentiment” is a paradoxical and ephemeral thing that can be evoked by the play but is not exactly caused by it, for many spectators may have felt nothing at all during the same performance. You yourself, seeing it again next week, under the same circumstances, might experience nothing. It is, moreover, something that cannot be adequately explained through analytic terms, the only proof for its existence is its direct, personal experience.
It is, moreover, a blissful experience. The fact that sensitive readers often weep while reading poetry does not mean that they are suffering, rather the tenderness of the work has succeeded in melting the contraction of their minds or hearts.
The non-ordinary nature of such aesthetic sentiments makes it possible for the spectator or reader to derive a pleasurable experience even from what in ordinary life would be causes of grief.
The Indian scholarly tradition has a lot more, including some very thoughtful deliberation and perceptive observation, but it seems good to start a discussion of rasa with an example like this, than to start with the technical details.
[Another good start may be via film. See for instance:
How to Watch a Hindi Film: The Example of Kuch Kuch Hota Hai by Sam Joshi, published in Education About Asia, Volume 9, Number 1 (Spring 2004).
and perhaps (and if you have a lot of time):
Is There an Indian Way of Filmmaking? by Philip Lutgendorf, published in International Journal of Hindu Studies, Vol. 10, No. 3 (Dec., 2006), pp. 227-256.
Previously on this blog: On songs in Bollywood]
Famous verses appear in many variants. Thanks to Google, it is easy to find many of them. For “paropakāraḥ puṇyāya, pāpāya parapīḍanam”, Google throws up a lot of variants for the first half.
The Vikramacarita has:
śrūyatāṃ dharmasarvasvaṃ, yad uktaṃ śāstrakoṭibhiḥ /
paropakāraḥ puṇyāya, pāpāya parapīḍanam
Other variants are:
saṅkṣepāt kathyate dharmo janāḥ kiṃ vistareṇa vaḥ |
paropakāraḥ puṇyāya pāpāya para-pīḍanam ||Panc_3.103||
aṣṭādaśapurāṇeṣu vyāsasya vacanadvayam /
paropakāraḥ puṇyāya pāpāya parapīḍanam //
ślokārdhena pravakṣyāmi yaduktaṃ grantha-koṭibhiḥ
paropakāraḥ puṇyāya pāpāya parapīḍanam
Going by the first line gives other verses:
śrūyatāṃ dharmasarvasvaṃ śrutvā caivāvadhāryatām | (or caiva vicāryatām ।)
ātmanaḥ pratikūlāni pareṣāṃ na samācaret ||
[Cāṇakya-nīti, Pañcatantra, Subhāṣitāvalī etc.]
prāṇā yathātmano ‘bhīṣṭā bhūtānām api te tathā |
ātmaupamyena gantavyaṃ buddhimadbhir mahātmabhiḥ
तस्माद्धर्मप्रधानेन भवितव्यं यतात्मना ।
तथा च सर्वभूतेषु वर्तितव्यं यथात्मनि ॥ Mahābhārata Shānti-Parva 167:9
05,039.057a na tatparasya saṃdadhyāt pratikūlaṃ yadātmanaḥ
05,039.057b*0238_01 ātmanaḥ pratikūlāni vijānan na samācaret
05,039.057c saṃgraheṇaiṣa dharmaḥ syāt kāmād anyaḥ pravartate
As Hillel says, the rest is commentary.
For (some) commentary, go here.