Search The Web

Today's Headlines

Sunday, April 25, 2010

I Don't Have A Minute To Spare For Blogging!

The census bureau has sucked up all my free time for the past 3 days. A new week starts today, and the schedule I have been given gives me no free time except on Wednesday (and that is only because I requested Wednesdays off for my karate class). So, unless I can squeeze in some writing during my regular day job, I have no time to blog at all.

I caught up on some of my sleep yesterday and today by sleeping in late and taking some afternoon naps. That is not going to be possible during the work-week, so I will have to manage on a little less sleep than I am used to. Fortunately, the census bureau wants us to put in all the work we can this week so that they can get these binders out to the enumerators by April 30th. After that, we will probably get a week of respite before the enumerators do their thing and start turning in the surveys. But, as of now, I have next weekend and the first week of May mostly open, so if I survive to the end of this week, everything should be fine!

Yesterday, we were doing what is called "assembling folders". There are several things that go into a folder, including address lists, maps, etc. But one of the important things that go into a folder is a bunch of census questionnaires that the enumerators use to note down answers from the people they visit. Preparing the questionnaires involves some labor because we have to stick address labels on the questionnaires.

Our office had some targets and deadlines for how many folders need to be assembled by us by what time. Our office supervisor decided to meet the targets in typical government fashion: he redefined the targets to suit his needs! Instead of assembling full binders that include the questionnaires, we spent all of yesterday putting together binders that contain everything but the questionnaires. That way, we met or exceeded our "targets" for the number of binders we had to assemble.

Including the questionnaires would have put us behind target because it would have taken time and manpower to stick the labels on the questionnaires and get them ready to be included in the binders. By redefining what an assembled binder meant, we were able to meet our targets without any problems. We will probably spend the rest of this week actually sticking labels on the questionnaires so that the binders can actually be shipped out with them, even though they are already "complete"! In fact, our shift supervisor and the supervisor of the next shift argued about whether this was the correct way to meet the target, but our shift supervisor convinced the other supervisor that "assembling folders" was subject to interpretation, and his interpretation was as valid as any other. And his interpretation allowed the office to claim adherence to targets and deadlines, so, why not?!

Anyways, in blogging news, all the blog posts I had planned for the past week went out on time. The same will probably not happen for the coming week, but I will cross that bridge when I get to it. On Monday, I published a post on find the great circle initial heading in Microsoft Access. On Tuesday, came a post on bad Microsoft product names. On Wednesday, I published a post on recurring decimal representations of fractions. Then on Thursday, I posted a satirical college admission essay written by a humorist in the early 90's. On Saturday, I put together a post about my adventures dealing with the census bureau.

My blog had visitors from two new countries this past week. The countries were Tanzania and Macao. With that, the flagcounter on my blog now sports 128 flags.

I have no time to make this post any longer or talk about anything else now. I have to get ready for my work on the evening shift at the census bureau. Everyday this week (except for Wednesday and Saturday), I am going to be going to work at my regular job from 7:30AM to 4PM, then work at the census bureau from 4:30PM to midnight, snatch some sleep, and then repeat the whole process the next day. I am having fun doing it right now though. It is new and different, and it will be fun until the novelty wears off. Hopefully by that time, the census bureau would have had enough of me, and I can go back to my normal life. If I don't add to my blog in the coming weeks, you know who to blame: the census bureau sucks (I mean it sucks up all my free time, but you knew that, didn't you?!).

Saturday, April 24, 2010

The Government Bureaucracy Grinds On . . .

We all have our dealings with various levels of government. It is unavoidable. I have had more than my fair share of dealing with various government agencies over the years. Some agencies have surprised me with how well they handled their contact with me. Others have been so abysmal it is absolutely no mystery where bureaucrats get their reputation for not knowing their elbow from you-know-what!

I have been in a driver services facility where a pissed-off employee noted down the name of a driver trainee and swore in front of everyone that she would fail her at her next test because of something that the trainee happened to do to anger her. Obviously, this was just one employee venting her frustrations in an undiplomatic manner, and does not reflect the policies of the agency she represents.

But, government agency policies themselves can lead to ridiculous outcomes. For instance, the citizenship and immigration service (CIS) insisted on fingerprinting me a second time for my green card because my green card was not approved within 6 months of my giving them my first set of fingerprints. According to their policy, my first set of fingerprints had "expired"! You would think that the whole idea behind fingerprinting is that they don't expire, but the CIS obviously has ideas of its own as to what purpose fingerprints serve! This same agency then forced me to get fingerprinted a third time when I applied for citizenship even though they already had two perfectly valid sets of my fingerprints already!!

And even more bizarrely, when I applied for citizenship, I sent in my applications about a week before the first date on which I was eligible to apply (to account for transit time by mail). After 10 days, my applications was returned to me with a note that said my application had come in before the eligibility date. I then had to literally transfer the contents to a new envelope and mail it in once again! They could have held on to the application for a couple of days (until I became eligible) before starting to process the application. But their policy instead had them returning the file to me and forcing me to mail it back to them a second time. And the postal service still struggles to make money!

Anyways, my most recent dealings with government bureaucracy have been a little more intimate than just sending an application off and waiting for a response. Late last fall, just out of curiosity, I applied for a temporary job with the US Census Bureau. They had me take a couple of tests to evaluate me on basic stuff like whether I could read and write English, whether I could add and subtract numbers, whether I knew how to read simple maps, etc. Obviously, I did pretty well on the tests, so the bureau was interested in getting me to work for them.

That is when the fun started. It turns out that to be eligible for a government job, all males should have enrolled for the draft (it is formally called the Selective Service System). If they did not, they need to show that they were not in the country before their 26th birthday (so, if you come here after your 26th birthday, then you don't have to enroll for the draft). There are a couple of other exceptions, including that if you were in the country before your 26th birthday, but on a non-immigrant visa (like a student visa), then you don't have to enroll for the draft.

I fall into the second category of exempt individuals. I was in the country before my 26th birthday, but became an immigrant only after my 26th birthday. I explained this on my application form, but nobody in the Census Bureau seemed to understand the issue. Starting early this year, I would get a call once every couple of weeks or so from a Census Bureau recruiter. It was always a different recruiter each time. Each of them would ask me why I did not enroll for the draft, and I would explain my situation to each of them. They would then promise to look into the situation and get back to me, but none of them ever did.

I grew tired of it eventually and chalked it up to institutional stupidity that I could not penetrate. Ultimately, I got a letter from the Census Bureau telling me that my application to work for them was rejected because I had not enrolled for the draft. And this letter included a paragraph saying that if I had a documentary explanation for why I did not enroll in the draft, I should send it to them so that they can review my case. And they actually included an address to address correspondence to!

You see, I actually have a letter from the Selective Service System that tells me they have reviewed my case and found that I did not have to enroll for the draft because of my immigration situation. I obtained this letter from them several years ago as part of the process of applying for my citizenship (you are not eligible for citizenship if you had to enroll for the draft and did not). If any of these recruiters had told me that all they wanted was this kind of document, and given me an address to mail it to, this whole issue would have been taken care of 3 months back. But the recruiters seemed to be reading from a script, and when my explanation did not fit their script, they simply gave up, and either crossed my name off their list, or passed my name on to a different recruiter to try his luck!

I mailed in a copy of my letter from the Selective Service System to the address mentioned, and within 2 weeks, I had magically become eligible for employment with the Census Bureau! And within a week after that, I got a call asking me if I would be able to come in for training so that I could start work later that week. They were desperate for workers and needed as many as they could lay their hands on legally!

Now, I already have a full-time job, so I was not ready to start working for the census anywhere near full-time. I just wanted a part-time gig through which I could convert some of my free-time into pocket money. The recruiter scared me a little when she started saying that they needed workers to work 8 hours a day, including the night shift at times. But I decided to go for the training anyways. After all, if the schedules did not suit me, I could just refuse to go into work, and what could they do? Fire me??!!

So, I showed up for the training last week. The person doing the training was quite nice and all, and she tried hard, but she has been working for the bureau only for 9 months. The whole session was quite haphazard, with various pieces of paperwork and other stuff missing. Rather than any actual training in doing our job, the 4-hour session was just to get all the new hires to fill out a blizzard of paperwork of all sorts. The trainer read instructions from a fat binder while some people filled out the paperwork (usually ignoring the instructions), and others got lost at various places and stared blankly at the trainer or at each other (seriously though, if you don't know how to fill in your name or street address where a form asks you to, and need instructions from a trainer to get it right, you probably shouldn't be looking for work, but whatever . . .). It was significant that only one other person in my training class of 15 people had a full-time job, everybody else was unemployed and looking for any kind of work they could get.

We were then fingerprinted (yes, here we go again) twice (and again), given a thick policy manual to read at home and sent off. I also gave the trainer a list of times when I would be available and when I would not be available, given the constraints placed on me by my full-time job.

A day after that, I got a call asking me if I could come in from 8:30 AM to 5PM the next day, a work day. Obviously, the day time on work days was on my list of unavailable times I had given to the trainer, but obviously, the scheduler had never gotten that information. I once again explained to the scheduler my position, and she then called me later to offer me an evening shift. Obviously, I have no idea what is going to happen when a new scheduler takes over next week or the week after. I probably have to explain to him/her once again when I am available and when I am not! Bureaucracy means always having to repeat yourself . . .!

I showed up for work on an evening shift a couple of days back. I am involved in a part of the census operation called the non-response follow-up (NRFU). This is the stage in which people who have not responded to their mailed census questionnaire are tracked down by enumerators and their information is obtained on forms through a direct interview with the non-respondent. I am one of the support personnel involved in this operation, and it is my job to produce detailed maps for the enumerator showing where the non-respondents' addresses are.

There is apparently a method to all the madness, as I found out when I showed up for work the first time. The bureau office had printed out reams of maps on 11x17 size paper, and it was our job (I was working in a crew of about 10 people) to stuff these into envelopes following a standard procedure. The standard procedure was taught to us by a couple of people who had been doing it for a week or so (yes, we were trained by other trainees, essentially). But it was a mostly brainless and monotonous activity that primarily involved one's ability to read rows of numbers, and protect oneself from paper cuts (they have large bins of bandaids in various places in the office and most people had several on their fingers, from careless handling of high-quality paper!). Now I know what an envelope-stuffer's job is like!

In typical government bureaucracy fashion though, there is no order to the maps or the envelope numbers. Some envelopes get dozens of maps, others get just one. And sometimes the maps are in order and easy to pick out from the piles, other times, they are scattered in several piles and require a detective agency to track down! How credit card and other companies can automate all this envelope stuffing while the government requires an army of laborers to do essentially the same thing is a little beyond me. But I guess that is what makes the government the government! Bureaucracy means never having to be out of work . . .!

I got the hang of it pretty quickly and our crew managed to stuff all the envelopes we were supposed to. I have no idea what the next step in the operation is, so when I show up for my next day of work is when I will find out what the next step in the operation is (it could be sticking labels on envelopes, putting the envelopes in binders, etc., etc.). I am waiting for when the enumerators come back with all the information they have collected because that is when we start entering that information into computers. I will still be a lowly office clerk, but at least I don't have to worry about paper cuts!

The Census Bureau is very particular about confidentiality of personally identifiable information. A huge part of the training manual talks about what I am allowed to and not allowed to do with names, addresses, phone numbers, and other personally identifiable information. They don't allow me to bring my briefcase into the work area (I have to leave it in my car in the parking lot) because they are worried about leakage of such information.

But, ironically, the office manager who sets up our schedules sends it out by email to everyone with all their email addresses readily visible. Apparently, the concept of using Bcc in email messages to protect the recipients' privacy has not yet penetrated even a government bureaucracy obsessed with privacy and confidentiality! And the schedules are produced as Word documents with tables. Hours are calculated by hand and entered into the tables (with resultant mistakes that have to be caught and corrected later). The concept of a spreadsheet which can do all these calculations automatically and correctly has not penetrated this bureaucracy yet either!!

It is not that I am faulting this particular office supervisor, or office. The office supervisor, in fact, is a very nice lady who is always smiling and treats her temporary workers very well (some people don't like her "no music in the office" policy, but it does not bother me that much). But the institution itself is not set up to succeed when it comes to technology. Technology overtook them a long time back, and has never looked back! There was some talk about why everything is paper-based and they have not yet moved to hand-held computers for enumerators. The consensus was that they will probably do the 2020 census that way, but probably using Apple Newtons or something similar from the early 1990's!

Oh, and I almost forgot - we all had to fill out timesheets for the work we did. Everyone has to turn in a timesheet for each day they work for the bureau. You can't do a single timesheet for multiple days. I was in a shift from 4:30PM to midnight. The shifts can not cross midnight because then you would need two timesheets to cover that single shift's time! And these timesheets did confuse me a little in spite of my having filled out all kinds of forms in my lifetime. The problem is that the timesheets are also a way to ensure adherence to policies, not just a simple reporting tool for figuring out how much you get paid.

For instance, the government pays a differential for work outside normal hours. So, all work performed between 6PM and 6AM has to be reported separately in the timesheet. Thus, because my shift went across 6PM, I had to fill out one line for work from 4:30PM to 6PM, and another line for the rest of the time. And you can't work more than 5 hours at a stretch without a half-hour lunch break. So, I had to put in a break at about 9 or 9:30PM to accommodate that requirement. Thus, a simple 7-hour work-shift became 3 lines each in 3 different parts of the form! No wonder there were lots of torn-up timesheets in the trashcans in that place as people fumbled their way through a true bureaucrat's dream come true!

And if you are afraid of acronyms, you don't want to apply for this job. The bureau has huge banner-size posters filled with acronyms taped to the walls so that people can keep all the letter combinations straight in their heads. In addition to NRFU, there are OOSFO's, OOSTE's, CLD's, SCUF's, PUMA's, GQAV's and scores of others! If you want something to put you to sleep on a sleepless night, read this Census Bureau glossary!

But, I am getting a fascinating look just below the surface of a massive government undertaking. It is one of the most logistically challenging operations undertaken by any country in peace-time. In spite of all the papercuts and other snafu's encountered by the operation, it does a decent job of enumerating the population of the US and collecting the information necessary to be collected for various government programs, including redistricting of congress, allocation of funds to every level of government and so on. You can make fun of the government and its bureaucracy all you want, but once it gets going, there is no stopping it! The Government Bureaucracy Grinds On . . . And On . . . And On . . .!!

Thursday, April 22, 2010

Can You Top This Candidate's College Admission Essay?!

This satirical essay, or a version of it, was written by a high school student named Hugh Gallagher, who entered it in the humor category of the Scholastic Writing Awards in 1990, and won first prize. It was subsequently published in Literary Calvalcade, a magazine of contemporary student writing, and reprinted in Harper's and The Guardian before taking off as one of the most forwarded "viral" emails of the decade.

Though this was not his actual college application essay, Gallagher was ultimately accepted at NYU, where he graduated in 1994. Since then he has worked as a freelance writer. His first novel, Teeth, was published by Pocket Books in March 1998.

In the 1990's this essay was sent around by email, purporting to be an actual college admission essay. Though it is not, I wouldn't fault a college for giving admission to a candidate who submitted this as his essay!

3A. ESSAY

IN ORDER FOR THE ADMISSIONS STAFF OF OUR COLLEGE TO GET TO KNOW YOU, THE APPLICANT, BETTER, WE ASK THAT YOU ANSWER THE FOLLOWING QUESTION: ARE THERE ANY SIGNIFICANT EXPERIENCES YOU HAVE HAD, OR ACCOMPLISHMENTS YOU HAVE REALIZED, THAT HAVE HELPED TO DEFINE YOU AS A PERSON?

I am a dynamic figure, often seen scaling walls and crushing ice. I have been known to remodel train stations on my lunch breaks, making them more efficient in the area of heat retention. I translate ethnic slurs for Cuban refugees, I write award-winning operas, I manage time efficiently. Occasionally, I tread water for three days in a row.

I woo women with my sensuous and godlike trombone playing, I can pilot bicycles up severe inclines with unflagging speed, and I cook Thirty-Minute Brownies in twenty minutes. I am an expert in stucco, a veteran in love, and an outlaw in Peru.

Using only a hoe and a large glass of water, I once single-handedly defended a small village in the Amazon Basin from a horde of ferocious army ants. I play bluegrass cello, I was scouted by the Mets, I am the subject of numerous documentaries. When I'm bored, I build large suspension bridges in my yard.

I enjoy urban hang gliding. On Wednesdays, after school, I repair electrical appliances free of charge.

I am an abstract artist, a concrete analyst, and a ruthless bookie. Critics worldwide swoon over my original line of corduroy evening wear. I don't perspire. I am a private citizen, yet I receive fan mail. I have been caller number nine and have won the weekend passes. Last summer I toured New Jersey with a travelling centrifugal-force demonstration. I bat .400. My deft floral arrangements have earned me fame in international botany circles. Children trust me.

I can hurl tennis rackets at small moving objects with deadly accuracy. I once read Paradise Lost, Moby Dick, and David Copperfield in one day and still had time to refurbish an entire dining room that evening. I know the exact location of every food item in the supermarket. I have performed several covert operations for the CIA. I sleep once a week; when I do sleep, I sleep in a chair. While on vacation in Canada, I successfully negotiated with a group of terrorists who had seized a small bakery. The laws of physics do not apply to me.

I balance, I weave, I dodge, I frolic, and my bills are all paid. On weekends, to let off steam, I participate in full-contact origami. Years ago I discovered the meaning of life but forgot to write it down. I have made extraordinary four course meals using only a mouli and a toaster oven. I breed prize winning clams. I have won bullfights in San Juan, cliff-diving competitions in Sri Lanka, and spelling bees at the Kremlin. I have played Hamlet, I have performed open-heart surgery, and I have spoken with Elvis.

But I have not yet gone to college.

Wednesday, April 21, 2010

Vedic Mathematics Lesson 49: Recurring Decimals 1

We are all familiar with fractions which can not be expressed in decimal form without the use of digits that repeat endlessly. These are referred to as recurring decimals. What fractions have recurring decimals, and how do we calculate the recurring decimal form of a fraction without going through laborious long division? This lesson and the next few will answer these questions.

You can find all my previous posts about Vedic Mathematics below:

Introduction to Vedic Mathematics
A Spectacular Illustration of Vedic Mathematics
10's Complements
Multiplication Part 1
Multiplication Part 2
Multiplication Part 3
Multiplication Part 4
Multiplication Part 5
Multiplication Special Case 1
Multiplication Special Case 2
Multiplication Special Case 3
Vertically And Crosswise I
Vertically And Crosswise II
Squaring, Cubing, Etc.
Subtraction
Division By The Nikhilam Method I
Division By The Nikhilam Method II
Division By The Nikhilam Method III
Division By The Paravartya Method
Digital Roots
Straight Division I
Straight Division II
Vinculums
Divisibility Rules
Simple Osculation
Multiplex Osculation
Solving Equations 1
Solving Equations 2
Solving Equations 3
Solving Equations 4
Mergers 1
Mergers 2
Mergers 3
Multiple Mergers
Complex Mergers
Simultaneous Equations 1
Simultaneous Equations 2
Quadratic Equations 1
Quadratic Equations 2
Quadratic Equations 3
Quadratic Equations 4
Cubic Equations
Quartic Equations
Polynomial Division 1
Polynomial Division 2
Polynomial Division 3
Square Roots 1
Square Roots 2
Square Roots 3

Most of us are familiar with the fact that certain fractions (such as 1/3) have a recurring decimal representation. 1/3 is 0.333333. . ., with the series of digits continuing on forever with no end. On the other hand, some fractions (such as 1/2) have a decimal representation that has no recurring part. Thus, 1/2 is exactly 0.5, and the decimal representation does not continue on forever.

The rules that determine whether a fraction has recurring decimals or not are really quite simple. First represent the fraction in its simplest form, by dividing both numerator and denominator by common factors. Now, look at the denominator. If the prime factorization of the denominator contains only the factors 2 and 5, then the decimal fraction of that fraction will not have recurring digits. If the prime factorization yields factors like 3, 7, 11 or other primes (other than 2 and 5), then that fraction will have a decimal representation that includes recurring digits.

Moreover, if the denominator's prime factors include 2 and/or 5 in addition to other prime factors like 3, 7, etc., the decimal representation of the fraction will start with a few non-recurring decimals before the recurring part.

Thus, 1/4 = 0.25 (4 is just 2x2, and since the denominator can be factorized using only 2 and 5, the decimal representation does not include any recurring part). On the other hand, 1/9 = 0.111111. . . because 9 is 3x3. Thus the denominator has prime factors other than 2 and 5, thus making its decimal representation a recurring one. Furthermore, 1/6 = 0.1666666. . . In this case, 6 = 2x3. Thus one of the factors is a 2 or 5 while the other factor is not. That is why in this case, the decimal representation contains recurring digits, but the recurring digits start after at least one non-recurring digit.

In this lesson, we are going to start this series of lessons on recurring decimals by concentrating on a simple way to calculate the reciprocals of prime numbers like 3, 7, 11, etc. Thus, we will be finding the decimal representation of 1/3, 1/7, etc. The usual way in which this is done is by long division. We perform a long division of 1 by the given denominator as many times as is required to actually get the decimal representation.

In the case of a number like 1/3, this is quite simple. The recurring decimal is just one digit long, and an astute person can recognize that the digit has started repeating right away. He/she can then stop the division after just a few steps, saving a lot of effort. But what about a number like 1/7 or 1/17? These are the cases in which our shortcut can make a big difference.

Before we explain the shortcut, we need to understand another property of recurring decimals. And that concerns the last digit of the recurring part of the decimal representation of the reciprocal of numbers that end in 1, 3, 7 or 9. Note that these numbers can not have 2 or 5 as their prime factors, so the reciprocals of these numbers consist of purely recurring digits. The product of the last digit of the recurring decimal representation of a number and the last digit of the denominator (in this case, 1, 3, 7, or 9) is always 9.

Thus, if a number ends in 1, the decimal representation of its reciprocal will have repeating decimals that end in 9 (1/11 is 0.0909. . ., for instance). If a number ends in 3, the decimal representation of its reciprocal will have repeating decimals that end in 3 (1/3 = 0.33333. . ., for instance). If a number ends in 7, the decimal representation of its reciprocal will have repeating decimals that end in 7 (1/7 = 0.142857142857. . ., for instance). And finally, if a number ends in 9, its denominator will have a decimal representation that has a repeating decimals ending in 1 (1/9 is 0.111111. . ., as an example).

The last digit of the recurring decimal representation of the fraction is referred to as the sesanyanka of the fraction (sesanyanka literally means last digit).

The shortcut that we are about to explore in this lesson is based on two vedic sutras. The first one is Anurupyena, which means "proportionally". We have seen applications of this sutra in other areas such as multiplication. Finding the recurring decimal representation of fractions is another application of this sutra. The other sutra we will use says Sesanyankena Caramena. Literally, this means "the remainders by the last digit". Our knowledge of the last digit of the recurring decimal representation of a reciprocal (the sesanyanka) is going to come in handy in the application of this sutra, which is why we spent some time going over them!

The shortcut works as follows:
  1. Pretend that you are going to use long division to find the reciprocal of the given number ending in 1, 3, 7, or 9. As such, you would put a decimal point on the quotient line, then add a zero to the dividend (1 in this case) and then attempt to perform a division. This will result in a quotient and a remainder (in the case of divisors less than 10, the quotient will be non-zero, for divisors greater than 10, the quotient will be 0)
  2. We are not interested in the quotient though. We are interested in the remainder. More precisely, we are interested in the ratio of the remainder to 1. Call this ratio our multiplier. Since we are taking ratios with respect to 1, the first remainder is always our ratio in this technique
  3. Write down the first remainder
  4. Now, multiply the first remainder by the multiplier, and cast out the divisor (keep subtracting the divisor from it until the number left is less than the divisor). This becomes the next remainder. Write it next to the first remainder, separated from it by a comma.
  5. Now multiply the next remainder by the multiplier, and again cast out the divisor. Once again write this remainder next to the previous ones as before
  6. Repeat step 5 until at some point, the remainder becomes 1. Add the one to the list of remainders and stop repeating step 5
  7. Now, multiply the last digit of each remainder by the last digit of the recurring decimal appropriate for the denominator, the sesanyanka (remember that the sesanyanka of a divisor that ends in 1 is 9, that for a divisor that ends in 3 is 3, that for a divisor that ends in 7 is 7 and that for a divisor that ends in 9 is 1), and put the last digits of the products down in order. This step is what is meant by the vedic sutra, Sesanyankena Caramena, the remainders by the last digit
  8. At the end of the process, you have a set of digits that represents the recurring decimal representation of the given reciprocal!
Can it be that simple? Let us try it out on a few numbers to convince ourselves that it works. Take 1/7 for instance.
  1. We pretend to perform long division. We add a zero to the end of 1 to get 10. This gives us a quotient of 1 and a remainder of 3.
  2. We don't care about the quotient. But our remainder being 3 tells us that our multiplier is 3
  3. We write down 3
  4. Multiplying 3 by our multiplier, 3, gives us 9. Casting out our divisor, 7, gives us 2. This becomes our next remainder. Write it next to the 3, giving us 3,2
  5. Multiplying 2 by our multiplier 3, we get 6. Casting out 7 from 6 leaves us with 6. This gives us 3,2,6
  6. Multiplying 6 by 3 and casting out 7's gives us 4. Our next remainder, 5, comes from multiplying 4 by 3 and casting out 7's. When we multiply 5 by 3 and cast out 7's, our remainder becomes 1. This is our signal to stop. Our list of remainders now reads 3, 2, 6, 4, 5, 1
  7. The last digit of the product of 3 and 7 (remember that the sesanyanka of 7 is 7 itself) is 1. The last digit of the product of 2 and 7 is 4, and so on.
  8. We ultimately get 142587, and we say that 0.142857. . . is the recurring decimal form of 1/7. We can verify that 7x0.142857142857142857 . . . is very nearly 1 (as we increase the number of times we include 142857 in the product, the number of 9's in the product increases, and when the number of 142857's is infinite, you get 1 as the product).
It really was as simple as that!

Let us now apply it to something a little more challenging, such as 1/13. Instead of writing out all the steps, I am just going to show you how we get the multiplier and the set of remainders. Note that 13 is more than 10, so our first remainder becomes 10, making our multiplier 10. Using this multiplier on successive remainders and casting out 13's gives us the following series of remainders:

10, 9, 12, 3, 4, 1

We now multiply each of these remainders by the sesanyanka of 13, which is 3. We get 076923 as our series of digits, telling us that 1/13 is 0.076923 . . . One can verify that this is indeed true.

Similarly, let us do 1/31. Once again, since 10 is less than 31, our first remainder and our multiplier become 10. This then leads to the following series of remainders:

10, 7, 8, 18, 25, 2, 20, 14, 16, 5, 19, 4, 9, 28, 1

The sesanyanka of 31 is 9, so we now have to multiply each of these remainders by the 9 and put down just the last digits. We get 032258064516129, telling us that 1/31 is 0.032258064516129 . . .

Now, there is another time-saving shortcut in the last step that you might have spotted if you were astute: Since the answer depends only on the last digit of the product of the remainders and the sesanyanka, we don't actually have to multiply the entire remainder by the sesanyanka to get the series of digits in the answer. Simply multiplying the last digit of each remainder by the sesanyanka, and then taking the last digit of that product will suffice for this exercise, thus obviating the need to perform multiplications such as 28x9, 19x9, etc. We only need to perform 8x9 or 9x9 instead to get the digits in the final answer!

We will now calculate 1/49 using this method. The first remainder is 10 since 10 is smaller than 49. Thus our multiplier is also 10. This gives us the following series of remainders:

10, 2, 20, 4, 40, 8, 31, 16, 13, 32, 26, 15, 3, 30, 6, 11, 12, 22, 24, 44, 48, 39, 47, 29, 45, 9, 41, 18, 33, 36, 17, 23, 34, 46, 19, 43, 38, 37, 27, 25, 5, 1

Yes, it is a long series, but if you were to try to find 1/49 using long division, you would probably run out of room on the paper, whereas with this method, the entire series can be worked out mentally with no risk of running out of paper or sanity! The sesanyanka of 49 is 1, so the actual decimal representation of 1/49 is obtained by simply multiplying the last digit of each remainder by 1 and writing them down in order. Technically, we multiply by 1, but we all know that what this involves is simply taking the last digits of the remainders and putting them down in order! Thus 1/49 = 0.020408163265306122448979591836734693877551. . .

It is difficult to verify the last few digits of the answer since very few calculators have enough precision to handle and/or display this many digits, but if you are brave enough, you can do the long division to verify the answer!

Given that we started our vedic mathematics lessons by finding reciprocals of numbers that end in 9, we have come full circle, and found the reciprocal of a number ending in 9 once again. We used a different technique this time, but what we did in the very first lesson is a direct extension of this method, that does not involve finding the remainders and then deriving the digits of the decimal representation from them. We are going to continue in the next lessons by expanding on this methodology to extend it beyond merely reciprocals. Along the way, we will take a look once more at reciprocals of numbers that end in 9.

I know that some of the material covered in this lesson is going to appear confusing. I have tried making the explanations as detailed as possible, but detail and simplicity lie in the eyes of the beholder. With practice comes an ease that makes everything look obvious, making explanations appear unnecessary, but for a beginner, it is not obvious, and a more detailed explanation would have been more welcome. I understand this, and am welcome to any suggestions for making the material more elaborate with more detailed explanations. Just let me know through the comments if something is not clear and needs more elaboration, or better examples. In the meantime, good luck, and happy computing!

Monday, April 19, 2010

Microsoft Access Tips & Tricks: Great Circle Initial Heading

In the previous post, we saw how to calculate the great circle distance between two points on the earth based on their latitudes and longitudes. Another important property of the great circle route between two points is the initial heading of such a route. In this post, we will explore a couple of different formulae for calculating the great circle initial heading, and how to implement them in Access VBA.

If you are interested, you can find my earlier posts on finding the median, the mode, the geometric and harmonic means, ranking every row in a query, selecting random rows out of a table, calculating running sums and averages, calculating running differences, creating histograms, calculating probability masses out of given data, calculating cumulative distributions out of given data, finding percentile scores, percentile values, calculating distinct counts, full outer joins, parameter queries, crosstab queries, working with system objects, listing table fields, finding unmatched rows, calculating statistics with grouping, job-candidate matching, job-candidate matching with skill levels, and great circle distances.

As in the previous post, let us establish some conventions first. The great circle initial heading can be some angle between 0 and 360 degrees (0 and 2π radians). A heading of 0 degrees signifies a heading due north. We then move clockwise, getting a heading of 90 degrees for due east, 180 degrees for due south, 270 degrees for due west and 360 degrees for due north. Thus due north can be represented by both 0 degrees and 360 degrees. The corresponding angles in radians are 0 and 2π radians for north, π/2 radians for east, π radians for south, and 3π/2 radians for west.

Also note that the initial heading from the north pole is always towards the south, and hence, 180 degrees (or π radians), and the initial heading from the south pole is always towards the north, and hence, 0 or 360 degrees (0 or 2π radians), regardless of the destination. That is because the great circle path from either pole always follows a line of longitude to the destination (if the destination is the other pole, then the great circle path can be any line of longitude, otherwise, the line of longitude for the great circle path is the longitude of the destination).

As in the previous post, assume that φs, λs; φf, λf are the coordinates (latitude, longitude) of the start point and final point respectively. Let Δλ be the difference in longitude between the start point and final point. Similarly, let Δσ be the angle subtended by the two points at the center of the sphere.

Let θ represent the great circle initial heading of the great circle path between the two points. There are two formulae that are commonly used to find θ. The first of these formulae can be used when Δσ is known, or has already been calculated (note that this is often the case because the great circle initial heading is often calculated in conjunction with the great circle distance, and the calculation of the great circle distance requires the calculation of the central angle between the two points). This formula is given below:

If sin(Δλ) < 0
θ = arccos((sin(φf) - sin(φs)*cos(Δσ))/(sin(Δσ)*cos(φs)))

Otherwise,
θ = 2π - arccos((sin(φf) - sin(φs)*cos(Δσ))/(sin(Δσ)*cos(φs)))

We will refer to the above formula as the ArcCosine formula for great circle initial heading.

The second formula assumes that the central angle, Δσ, is not known. So, this formula can be used when we want to calculate the great circle initial heading without going to the trouble of calculating the great circle distance at the same time or beforehand. This formula is presented below:

θ = mod(arctan((sin(λf - λs)*cos(φf))/(cos(φs)*sin(φf) - sin(φs)*cos(φf)*cos(λf - λs))), 2π)

We will refer to the above formula as the ArcTangent formula for great circle initial heading. Notice that we use the mod() function in the above formula. Mod(y,x) is the remainder obtained by dividing y by x, and always lies in the range 0 <= mod(y,x) < x. For instance: mod(2.3,2) = 0.3, and mod(-2.3,2) = 1.7.

We will assume that our database already contains the code from the previous post for ArcCos(), HaversineDistance(), etc. We will call those functions in our code below, but I will not repeat the code for them in this post. Note that in the VBA that follows, I have used the Haversine formula to calculate the central angle between the points on the sphere for the ArcCosine formula, but you can use any of the three distance formulae in the previous post depending on your personal preference.

Also, in the VBA presented in this post, the great circle initial heading will be calculated in radians. To convert it into degrees if needed, you have to multiply the calculated number by 180/π.

The function implementing the ArcCosine formula is presented below:

Note that the great circle distance between the two points is calculated by using the Haversine formula for great circle distances, and the answer is then divided by the radius of the earth to get the central angle for use with the ArcCosine formula. The cases of the source being the north pole or south pole are dealt with separately since they require no calculations.
Function ArcCosineHeading(SourceLatDeg As Double, _
SourceLatMin As Double, SourceLatSec As Double, _
SourceLongDeg As Double, SourceLongMin As Double, _
SourceLongSec As Double, DestLatDeg As Double, _
DestLatMin As Double, DestLatSec As Double, _
DestLongDeg As Double, DestLongMin As Double, _
DestLongSec As Double) As Double

Const Pi As Double = 3.14159265358979
Const EarthRadiusKM As Double = 6371.01 'Kilometers
Const Epsilon As Double = 0.000000000000001

Dim SourceLatRad As Double
Dim SourceLongRad As Double
Dim DestLatRad As Double
Dim DestLongRad As Double
Dim DeltaLongRad As Double
Dim CentralAngle As Double

SourceLatRad = DegToRad(SourceLatDeg, SourceLatMin, SourceLatSec)
SourceLongRad = DegToRad(SourceLongDeg, SourceLongMin, SourceLongSec)
DestLatRad = DegToRad(DestLatDeg, DestLatMin, DestLatSec)
DestLongRad = DegToRad(DestLongDeg, DestLongMin, DestLongSec)

DeltaLongRad = Abs(SourceLongRad - DestLongRad)

If SourceLatRad = Pi / 2# Then 'If the source is the north pole
ArcCosineHeading = Pi
ElseIf SourceLatRad = -1 * Pi / 2# Then 'If the source is the south pole
ArcCosineHeading = 0
Else
DeltaLongRad = Abs(SourceLongRad - DestLongRad)
CentralAngle = HaversineDistance(SourceLatDeg, SourceLatMin, SourceLatSec,_
SourceLongDeg, SourceLongMin, SourceLongSec, _
DestLatDeg, DestLatMin, DestLatSec, _
DestLongDeg, DestLongMin, DestLongSec)
CentralAngle = CentralAngle / EarthRadiusKM
If CentralAngle <= Epsilon Then 'the two points are the same
ArcCosineHeading = 0
Else
ArcCosineHeading = Sin(DestLatRad) - Sin(SourceLatRad) * Cos(CentralAngle)
ArcCosineHeading = ArcCosineHeading / (Sin(CentralAngle) * Cos(SourceLatRad))
ArcCosineHeading = ArcCos(ArcCosineHeading)

If Sin(DeltaLongRad) >= 0 Then
ArcCosineHeading = 2 * Pi - ArcCosineHeading
End If
End If
End If
End Function
Note that the calculation of the central angle relies on the great circle distance being calculated in kilometers. If a different unit is used, the radius of the earth in that unit should be used in the division to derive the central angle, otherwise large errors could result!

Since the calculation involves a division, we have to make sure that we don't divide by zero accidentally during run-time. The denominator consists of cos(φs) which is already taken care of, because this quantity becomes zero only when the source is one of the poles. The other quantity in the denominator is sin(Δσ), which can become zero only when the central angle between the two points is zero. This can happen only when the two points are one and the same, so we detect this occurence (by comparing the central angle against a very small quantity) and assign an initial heading of 0 if the central angle is smaller than that infinitesimal quantity.

Now, the implementation of the ArcTangent formula is given below:
Function ArcTangentHeading(SourceLatDeg As Double, _
SourceLatMin As Double, SourceLatSec As Double, _
SourceLongDeg As Double, SourceLongMin As Double, _
SourceLongSec As Double, DestLatDeg As Double, _
DestLatMin As Double, DestLatSec As Double, _
DestLongDeg As Double, DestLongMin As Double, _
DestLongSec As Double) As Double

Const Pi As Double = 3.14159265358979
Const Epsilon As Double = 0.000000000000001

Dim SourceLatRad As Double
Dim SourceLongRad As Double
Dim DestLatRad As Double
Dim DestLongRad As Double
Dim DeltaLongRad As Double
Dim CentralAngle As Double
Dim Denominator As Double
Dim Numerator As Double

SourceLatRad = DegToRad(SourceLatDeg, SourceLatMin, SourceLatSec)
SourceLongRad = DegToRad(SourceLongDeg, SourceLongMin, SourceLongSec)
DestLatRad = DegToRad(DestLatDeg, DestLatMin, DestLatSec)
DestLongRad = DegToRad(DestLongDeg, DestLongMin, DestLongSec)

If SourceLatRad = Pi / 2# Then 'If the source is the north pole
ArcTangentHeading = Pi
ElseIf SourceLatRad = -1 * Pi / 2# Then 'If the source is the south pole
ArcTangentHeading = 0
Else
Denominator = Cos(DestLatRad) * Sin(DestLatRad)
Denominator = Denominator - _
Sin(SourceLatRad) * Cos(DestLatRad) * Cos(DestLongRad - SourceLongRad)
If Denominator <= Epsilon Then
ArcTangentHeading = Pi / 2#
Else
Numerator = Sin(DestLongRad - SourceLongRad) * Cos(DestLatRad)
ArcTangentHeading = Numerator / Denominator
ArcTangentHeading = Atn(ArcTangentHeading)
If ArcTangentHeading < 0 Then
ArcTangentHeading = ArcTangentHeading + 2# * Pi
End If
End If
End If
End Function
Note that Microsoft Access's implementation of the Mod operator rounds floating point numbers to integers. So, instead of using the mod operator, we take advantage of the fact that the Atn() function always returns a value between -π/2 and +π/2. Thus, if the return value from the Atn() function is less than zero, we simply add 2π to the result to simulate the modulus operation with 2π!

Also note that we have calculated the denominator in the formula separately. If it turns out to be zero, we know that the arctangent of the final resulting quantity will be π/2 (since the arctangent of ∞ is π/2). So, we set the initial heading to that value instead of going through with the calculation and risking a division by zero during run-time.

The code above (both functions) has been checked in Access 2003. It should work in any version of Access from Access 97 on up, but please do let me know through the comments if you have problems using the code.

Hope this post has been helpful in solving any problems you might have had with great circle initial heading calculations in Access. If you have any problems or concerns with the VBA code in this lesson, please feel free to let me know by posting a comment. If you have other questions on Access that you would like me to address in future lessons, please feel free to let me know through your comments too. Good luck!

Sunday, April 18, 2010

The Yardwork Season Begins This Week!

Yes, snow-shoveling season is over, and now it is the season for yardwork. It has been getting warmer and sunnier with periods of rain during the past few weeks. What this means is that the grass in my yard has spurted into a new season of growth. And along with the grass come lots of weeds.

This weekend I mowed my lawn for the first time this year. I saw several places where weeds of different types (including clover) were growing in patches. I will probably have to get the weed-killer out next week, and go over my lawn with it to begin the season off right.

Otherwise, the week was mostly uneventful. My work also kept me reasonably busy with meetings to attend, presentations to prepare, spreadsheets to put together, etc. I guess I should not begrudge a little activity on the work front because that is what I get paid for anyways! I also continued doing some research on vacation plans.

I have been watching the closure of several European airports over the past week because of the eruption of the volcano in Iceland. What a mess! Luckily, I was not on vacation in Europe when this happened. I can only imagine what people must be going through, stranded in expensive places with hotels and extra meals to pay for while their travel plans are thrown into chaos. It would be a vacation to remember, for sure!

I donated blood yesterday. I do it regularly every 2 or 3 months. Not only is it good for people who need the blood, I also get to know things about my state of health like my cholesterol level, iron level and things like that. This last time, my blood pressure was surprisingly low (100/60, as opposed to a usual level of between 110 and 130 over 60 and 80). My pulse was also only 54. The nurse doing the screening asked me if I did vigorous aerobic exercise on a regular basis. And then it dawned on me that these could be the effects of the interval training I have been doing for the past several months. I guess the thing really does work!

If you remember the story "The Unlikely Hero" I published in my blog before, I got some good news about that story this week. As I mentioned in that post, the story was written by my daughter for a story competition. She actually won one of the third place prizes in that competition according to the website of the sponsoring organization. They published the names of 2 first-place winners, 2 second-place winners and 2 third-place winners. They never sent us an email or any other notification about the win, so I have no idea even when the competition was judged, and when the prize-winners were announced.

For now though, the only prize my daughter has won is seeing her name on the website. No mention of any physical prizes of any sort. But I hope this win gives her enough confidence to write more. When she write, she writes really imaginative stories in flowery language far above her grade level. But she gets very little time to write, so a little external encouragement like this is always welcome.

My blogging proceeded with not much change from the week before. On Monday, I published a post on finding great circle distances in Access. On Tuesday, I published a post on what PCWorld felt were GUI features that Apple stole from Windows. On Wednesday I completed my series of Vedic Mathematics posts on finding square roots. On Thursday, I published a funny essay written by Mark Twain about ants. I laughed hard enough reading it that I had to stop and wait for my eyes to stop watering to continue reading!

While reading some news on the internet on Friday, I came across a comment on a news story that was breathtaking in its cluelessness! I simply had to let the world know about it. So, that became a post on Saturday, complete with screen-shots and what-not!

Once again, I got visitors from 4 countries to my blog this week. The countries were Guam, Netherlands Antilles, Belize and Bhutan. The most interesting flag of them was Bhutan's by far. A flag divided into two diagonally from top right to bottom left, with the two halves of different colors, and a complicated dragon/lion figure straddling the dividing line in the middle of the flag. Very interesting, as I said.

With these 4 flags, my flagcounter now sports flags from 126 different countries. I wonder what new flags will show up in the coming week! I never realized my flagcounter would be quite so entertaining to watch grow!

I guess that does it for this week's news from my side. I am hitting the stage in my blogging where I am in danger of things to write about. I really have to rack my brains to come up with something to present in the coming weeks. Maybe, I should take a break from this sometime to rethink my strategy better. Stay tuned to find out how it all goes . . .

Saturday, April 17, 2010

More Online Comment Hilarity!

I wrote earlier about a hilarious comment posted by someone in response to a news article on the internet. This is not a hilarious comment for its content, but for its total anc complete cluelessness! In any case, this was a news article about the crash of a small crop-dusting plane in Russia. The original article can be found here. The text of the article is below:

------
Pilot asks tractor driver for directions, crashes

MOSCOW – A Russian news report says a small plane has crashed when the pilot lost his bearings and decided to ask a tractor driver for directions. No one was hurt. RIA-Novosti news agency quoted a local police spokesman as saying the accident happened Friday in southern Russia's Stavropol region.

It said the pilot lost his way, saw a tractor below and decided to land to get advice from the driver.

Oleg Ugnivenko, a spokesman for the regional branch of Russia's Emergency Situations Ministry, said the An-2 agricultural plane grazed the tractor while landing in the field and broke its landing gear. He said no one was hurt but gave no further details.
-----

For some reason, a commenter named Shelly decided to post the following comment about the article. It is obvious that he/she had not read anything except the headline of the story, or had such bad comprehension skills that he/she did not understand a single word of the story. Anyways, here is the comment he/she posted:

-----
This pilot wasn't professionally trained, if that is correct up there. Stopping to ask for directions from a tractor driver, never heard of anything like it in my life!

Did those that went on this flight, know they were going with someone imcompetant to do this? I think not!

How did this happen, that they had all these important people on the plane and the pilot was inexperienced for traveling and didn't know how to do it, obviously. Who did the pilot work for, who employed him in doing this job, they need to be questioned about the safety of all the passengers, it's a shame it all comes down to this guy wasn't qualified to fly over there, didn't know what he was doing, I can hardly believe this myself.

I feel so bad for the country and people , find out who's to blame for this and charge them with murder of all these people!
-----

As can be imagined, several people posted replies to her message, and none of the replies were very complementary! Most of them would not pass muster in polite conversation!! Anyways, I have attached a screen-shot of the news article with Shelly's comment below it for your enjoyment.


The other interesting thing I noticed is that the news article says "2 hrs 14 mins ago", but the comment header says it was posted "4 hours ago". I have no idea how that happened. But that would explain why the comment appears so brainless: perhaps it was posted before the article had been written, explaining why it was so out of context!

Thursday, April 15, 2010

Hilarious Mark Twain Essay On Ants

The following essay by Mark Twain is excerpted from Mark Twain's book, "A Tramp Abroad". I laughed so much reading this that I had to stop half-way through, and wait for the tears to stop flowing from my eyes so that I could focus on the words to continue reading! It is classic Mark Twain, who has always been one of my favorite authors. Enjoy!

Wikipedia describes "A Tramp Abroad" as follows:

A Tramp Abroad is a work of non-fiction travel literature by American author Mark Twain, published in 1880. The book details a journey by the author, with his friend Harris (a character created for the book, and based on his closest friend, Joseph Twichell), through central and southern Europe. While the stated goal of the journey is to walk most of the way, the men find themselves using other forms of transport as they traverse the continent. The book is often thought to be an unofficial sequel to an earlier Twain travel book, The Innocents Abroad.

As the two men make their way through Germany, the Alps, and Italy, they encounter situations made all the more humorous by their reactions to them. The narrator (Twain) plays the part of the American tourist of the time, believing that he understands all that he sees, but in reality understanding none of it.

The Laborious Ant

Now and then, while we rested, we watched the laborious ant at his work. I found nothing new in him - certainly nothing to change my opinion of him. It seems to me that in the matter of intellect the ant must be a strangely overrated bird. During the many summers, now, I have watched him, when I ought to have been in better business, and I have not yet come across a living ant that seemed to have any more sense than a dead one. I refer to the ordinary ant, of course; I have no experience of those wonderful Swiss and African ones which vote, keep drilled armies, hold slaves, and dispute about religion. Those particular ants may be all that the naturalist paints them, but I am persuaded that the average ant is a sham.

I admit his industry, of course; he is the hardest working creature in the world,--when anybody is looking,--but his leather-headedness is the point I make against him. He goes out foraging, he makes a capture, and then what does he do? Go home? No,--he goes anywhere but home. He doesn't know where home is. His home may be only three feet away,--no matter, he can't find it.

He makes his capture, as I have said; it is generally something which can be of no sort of use to himself or anybody else; it is usually seven times bigger than it ought to be; he hunts out the awkwardest place to take hold of it; he lifts it bodily up in the air by main force, and starts; not toward home, but in the opposite direction; not calmly and wisely, but with a frantic haste which is wasteful of his strength; he fetches up against a pebble, and instead of going around it, he climbs over it backwards dragging his booty after him, tumbles down on the other side, jumps up in a passion, kicks the dust off his clothes, moistens his hands, grabs his property viciously, yanks it this way then that, shoves it ahead of him a moment, turns tail and lugs it after him another moment, gets madder and madder, then presently hoists in into the air and goes tearing away in an entirely new direction; comes to a weed; it never occurs to him to go around it; no, he must climb it; and he does climb it, dragging his worthless property to the top--which is as bright a thing to do as it would be for me to carry a sack of flour from Heidelberg to Paris by way of Strasburg steeple, when he gets up there he finds that that is not the place; takes a cursory glance at the scenery and either climbs down again or tumbles down, and starts off once more--as usual, in a new direction.

At the end of half an hour, he fetches up within six inches of the place he started from and lays his burden down; meantime he has been over all the ground for two yards around, and climbed all the weeds and pebbles he came across. Now he wipes the sweat from his brow, strokes his limbs, and then marches aimlessly off, in as violent a hurry as ever. He traverses a good deal of zig-zag country, and by and by stumbles on this same booty again. He does not remember to have ever seen it before; he looks around to see which is not the way home, grabs his bundle and starts; he goes through the same adventures he had before; finally stops to rest, and a friend comes along.

Evidently the friend remarks that a last year's grasshopper leg is a very noble acquisition, and inquires where he got it. Evidently the proprietor does not remember exactly where he did get it, but thinks he got it "around here somewhere." Evidently the friend contracts to help him freight it home. Then, with a judgment peculiarly antic, (pun not intentional) they take hold of opposite ends of that grasshopper leg and begin to tug with all their might in opposite directions. Presently they take a rest and confer together. They decide that something is wrong, they can't make out what. Then they go at it again, just as before. Same result. Mutual recriminations follow. Evidently each accuses the other of being an obstructionist. They warm up, and the dispute ends in a fight. They lock themselves together and chew each other's jaws for a while; then they roll and tumble on the ground till one loses a horn or a leg and has to haul off for repairs.

They make up and go to work again in the same old insane way, but the crippled ant is at a disadvantage; tug as he may, the other one drags off the booty and him at the end of it. Instead of giving up, he hangs on, and gets his shins bruised against every obstruction that comes in the way. By and by, when that grasshopper leg has been dragged all over the same old ground once more, it is finally dumped at about the spot where it originally lay, the two perspiring ants inspect it thoughtfully and decide that dried grasshopper legs are a poor sort of property after all, and then each starts off in a different direction to see if he can't find an old nail or something else that is heavy enough to afford entertainment and at the same time valueless enough to make an ant want to own it.

There in the Black Forest, on the mountain side, I saw an ant go through with such a performance as this with a dead spider of fully ten times his own weight. The spider was not quite dead, but too far gone to resist. He had a round body the size of a pea. The little ant--observing that I was noticing--turned him on his back, sunk his fangs into his throat, lifted him into the air and started vigorously off with him, stumbling over little pebbles, stepping on the spider's legs and tripping himself up, dragging him backwards, shoving him bodily ahead, dragging him backwards, shoving him bodily ahead, dragging him up stones six inches high instead of going around them, climbing weeds twenty times his own height and jumping from their summits,--and finally leaving him in the middle of the road to be confiscated by any other fool of an ant that wanted him. I measured the ground which this ass traversed, and arrived at the conclusion that what he had accomplished inside of twenty minutes would constitute some such job as this,--relatively speaking,--for a man; to-wit: to strap two eight-hundred pound horses together,carry then eighteen hundred feet, mainly over (not around) bowlders averaging six feet high, and in the course of the journey climb up and jump from the top of one precipice like Niagara, and three steeples, each a hundred and twenty feet high; and then put the horses down, in an exposed place, without anybody to watch them, and go off to indulge in some other idiotic miracle for vanity's sake.

Science has recently discovered that the ant does not lay up anything for winter use. This will knock him out of literature, to some extent. He does not work, except when people are looking, and only then when the observer has a green, naturalistic look, and seems to be taking notes. This amounts to deception, and will injure him for the Sunday schools. He has not judgment enough to know what is good to eat from what isn't. This amounts to ignorance, and will impair the world's respect for him. He cannot stroll around a stump and find his way home again. This amounts to idiocy, and once the damaging fact is established, thoughtful people will cease to look up to him, the sentimental will cease to fondle him. His vaunted industry is but a vanity and of no effect, since he never gets home with anything he starts with. This disposes of the last remnant of his reputation and wholly destroys his main usefulness as a moral agent, since it will make the sluggard hesitate to go to him any more. It is strange beyond comprehension, that so manifest a humbug as the ant has been able to fool so many nations and keep it up so many ages without being found out.

Wednesday, April 14, 2010

Vedic Mathematics Lesson 48: Square Roots 3

In this earlier lesson, we introduced the Vedic Duplex method for finding square roots and solved several problems using the method. We also saw that some problems might create complications for the method. These complications were dealt with in the previous lesson. In this lesson, we will tackle the problem of how to find square roots of numbers that are not perfect squares. Along the way will also tackle the square roots of non-whole numbers.

You can find all my previous posts about Vedic Mathematics below:

Introduction to Vedic Mathematics
A Spectacular Illustration of Vedic Mathematics
10's Complements
Multiplication Part 1
Multiplication Part 2
Multiplication Part 3
Multiplication Part 4
Multiplication Part 5
Multiplication Special Case 1
Multiplication Special Case 2
Multiplication Special Case 3
Vertically And Crosswise I
Vertically And Crosswise II
Squaring, Cubing, Etc.
Subtraction
Division By The Nikhilam Method I
Division By The Nikhilam Method II
Division By The Nikhilam Method III
Division By The Paravartya Method
Digital Roots
Straight Division I
Straight Division II
Vinculums
Divisibility Rules
Simple Osculation
Multiplex Osculation
Solving Equations 1
Solving Equations 2
Solving Equations 3
Solving Equations 4
Mergers 1
Mergers 2
Mergers 3
Multiple Mergers
Complex Mergers
Simultaneous Equations 1
Simultaneous Equations 2
Quadratic Equations 1
Quadratic Equations 2
Quadratic Equations 3
Quadratic Equations 4
Cubic Equations
Quartic Equations
Polynomial Division 1
Polynomial Division 2
Polynomial Division 3
Square Roots 1
Square Roots 2

Before we address the issue of finding square roots of numbers that are not perfect squares, we need to deal with another aspect of the Vedic Duplex method that we have not dealt with before. In this earlier lesson, we mentioned the general rule for splitting the square into parts such that the part before the ":" was either 1 digit long or 2 digits long, depending on whether the square had an odd number of digits or even number of digits.

In reality, the duplex method gives one a lot of flexibility in terms of how the given square is split into two parts. There are some rules we have to follow to make sure we get the right square roots though. First right the given square following the rules below:
  • If the number is a whole number, then remove the decimal point and any zeroes there may be after it. Also remove any zeroes before the number (what would be considered meaningless zeroes that don't make any difference to the value of the number)
  • If the number is not a whole number (that is, it has a decimal part), then remove any zeroes before the number (meaningless zeroes that don't make any difference to the value of the number). Add a zero if necessary to end of the number, after the decimal point, so that the number of digits after the decimal point is an even number
What do these rules mean? They mean that before we start applying the duplex method, we need to rewrite:
  • 04857 as 4857 (remove meaningless zeroes before the number)
  • 45.2 as 45.20 (add a zero if necessary to make the number of digits after the decimal point even)
  • 0.013 as .0130 (combination of both of the above rules)
Notice that in the previous lessons, we only dealt with whole numbers with no fractional part or zeroes in front of the number, so we were following these rules even though we did not know about them!

Once the number is written according to the rules above, we need to follow the rules below to split the number into two parts with the ":".
  • The number of digits before the ":" has to be at least one. The number before the ":" can not be entirely made of zeroes
  • If the ":" is placed in the whole portion of a number with both whole and fractional parts, then the number of digits of the whole part after the ":" has to be even (it can be zero, since zero is a valid even number, so you can replace the decimal point with a ":")
  • If the ":" is placed in the fractional portion of a number, then there should be an even number of digits after the ":" (once again, there could be zero digits after the ":")
Following the above rules, we can place the ":" as below in the given numbers:
  • 40 - 40:
  • 240 - 2:40 or 240:
  • 348.4875 - 3:484875, 348:4875, 34848:75, 3484875:
  • 0.10 - 10:
Given these rules, let us now consider the calculation of the square root of 35988001. But instead of putting just 2 digits before the ":", let us take advantage of the rules above, and leave 4 digits after the ":". This gives us the initial figure below:

••|3598: 8 0 0 1
10| :
•G| :
•N| :
-----------------------
••| :
This is perfectly legal since there are an even number of digits (4) after the ":". We also know that 60^2 is 3600, so the highest number whose square is less than the part of the square to the left of the ":" (3598) must be 59. So, we put down 59, and it square in the appropriate places in the figure. We also set 2*59 = 118 as our divisor, and 3598 - 3481 = 117 as our remainder as below:


•••|3598: 8 0 0 1
118|3481:117
••G| :
••N| :
--------------------------
•••| 59:
This then gives us a gross dividend and net dividend of 1178. The rest of the method proceeds exactly as before. The main difference is that our divisor is much larger, but that may actually be an advantage since we are less likely to encounter the case where the quotient goes over 9. The other important difference is that the number of digits on the answer line to the right of the ":" goes down by at least one, so the duplex calculations are not only likely to be less complicated, but also result in smaller duplexes such that it is unlikely for the net dividend to become negative. And last but not least, because there are fewer digits to the right of the ":" in the square, there are going to be fewer divisions overall (even though each division may be a little more complicated because of the higher divisor.

Thus, a small change in the way we split up the given square into two parts is likely to have very positive impacts on the probability of encountering the complications we spent the previous lesson addressing. The main problem, of course, is the difficulty that comes with division by a larger divisor! And it may also reduce the complexity of the overall calculation by reducing the number of divisions performed.

Proceeding with the method, and completing the figure we started above, we now get the following figure:

•••|3598: 8 0 0 1
118|3481:117 116 017 008
••G| :1178116001700081
••N| :1178107900080000
--------------------------
•••| 59: 9 9 0 0
We once again get 599900 on the answer line. Note that we did not have to limit the quotient to 9 in any step of the above process or have to reduce the quotient and increase the remainder to prevent the net dividend from becoming negative. Knowing that the square consists of 8 digits before the decimal point, we set aside 4 digits of the answer line before the decimal point, giving us a final answer of 5999.00.

Similarly, consider the calculation of the square root of 413024329. Our normal method would have us set aside the given square as 4:13024329, but we could just as easily restructure it as 413:024329 (6 digits after the ":", which is legal since 6 is an even number) or 41302:4329 (4 digits after the ":") or even 4130243:29 or 413024329:. The last 2 are almost pointless since we would spend a lot of time hunting for the highest perfect square below 4130243 or finding the square root of the given square entirely by trial and error.

However, we notice that 20^2 = 400 is a little below 413. Thus the structuring of the given square into 413:024329 is likely to give us some advantages. Below are two figures, with the first one representing our original way of finding the square root, and the second one showing how it is done by having a larger chunk of the square to the left of the ":".

•|4: 1 3 0 2 4 3 2 9
4|4:0 1 1 2 1 2 1 0
G| :0113102214231209
N| :0113101302010000
-----------------------
•|2: 0 3 2 3 0 0 0 0

••|413: 0 2 4 3 2 9
40|400:13 10 13 02 01 00
•G| :130102134023012009
•N| :130093122001000000
--------------------------
••| 20: 3 2 3 0 0 0
Either way we get an answer line in which the first 5 digits (which is what our square root should contain before the decimal point given that the square contains 9 digits) are 20323, and the rest of the digits are zeroes. Thus our answer is 20323, regardless of whether we choose to leave 8 digits or 6 digits of the given square behind the ":".

Notice that the rules we established at the beginning of this lesson also allow us to find square roots of non-whole numbers (expressed in the form of decimals) without any problem. To illustrate, let us find the square root of 0.18671041. Following the first set of rules, we rewrite the given number as .18671041 after removing the meaningless zero before the decimal point. We are now free to form the figure with 18 before the ":", 1867 before the ":", 186710 before the ":" or the entire number, 18671041, before the ":".

Based on the ease with which we can find square roots that are below the numbers to the left of the ":", we will go with 18 before the ":" since 4^2 = 16 is well-known and easy to calculate mentally. The resulting figure is shown below:

•|18: 6 7 1 0 4 1
8|16:02 02 02 01 00 00
G| :026027021010004001
N| :026018009000000000
--------------------------
•| 4: 3 2 1 0 0 0
Our answer line now reads 4321000. How do we determine the true square root from this answer line? In the case of numbers that have a whole part in addition to any fractional part (there are valid numbers before the decimal point in the square), we already know that the number of digits of the square root before the decimal point depends on the number of whole digits in the square as explained in this earlier lesson. But what should we do in the case of numbers with no whole part?

Then we use the following rules to determine where to place the decimal point in the answer line:
  • The square root of a purely fractional number can not contain a whole part. The square root is also entirely fractional
  • If the number of zeroes right after the decimal point in the square is even, the square root will have half that number of zeroes right after the decimal point. Add zeroes in front of the answer line to get the appropriate number of zeroes if necessary
  • If the number of zeroes right after the decimal point in the square is odd, subtract one from it, and then divide by 2 to get the number of zeroes after the decimal point in the square root. Once again, if necessary, add zeroes in front of the answer line to get the appropriate number of zeroes if necessary
Consider the square root of 0.18671041 as we calculated above. This is a purely fractional number, so our square root will have only a fractional part. Moreover, the number of zeroes right after the decimal point in the square is zero (which is an even number). So, we divide that by two and get the number of zeroes right after the decimal point in the square root to be zero also. This then tells us that the square root we are looking for is 0.4321.

Now consider the square root of 0.000961. First we discount the zero before the decimal point as a meaningless zero, and rewrite our number as .000961. We then see that we can not split the number as 00:0961 because the digits before the ":" can not all be zeroes. Thus, we can either split it as 0009:61 or 000961:. We will reject the last one as not very practical since we would then be trying to solve the problem by trial and error. We settle for 0009:61, and we get the figure below:

•|0009: 6 1
6|0009:0 0
G| :0601
N| :0600
--------------
•| 3: 1 0
We find that our answer line contains 310. Since our square is entirely fractional, our square root will be entirely fractional too. Moreover, since the square started with three zeroes after the decimal point, our square root has to start with one zero after the decimal point (we subtract one from three and divide the result by two). In this case, using the rules above, we arrive at a final answer of 0.031.

Now that we have the basics of the method established, let us see how we can apply this to the calculation of some square roots of numbers that are not exact squares. Before we go there though, we need to figure out how the duplex method signifies that the given square is a perfect square. That is, how do we know to stop the duplex method at some point? The simple answer is that we will run out of digits in the number at the same time as our net dividend becomes zero.

The primary indication that a number is not a perfect square comes when we find that the net dividend does not become zero at the same time as we run out of digits in the given square. When this happens, we have to continue with the procedure by adding 0's to the right of the number on the top line of the figure (the line containing the square). We then proceed with finding the gross dividend and net dividend as before.

Note that getting a remainder of 0 from the last division is not an indication that the algorithm has concluded. The algorithm ends only when a net dividend can be calculated, and it is zero, and there are no more digits in the square. Even if the remainder from a given step is zero, we still have to calculate the gross dividend and net dividend. If the net dividend is not zero at the end of this process, then the square root is not complete yet.

For numbers which are not perfect squares, the procedure will never end, but we can choose to end the process after calculating the square root to the required degree of precision. In this lesson, we will find the square root to a precision of 3 or 4 digits after the decimal point in most cases. Note that the process of finding duplexes becomes more and more complicated the higher the precision we need from the algorithm since the sequence of digits in the answer line becomes longer and longer.

We will illustrate the procedure with a few examples. First consider the square root of 2. The calculation of this famous irrational number is shown in the figure below:

•|2: 0 0 0 0 0 0 0 0 0 0
2|1:1 2 2 4 3 4 6 8 10 10
G| :1020204030406080100100
N| :1004120706121822014019
----------------------------
•|1: 4 1 4 2 1 3 5 6 2
We have stopped the algorithm with an answer line of 1414213562, and the net dividend has not become zero at any step in this algorithm. Several times during this algorithm, we have limited the quotient so that the net dividend does not become negative. And the duplex has steadily become larger, with the current duplex being 81. When you stop the algorithm, make sure that the net dividend you leave behind is not negative. That is why we made the last digit of the square root we have found so far, to be 2 rather than 7. A quotient of 7 would have resulted in a negative net dividend in the next step, thus telling us that it is not a valid digit for the square root. We had to reduce the quotient to 2 to get a positive net dividend for the next step, and this tells us that 2 is the right digit for the square root in that position.

Given that our square (2) has one digit before the decimal point, we conclude that the square root of 2 is 1.414213562 to a precision of 9 digits after the decimal point. In general, we will not calculate square roots to that level of precision, but this is an illustration of the fact that the method has no inherent limitation as to the precision with which we can calculate square roots. As long as we are willing to put up with the hassles of calculating duplexes of longer and longer numbers, we can keep going however far we want to!

By the way, the square of 1.414213562 is 1.999999998944727844, which is close enough to 2 for most practical purposes!

Let us now calculate the square root of 32987 to a precision of 3 digits after the decimal place. We make the decision to split the number up as 329:87 based on our knowledge that 18^2 = 324, which is quite close to 329. This results in the figure below:

••|329: 8 7 0 0 0
36|324:05 22 10 16 12
•G| :058227100160120
•N| :058226088120090
--------------------------
••| 18: 1 6 2 3
We get an answer line of 181623, and since we know that our square root has to have 3 digits before the decimal point, we conclude that the square root we are looking for is 181.623. The actual square root of 32987 is 181.62323639887050531602222963625, and our answer is accurate to the first three decimal places (which is the precision we set out to calculate the square root to). Also, 181.623^2 is 32986.914129, which is quite close to 32987.

Consider the square root of 0.1 now. To comply with the rules from earlier in the lesson, we rewrite the given square as .10. We then put the ":" at the end of the given number to get the figure below:

•|10: 0 0 0 0 0
6| 9:1 4 3 6 4
G| :1040306040
N| :1039182222
----------------
•| 3: 1 6 1 3
We have an answer line of 31613 now. Since our square does not have any digits before the decimal point, and does not have any zeroes immediately after the decimal point, our final answer is 0.31613.

Finally, consider the number 1.25. We can tackle the task of finding its square root by splitting it up as 1:25 or 125:. We know that 1^2 = 1, and 11^2 = 121, so either way of splitting up the number seems equally convenient. In general, when we have such a choice, it is better to take the choice that will result in a larger divisor since this will usually reduce the number of times we need to make adjustments to the quotient to prevent the net dividend from becoming negative. Therefore, we choose 125:, and the figure below shows how the square root is derived using that split-up of the given square:

••|125: 0 0 0 0 0
22|121:04 18 03 14 10
•G| :040180030140100
•N| :040179014076094
--------------------------
••| 11: 1 8 0 3
We now have 111803 on the answer line. Given that our square has one number in front of the decimal point, we conclude that the square root must be 1.11803.

Hopefully, this and the earlier lessons on square roots have made you confident about the Vedic Duplex method and all the details of how to apply the method. Hopefully the rules in this and the earlier lessons will help you to rewrite squares as appropriate, split them up correctly for the application of the duplex method, and also recover from complications you may face during the application of the method itself. Finally, I hope I have made it clear how to derive the final answer from the digits on the answer line. Good luck, and happy computing!

Visitors Country Map

Free counters!

Content From TheFreeDictionary.com

In the News

Article of the Day

This Day in History

Today's Birthday

Quote of the Day

Word of the Day

Match Up
Match each word in the left column with its synonym on the right. When finished, click Answer to see the results. Good luck!

 

Hangman

Spelling Bee
difficulty level:
score: -
please wait...
 
spell the word:

Search The Web