Friday, October 31, 2014

Surreal misquotes




Bo Maung my bosom friend drank a bit too much, came to his senses a bit late, and took the break abruptly. He was well on his way to recovery, everyone thought, and died suddenly in his late-forties with a heart attack.


The last time I saw him was at the central railway station in Yangon when I saw him off shortly before I went to work in the Pacific. He was then boarding the train to Shwedaung, the town of his headquarters where he was the Township Officer of the General Administration Department. Of his fond memories I recall sitting hours on end with him over just a cup or two of tea and listened to our favorite singer, song writer, and pianist Sandaya Chit Swe at Maung Aye Cafe in Yegyaw. These days when I chanced to walk up the Thein Byu road between the Old Secretariat building and Government Printing Press, I miss the times when Bo Maung walked me back home from his place in Kandawgalay and we have our never ending talks, and it was drizzling. I remember the faint sweet scent of the kha-ye flowers dropping on to the platform and the tarmac from the trees lining the road. The trees are still there with thick dark trunks and branches with shiny leaves and small white flowers. But a fewer of them now, I think.


We both were fans of the leftist writer Bahmo Tin Aung, who undoubtedly was a hero of the young people of those days. We talked about his story "Dr. Yae Gyan", though I didn't remember reading it myself. He used to quote a passage from it:


"Far and farther away is a place, across the river,
It's the sweet home for me ... ."


He told me it was taken from the Bible.


A few years back, a found a reprint of Dr. Yae Gyan and bought it to give it to our youngest son whose name we took from this hero of Bahmo Tin Aung. Our son was working outside Myanmar and just before leaving Yangon to visit him I realized that I never really have read the book, so I hurriedly ran over it and naturally tried to find my (friend's) quote. I couldn't find it. Had my memory faltered? Or was it passed over because I was too hasty? Anyway, right or wrong, it was a sentimental piece and I'll always keep it together with the memory of my friend.


I have always like Hemingway and love his powerful prose. On occasions I love to quote this from Green Hills of Africa:


"If you loved one woman and a country, you are fortunate. Afterwards when you die, it doesn't make a difference."


Some time before, driven by my affinity for misquotes, I tried looking for that on the Web and I found:


"So if you have loved some woman and some country you are very fortunate and, if you die afterwards, it makes no difference."


Thanks, it was quite close.
A few weeks earlier, I was looking for images from white parabaiks on the Web and found the picture on the left first.

The head of the beast immediately struck me as familiar. The shape of the snout and eyes and color I thought I knew them. 

I thought it must be Chagall with his paintings of goats and cows. I looked for them on the Web and found La Mariée, Blue Circus, The Cow with the Parasol, The Farm Yard, I and the Village, and Big Sun.
chagall.png

Definitely it is Marc Chagall and I wasn't wrong!


The patriotic Buddhist monk, abbot of See-ban-ni left the legacy of indomitable spirit of defiance to the conquerors in a verse so intense:


Loss of kingship, loss of throne and sovereignty,
Loss of cities, obliteration to nothingness,
Three-fold losses we have to endure,
Has it to be our times doth our lot suffered?


Won't death serve us better?


I had also associated these words with this venerable abbot for some time:
Live simple, think complex.


And I had quoted it on many occasions and there wasn't any question at all until I quoted it to a young Myanmar diplomat in Jakarta. Though highly educated and knowledgeable, he had no idea of it. Well, I started to have doubts then and so I asked a friend who is a noted short-story writer and a lawyer. He looked up in some books on Myanmar quotations but couldn't find anything like mine. So, that must have been one of my misquotes. Yet I am not willing to give up. May be the name of the abbot has been wrong, but I am definite that I've read the text of the quote somewhere.


Some time back an ex-newscaster of a foreign radio service interviewed the head of an important commission or committee in Yangon. I felt the interviewee was way too cautious over the whole length of the interview.  Thwarting what looked like an attempt of the interviewer to corner him the interviewee remarked that Professor Hla Myint, who is a world renowned development economist, advised them not to move too fast, in reference to the topic of the interview. The interviewer didn't follow up on this remark. He must have known the visit of Professor Myint. I wonder.


Indeed I recalled that Professor Hla Myint, who visited Myanmar in 2012 together with Nobel Laureate economist Professor Stiglitz and Professor Findley, had delivered a talk on pacing development efforts in Myanmar. If I am not mistaken, Professor Hla Myint was not recommending caution over zeal, but to try balancing them and suggested that gaps may be help closed by diligent international assistance.


Quite recently, I visited one of a few sayas of mine from the Rangoon University days. It was the time of the Festival of Lights. While this is a religious Buddhist festival, it is also the time we Myanmars pay respect to our elders and sayas. It has always been a simple, heart-warming tradition of everyday life of ours. So we talked about our health, our families, old times, and exchanged some cautious remarks about life here in general. When I mentioned the visit of Professor Myint, my saya said that they had met him while he was in Myanmar and recounted that Professor Myint's advice to them was not to rush.


I was confused. Something must be wrong. Am I getting too old? I had the recordings of Professor Myint's talk as well as the talks of two other economists. I had listened to the recordings, but then my understanding might have been faulty.


Because of some micro urban renewal scheme we have to move out along with other residents and find a temporary home a year ago and we have yet to be settled. Hence, only after being frustrated for hours, I found my copy of the video disc of the talk out of the mess, with great luck.


Unfortunately no transcription of the talk of Professor Myint or others with him was available. So I was on my own. And as far as I could make out Sayagyi was commenting on the view held by many foreign diplomats and others that the hectic comprehensive reforms initiated by the government would result in Myanmar's burn-out, because of the limited capacity of the civil service.


Fortunately there is light at the end of the tunnel. He summed up by way of remedy:


I tried to show that this assumption have to change when applied to a country like Myanmar.


One, that country's limited administrative capacity is not immutably fixed. It can be augmented by seeking suitable assistance from various sources ranging from international agencies from economically advanced countries and Myanmar's neighbors in South East Asia which are rapidly growing.


Two, at present, Myanmar's administrative capacity has to be used ex to satisfy not competing ends, but in promoting complementary goals of economic development and political integration.


Finally, the reforms of which Myanmar is said rushing through are propelled by outward looking policy of economic development based on liberalization of the economy.


The present strain on the limited administrative capacity may be regarded as heavy temporary peak period demand on the country's limited capacity during the transition period from heavily consult economy to a free market economy.


I say all this fully aware of the fact that unlike the shortage of domestic savings which can be increased from external sources in recognized ways the problem of augmenting the limited administrative resource of a country like Myanmar by technical assistance from abroad is more complex. To be effective, the assistance must be adapted to suit the local conditions and state of economic development of the receiving country. Yet the reforms have to improve to increase the absorptive capacity of the country for outside capital in the form of foreign loans, foreign aid to the government and ensures of private foreign investment.
Perhaps Professor Myint's talk at UMFCCI (Union of Myanmar Federation of Chambers of Commerce and Industry) on February 2012 entitled Comments on rush to reform creates Myanmar burn outs which I mentioned, and his meeting with academics and other peoples were on different occasions. However, I don't have any inkling about those other occasions. Did they carry entirely different messages of Professor Myint, from the one that I've been quoting?


It seems possible to reconcile the two entirely opposite views this way. If sayagyi U Hla Myint had not veered from his original idea of augmenting the administrative capacity with outside assistance, which I think almost everyone would suppose, while his audience in a particular occasion were adamantly suspicious of outside assistance, the good professor would have no other option than to advise them not to rush, if I may add, packaged with a conservative inward looking policy as sayagyi has characterized the post-war, post-independence reforms.

Saturday, October 11, 2014

Tea-shop PI- VI

How could you find the best rational approximation of π?
The fact is that rational approximations of π are not obtained directly from a formula generating π such as the Mahdava's arctan series which is by far the oldest of its kind (around 1400 AD) and the BBP-type formulas of today. The BBP (David Bailey, Peter Borwein and Simon Plouffe, 1995) algorithm is the type of algorithms known as digit extraction algorithms which allows digits of a given number to be calculated without requiring the computation of earlier digits.
The way you get a rational approximation of π is first to have some accurate approximation such as a decimal approximation of π to 15 decimal digits or more and then work from it to get the desired rational approximation.
In 2008 S K Sen and R P Agarwal suggested four procedures for finding best rational approximations, namely, (i) Exhaustive search, (ii) Principal convergents of continued fraction based procedure, (iii) Best rounding procedure for rational approximation, and (iv) Continued fraction based algorithm with intermediate convergents (Agarwal et al, Birth, growth and computation of pi to ten trillion digits, 2013).
Consequently they have demonstrated that the absolute best k-digit rational approximation of π will be as good as 2k-digit decimal approximation of π. That means, for example, that 355/133 which is the best rational approximation with three digits in the numerator (k = 3) would be as good as the decimal approximation of π with six digits. Sen and Agarwal developed their procedures based on MATLAB, a well known commercial numerical computing environment and programming language. However, these should be implementable with other programming languages including R which is available for free.
The best 3-digits rational approximation for π is 355/113 = 3.1415929203..., correct to six decimals shown in bold figures. We have seen a popular belief circulated on some websites that you could easily obtain a rational approximation by taking the (i) decimal representation of π, (ii) take any denominator of your choice, (iii) multiply i) by ii), (iv) round the result of last step and you get the numerator. It is not that simple to get the best approximation. For example, you take 111 as denominator because it looks pretty and try that procedure:
3.141592 x 111 = 348.716712 and rounding to 349, then
349/111 =  3.144144144 which is correct to 2 decimals only
Note that it is only as good as 22/7 in terms of correct number of decimal digits. But 22/7 has an absolute error of 0.001264489267350 while 349/111 has a worse absolute error of 0.002551490554350.

The continued fraction of a number is of the form:













For π = 3.141592653589793... , the continued fraction representation is:

















To get the continued fraction you calculate this way:
The first integer term 3 is the integer part of π.
The second integer term 7 in the denominator is obtained by taking the integer part obtained from taking the reciprocal of the decimal part = 1/0.141592653589793 = 7.062513305931057.
The third integer term 15 in the denominator is obtained by taking the integer part of obtained from taking the reciprocal of the decimal part = 1/0.062513305931057 = 15.99659440668285.
Then 1/0.99659440668285 =  1.003417231016262.
Then 1/0.003417231016262 =  292.634590766962, and if you go on calculating this way you will get the continued fraction shown above.
Since the continued fraction for π never ends, you stop where you want to stop and calculate the result.
Thus to estimate π ignoring all fractional parts we take π = 3/1.
To estimate using two terms we have π = 3 +(1/7) = 22/7.
Using four terms we have π = 3 + 1/(7 + 1/(15+1)) = 3 + (16/113) = 355/113.
Each of such values obtained by taking only a part of the continued fraction is known as a partial convergent. It is known that the partial convergent just before a large denominator, here 15 and 292 give particularly accurate approximations. If you go on with the continued fraction you will find such termination points before the denominator 84 and 99 among others.
It is not practicable to compute the terms of continued fraction for π by hand for more than a few terms as the scale of arithmetic will be getting too big. A convenient way is to use the R package "contfrac". You can try running this in R:

Then you should get the output:
$A
[1]       3      22     333     355  103993  104348  208341  312689  833719
[10] 1146408
$B
[1]      1      7    106    113  33102  33215  66317  99532 265381 364913
If you want to look at the continued fraction:
> x
You get the output:
[1]   3   7  15   1 292   1   1   1   2   1
Even simpler is to read off the numerator and denominator with desired number of digits from the lists provided by OEIS (On-Line Encyclopedia of Integer Sequences) at https://oeis.org/.


You can search for the following sequences.
A002485 – Numerators of convergents to Pi
3, 22, 333, 355, 103993, 104348, 208341, 312689, 833719, 1146408, 4272943, 5419351, 80143857, 165707065, 245850922, 411557987, 1068966896, 2549491779, 6167950454, 14885392687, 21053343141, 1783366216531, 3587785776203, 5371151992734, 8958937768937
A002846 – Denominators of convergents to Pi
1, 7, 106, 113, 33102, 33215, 66317, 99532, 265381, 364913, 1360120, 1725033, 25510582, 52746197, 78256779, 131002976, 340262731, 811528438, 1963319607, 4738167652, 6701487259, 567663097408, 1142027682075, 1709690779483, 2851718461558, 44485467702853
You can also look for longer lists of numerators and denominators by following the links provided in their descriptive texts.





Thursday, October 9, 2014

Tea-shop PI

This is a sequel to my looking into Old Myanmar Land Area Calculation parabaik. My attempt to know some more about Pi.
Tea-shop PI- I
https://drive.google.com/file/d/0B0AtxK8T8qtYZEJKUHE0bkxkRUk/view?usp=sharing

Tea-shop PI- II
https://drive.google.com/file/d/0B0AtxK8T8qtYLVh5NVR3cE1ocWM/view?usp=sharing

Tea-shop PI- III
https://drive.google.com/file/d/0B0AtxK8T8qtYcXlsaW9kY1FsTnc/view?usp=sharing

Tea-shop PI- IV
https://drive.google.com/file/d/0B0AtxK8T8qtYUEw5TXBwemFMR3M/view?usp=sharing

Tea-shop PI- V
https://drive.google.com/file/d/0B0AtxK8T8qtYVjM4OTl6WXg3Sms/view?usp=sharing

Pigeon half, five-for-duck, quarter a-sparrow


We should feel sorry for our grand-children these days.
No nursery rhymes, no bedtime stories, no playground, no surprising of a crow trying to steal into the kitchen, no fishing and a cooling dip in the Royal Lake, and a lot more of such fun. Alas their moms are worse than drill sergeants. Saving money for the cramming sessions for their children next year or scouting for the best talent as cramming masters. Pure robotics!
Cramming for the exams, even for the KG!
All work and no play that's for you idiot. All play and no work is just for them, it's your karma. It's written for us.
My mother was something of a stern woman but when I grew up and made a living, I often wished I had a bit of her strength of character. And I didn't quite remember her telling me stories, though two of my big sisters did. The old mom-tortoise, son-of-papa-pelican-why-won't-you-go-to-sleep, little chick and the old tom-cat, golden rabbit and golden tiger went gathering thatch were the favorite stories of those times. Then there were also the riddles and puzzles and I happen to remember only this one:
"Pigeon half, five for duck, quarter a-sparrow,
            With 25 kyats, go get 25 birds in a row."
The problem is this. One duck costs 5 kyats, one pigeon costs 1/2 kyat, and one sparrow costs 1/4 kyat. Get 25 birds with 25 kyats. I vaguely remember getting to know it as a schoolboy and may be from friends, or my sisters. I am not sure if I heard of any solution or if I tried solving it myself. These days I started learning R and about two years ago, I solved it with some awkward R programming. It was a brute-force program, with a series of loops, just the kind of thing the R gurus looked down. The solution is: 3 ducks, 18 pigeons, and 4 sparrows.
Recently, I've been reading hurriedly about ancient Indian and Chinese mathematics and came across a class of equations known as indeterminate equations. The modern forms of such equations are Diophantine equations, Pell's equation, and the like. Absolutely I know just these few names and nothing more. If you are interested in these topics a good start may be the Wiki entry "Diophantine equations" and Wolfram MathWorld's entry with the same name.
Yesterday, while browsing for ancient Chinese mathematics on π related information, I found The Ambitious Horse: Ancient Chinese Mathematics Problems. There I found the 100 fowls problem. It reads:
"A rooster costs 5 copper coins call qian. A hen costs 3 qian, while 3 chicks can be purchased for 1 qian. You have 100 qian to buy exactly 100 fowls. How many roosters, hens, and chicks  there?"
What a coincidence, our duck-pigeon-sparrow puzzle is exactly the same kind. Then, is our 25 birds puzzle our own? Or was it an adaptation of this 100 fowls problem included in the Chinese classic Zhang Qujian suanjing of fifth century AD?
Or did we derive our puzzle from the Indian tradition of mastery of indeterminate equations from Aryabhata (499 AD)? This is not so far fetched if we recall that we have an old astrological tradition that has its roots in Indian astronomy. We now know that the first explicit description of the general solution in integers of the Diophantine equation ay - bx = c was found in Aryabhata's text called Aryabhatiya. His method was known as the kuttaka (pulverizing or breaking up into small pieces) method.  Aryabhata applied his method to solve simultaneous Diophantine equations for important applications in astronomy.
As for the 100 fowls problem, it is known that in problems such as these where the number of equations are less than the number of unknowns, there usually is more than one solution. Additionally we need a solution with integer values only.
Now the equations of the 100 fowls problem could be written as:
          5R + 3H + (1/3)C = 100,  and  R + H + C = 100,
where R is the number of roosters, H is the number of hens, and C is the number of chicks.
This is an indeterminate equation as there are three unknowns R, H, and C and just two equations. You could make them simpler by solving for C in the second equation,
C = 100 – R - H
and substituting for C in the first. Which will give you
           H = 25-(7/4)R.
But since you need solutions in whole numbers, you would create a new variable t = R/4, then
           H = 25 – 7t, and you can go on to find H using t = 0 or 1 or 2 or 3 or ...
From that you can find the possible pairs of values for H and t. R is then calculated as R = 4t. Then you get C from C = 100-R-H. Then you will get the four solutions, among which solution-2 is the Zhang Qujian's classic soluation:
                   R    H     C   Qian
Solution-1    0   25   75     100
Solution-2    4   18   78     100
Solution-3    8   11   81     100
Solution-4  12    4    84     100
If you don't allow leaving out the roosters, you get three solutions. Now you can try the same method with our 25 birds puzzle and there you will find it has only one solution. Here is my R program for the 100 fowls problem and it's a little more elegant than my brute force program mentioned earlier.




Old Myanmar land area calculation

An attempt is made to interpret the five methods of land area calculation in Old Myanmar found on a parabaik from the Rangoon University Library:

https://drive.google.com/file/d/0B0AtxK8T8qtYWjBGQWRNaEVMRE0/view?usp=sharing
https://drive.google.com/file/d/0B0AtxK8T8qtYLVh5NVR3cE1ocWM/view?usp=sharing
https://drive.google.com/file/d/0B0AtxK8T8qtYcXlsaW9kY1FsTnc/view?usp=sharing
https://drive.google.com/file/d/0B0AtxK8T8qtYUEw5TXBwemFMR3M/view?usp=sharing

Wednesday, October 8, 2014

Bayanathi, Byamadat, opening windows, and muddy water


A long long time ago Varanesi became Bayanathi. Bramadhatta became Byamadat.
That's how we had adopted the holy Indian city and the illustrious Indian king into Myanmar language. Over the decades we have forgotten the city and the king and they just evolved into handy phrases devoid of context and lineage to their roots so that our elders could begin their stories of a certain nation ruled by a certain king in the ancient days:
Don't know the nation? Call it Bayanathi.
Don't know the king? Call him Byamadat.

That was when we were young and I am not sure our young people nowadays know about these phrases. Never mind, because we the older ones needed them more than young people do. Have we not lamented that our grandchildren need bedtime stories, nursery rhymes and playgrounds and some time-outs from their ambitious moms and dads? Were we not unsure of where rote learning is leading our schoolchildren to? Did we not opine that knowledge could be made accessible to the ordinary people if done right?

So everybody must do something to help, share something, show the way at least one step at a time, one step you are sure of. When I was a public employee, I remembered one time when a group of Korean professors gave a seminar to promote some do-it-yourself grain dryers for rice. I didn't think much of this innovation because I knew our farmers won't take that much trouble and besides they are short of cash. However, what impressed me was their slide that showed Einstein sitting in one cup of a giant weighing scale but on the other cup was a bunch of ordinary people crowding in and tipping the balance to their side. Then much later as a volunteer in Jakarta I had great opportunity to get unlimited access to the internet both at work and home. Then I was devouring websites the like of FirstMonday and articles like The Cathedral and the Bazaar while eagerly awaiting the coming of age of the free software movement. During that time what impressed me were the words of some guy who said that we should publish fast and publish often, if I remember him right. Of course, he was talking about publishing on the web. What he was saying is that we should not worry too much about making mistakes because others would be looking at them and will correct them.

Later, putting these two ideas together, I could gather enough courage and funds to start a monthly computer magazine in Myanmar language with a friend. We did get fairly good reception for our magazine and did not lose money. Unfortunately after running the magazine for about a year we were forced to stop because we were publishing with a temporary permit and we couldn't get a proper magazine publication license.

Who actually are embracing the advice to publish fast and publish often? Not many from those days could have anticipated the rise of social media and the attending hate speech, dirt, child safety, online privacy risk, self-promotion and cheap commercials as well as the big brother ninety eighty-four syndrome of the day. I heard that Deng Xiaoping had said if you want fresh air you have to open the windows and then you'll have to bear with the dust and the litter that are blown in as well.

I had read about this Lao Tzu's advice: Who can make the muddy water clear? Leave it alone and it will clear off itself. Many decades ago on a fieldwork, I had seen my guide drinking "spring" water dripping from the side of a valley in the dry zone. Surely it was spring water but coffee colored and lucky I wasn't that thirsty. I don't mean to say that his community didn't have good clean water. But what I mean is that on that occasion he didn't have the option of waiting for the water to clear off.

You are lucky if the likes of Einstein come along. But more realistically you can't wait for geniuses. You will have to help yourself.