Search The Web

Today's Headlines

Saturday, October 31, 2009

Java Training Happens - Finally!

My department has always been a C shop since its very early days. Even our recruitment involves candidates taking a test of proficiency in C, but no other programming languages.

My department was also not very big on Object-Oriented programming. Most of us could write procedural code in C till the cows came home, but we were not comfortable working in true C++. There were some who came with a lot more object-oriented programming practice than others because of graduate school projects and so on, but our department did not really care whether you could do object-oriented programming or not.

If you started a brand-new project and could put together a team that was good at object-oriented programming, you were welcome to use C++ and OOP on the project. But, if you were enhancing an existing project written in C, or if your team had members who were not comfortable with C++, it was back to C for you too. C was kind of the lowest common denominator in the department when it came to programming projects.

The new project I was heading up was a little different from other projects that our department usually handled. This project would need, indeed, rely on, real-time data from the company's operations world-wide. The data architecture for getting us this real-time data had been a C-based in-memory cache that our IT department has decided does not meet their "standards" anymore.

They barely support this C-based data-layer and it has slowly become less and less useful over time. It contains only a small subset of the data that goes into our real-time databases. Even within this subset, if the data format of one of the fields changes in the system from which this cache pulls data, IT has decided it would be too much trouble to update this cache with the new data format. So, recently, when one of the fields in the database went from a 4-character string to a 5-character string, IT simply stopped passing the data on to this data cache.

So, the signals were clear: any project that relies on real-time data would not be able to rely on this C-based data cache going forward. After years of dithering over the replacement for it, the IT department finally decided that it would be moving to a Java-based object cache in the future. They have started a bunch of projects to build up bits and pieces of this cache (which would include an enterprise data bus that would keep the cache as well as all our sytems of record in sync).

Since my project would rely on this Java-based object cache for all its data input, it was decided that our team would get trained in Java and object-oriented programming. I was in charge of researching and coming up with the ideal Java course to send the team to. Now, I love projects like this: searching on the internet, comparing alternatives, coming up with spreadsheets comparing the alternatives, presenting them coherently to management along with recommendations, etc. So, I bit into it with gusto and came up with three alternatives that were equally good. A choice between them would come down to little more than personal preference.

As part of the research, I had gotten in touch with coordinators at each of these three training establishments and negotiated detailed rates for on-site as well as off-site training of the entire team. This was all done back in May and early June. I had dreams of actually getting the Java training delivered to the team by mid- or late July.

Bureaucracy disposes what man proposes, though. Since the training would involve more than $10,000 in expenses, the purchasing department of our company had to be involved to actually finalize the details. I had had previous experiences with our purchasing department, and I tried my best to find a loophole that would allow us to get this training arranged without purchasing being involved, but ultimately nothing worked.

I forwarded my email conversations with the three training establishments along with summaries of my phone conversations with them, to our purchasing department. I checked with my manager every couple of days, then every week, then every couple of weeks, but there was no apparent movement at purchasing whatsoever. I pretty much gave up on this and asked my manager to tell me whenever they came back.

Ostensibly, the reason purchasing wants to get involved in a big purchase is so that they can throw their weight around and negotiate lower prices for whatever our company was trying to get. So, I assumed that the long silence on the Java training was due to their intense negotiation with these three training organizations. Well, I was wrong. The representatives with whom I had had email exchanges at two of these training organizations kept sending me emails asking me what was going on. I told them our purchasing department would get in touch with them soon. But after a few weeks, I just told them it was out of our hands, and we could not proceed without somebody from purchasing being involved. They stopped bothering me after that. The third organization probably had enough business on hand, so they never bothered me to ask for progress reports.

So, what exactly was purchasing doing? I honestly have no idea. Ultimately, a month back, they triumphantly came back and presented our department with three options. Guess what, they were the exact same options I had presented to my manager back at the end of May! There were no price concessions, no course details that were altered, nothing. No changes from what I had negotiated single-handedly over the course of 2 weeks of email exchanges! Purchasing had sat on the process for 4 months and achieved exactly nothing!

Obviously, these were bureaucrats intent on taking bureaucracy to new heights! I was furious, but my manager was more realistic. He thanked purchasing profusely (as if they had practically invented the Java language and found us somebody to train us in this esoteric new art, all by themselves), and had them set up the dates for the training with one of the three organizations. One of our team-members had attended one of their training sessions a long time back and found it useful, so given that the monetary terms of the three proposals were roughly the same, we decided to go with the known devil rather than an unknown one.

The training was set up for the last week of October with Hands-on Technology Transfer (HOTT). In the week before the training, I got in touch with the trainer and discussed our requirements in detail. In particular, I told him that he would be training a bunch of C programming experts, not programming newbies. We would be using the language to do hard-core mathematical programming, but no database access or GUI development. However, many would have no idea about object-orientation, encapsulation, and other such concepts.

Based on these discussions, he came up with a 4-day course that was satisfactory to me, my manager and the entire team. It was going to be on-site training, so I made arrangements to book a suitable classroom, arrange for a projector, and do other preparatory stuff.

One of the things I was tasked with was making sure that everyone on the team had their laptop set up to undergo training. Our IT department used a customized version of the Eclipse IDE to develop Java in, so that part was relatively easy. But getting the Java compiler and other stuff on the laptops was anything but.

The Sun Java website is a poster-child for how not to design a website. Everything is jargon and acronyms with no explanation as to what exactly one needs. What a mess! There is Java SE, Java ME, Java EE and JavaFX. Then there is glassfish, the SDK, the JDK, the JRE and a million other TLA's (three-letter acronyms). Where do these people learn web design? And then they have the audacity to complain that people are using C# and other alternatives instead of Java! I truly hope Oracle does take Sun over and tears this website to shreds and puts something up that is a little more meaningful to non-experts. And I hope they fire the sorry lot of web designers who put this site up, and bring in their own talent to put something a little more intelligible, together.

After some guessing and checking with our IT department, I did manage to get all the laptops all set up with the right software. The training went off pretty well last week and everyone in the department now feels capable of coding in object-oriented Java (though obviously nobody feels 100% comfortable in it yet). The instructor was a bit of a rambler who tended t0 go off on wild tangents at the drop of a hat. He never stuck to the lesson plan and tended to pull in material from advanced chapters into the early chapters, confusing quite a few people. Ultimately, he managed to get through all the material, but left everyone with nagging doubts about what had not been covered.

He tended to wander off into philosophical discussions in the middle of technical discussions and some of these discussions turned out to be more confusing than enlightening. He was also a trainer in several languages, so sometimes he would get stuff mixed up between languages, adding to the confusion.

He also had this "technique" of getting everyone back into the class from breaks on time, which consisted of giving the class some tech tips right at the end of the break that they would miss if they weren't back on time. Problem was that either the tips were lame, or there was so much discussion about them that we wasted more time at the end of breaks than we would have if he had just started his teaching about 5 minutes after the end of each break! Some students deliberately returned late from breaks just to miss his "bonus insights"! Towards the end of the 3rd day, even he was returning late from breaks and then sharing his bonuses with us, so this entire "bonus insight" concept became not only meaningless, but a big drag on our punctuality and productivity.

I think enough people felt uneasy about the training that they emailed or spoke to my manager about what was going on. He then sent me an email wondering what was going on in the class, and asking me to confront the instructor about his progress and that of his students. I had to take on the uncomfortable task of checking with him about progress, and what he intended to cover over what time-period, and report back to my manager that things were still on track.

To my great relief, we were finally done with the training on Thursday. I now know enough Java to be dangerous! I now have to practice it so that I know what I am doing before I apply it on some real project that will require maintenance 5 years from now. New programmers tend to get carried away in the new features of a language and produce code that is a nightmare to maintain. I know from personal experience, having inherited such code from others.

After all the fluff is blown away, good, maintainable code comes down to if-then-else blocks that are easy to understand, and loops that are easy to understand. More importantly, it comes down to using easy-to-debug data structures like arrays and lists. Yes, trees are very nice in theory, but anyone who uses trees in a real project (rather than an academic one) deserves all the abuse that maintainers down the line will heap on him!

My task is now to supervise a whole team of new Java programmers and beat enough sense into them early on so that they stick to the tried and true programming techniques instead of experimenting with esoteric concepts that make the code impossible to maintain down the road. They are obviously free to experiment all they want on personal projects if they want, but I want them to forget all the esoteric features of the language and stick to the basics when it comes to work projects. Let us see how this cat-herding works out!

Tuesday, October 27, 2009

What Would We Do Without Newspapers To Entertain Us?!!

Newspapers are capable of providing as much entertainment as the internet. One only has to look closer and take the time to pick out the diamonds in the rough!

First, we will take a look at the crazy stuff people do that gets reported in the newspapers!









And then there is perfectly innocent stuff turned into entertainment by writers and reporters themselves!














And last, but not least, let us not forget the stuff that people pay good money to get printed in newspapers!













Saturday, October 24, 2009

Roundup Of Interesting News For 24 October, 2009

Before we dig into the interesting news for the day, I want to remind everyone that today in United Nations Day. Happy UN day to everyone!

I hope you find the new format of these roundups interesting and useful. Each headline is a link to the original source of the news. My comments follow each of the headlines. If you like my views, and my take on the news, please let me know in the comments. If you don't, you can let me know about that too!

Pilot who overshot airport denies crew was napping
So, the first officer of the flight has come forward and denies napping on the flight. But he also denies there was an argument that kept them from responding to air traffic control during the time the plane flew past Minneapolis and had to turn back. He claims it wasn't a safety-related issue, and then ominously adds, "I would tell you more, but I've already told you way too much." I have no idea what to make of that last statement.
Most people think the most likely explanation for the incident is that the pilots fell asleep. Unfortunately, it is not going to be easy to get to the bottom of this if the pilots stay mum on this because the cockpit voice recorder only holds the last 30 minutes of recordings, and whatever happened during the overfly got overwritten once the pilots did turn around. Maybe some advanced technology can reconstruct the original recording from beneath the new recording like how they reconstructed parts of the infamous gap in the Nixon tapes!

Could letting pilots take a nap make flying safer?
This is one of those tired old topics that never goes away. The reason there are two pilots up there is not because it takes two people to actively fly a plane, but because one serves as a backup if something happens to the other. Aeroplanes nowadays pretty much fly themselves. You can program in a series of waypoints into the autopilot computer and the plane will go from one to the other with pretty much no human intervention. Instrument landing systems can also land planes with almost no human intervention, so I see absolutely no problem in the pilots taking turns sleeping while the other keeps an eye on things during routine cruise.
Pilots will argue that this is not safe. They will argue that if an emergency does arise, it would require two alert pilots to get things under control and that one sleeping or groggy pilot would be unsafe. One has to understand that this is an age-old tension between airline management and pilots - management would love to get rid of some rules about rest times and having pilots sleep in the cockpit could mean less strict limits on flight times and rest times. Pilots would love stricter limits on flight times and rest times because it would personally mean more free time for themselves. More importantly, it would mean that airlines have to hire more pilots to fly the same number of flights, which directly translates to higher dues payments to pilots unions. We will have to wait and see how this argument is settled, but if I were a betting man, I would say it is probably not going to happen, especially given that the current administration is democratic (read union-friendly)!

US police to auction motorized lounge chair
OK, this is one true luxury ride. Look at this list of features built into the la-z-boy: comes complete with stereo, footrest, cupholders, headlights, a nitrous oxide power boost system, drag racing-style steering wheel and a parachute. Yes, that's right: it even comes with a parachute, in case you decide to go flying in it and the battery runs out!
Now, it was reported that Le Roy Anderson, the owner, had been cited for DWI after smashing this ride into a parked car while driving it drunk (the chair can do up to 15 mph). It turns out that this actually happened over a year back in August of 2008. Now, that the case has made its way through the courts, the verdict is in: the driver pleaded guilty, and as a penalty, his ride will be auctioned off. Seems mean-spirited to me, but DWI is DWI, and I guess this action sends out a strong message that it will not be tolerated whether it is in a car, a motorbike, a tank or a la-z-boy! And, moreover, it will be on eBay, so here is your big chance to snag it if you have always wanted a couch-potato-mobile!!

Cheesed off Swiss farmers target minister
Dairy farmers in Switzerland have taken a page out of the book of famous shoe-throwing journalist, Muntadhar al-Zeidi, by throwing their boots at the Swiss economy minister. Because it is not practical for anyone to dodge multiple pairs of boots, her bodyguards came to her rescue with opened umbrellas. No word on any arrests!

Only 'Coca-Cola Espanola' for Spanish lawmakers
The speaker of the Spanish parliament has ordered that cans for the Coca Cola in vending machines at the parliament be made in Spain. Ostensibly so that, in his own words, "those buying the drinks can read the nutritional information on the cans in Spanish." Whatever! The maker of the cans (currently a Polish company) can not print in Spanish?! As I said, whatever!!

Shocking Cost Of Spending A Penny At Shop
Don't ask me what the headline actually means. It left me scratching my head after reading the story, which, by the way, is about a shop owner who has electrified the curb near his shop to prevent people from taking a pee there! "If anybody persists and continues with the anti-social behaviour they'll get a shock, they'll know all about it," according to the shop owner, who is apparently tired of the mess he finds his shop and its surroundings in after revellers are done.
Obviously, while most intelligent people will find the solution perfectly reasonable, the police have warned the shop owner that he will be held liable if anyone complains about being shocked. This is obviously the same police that has proven to be effective and efficient at bringing the revellers to justice. Yeah, right!

No one on ballot for mayor, council in NC town
This is a town of 29 people with a mayor and 3 council member! I kid you not! And they were so busy that they forgot about the filing deadline, which apparently "sneaked up" on them! Not to worry, they are going to write each other's names in as write-in candidates so that they can hang on to their jobs! With people like them keeping a sharp eye on things, why would anyone want to replace them?!!

Primary School Kids Go Down The Pub For Lunch
Yeah, it's another of those British headlines that leave you scratching your head for a while! It is a feel-good story about students who patronize a local diner instead of having a lunch room in the school. I guess it is one way that the local school can support a local business instead of having lunch prepared in some kitchen far away and trucked to the school. Before McDonald's gets any fancy ideas, the article does note that "the menus and portions are tested and approved for their nutritional value"! Good luck with that, McDonald's!!

Lebanon dips into another world record with hummus
Lebanese to Israel: Hands off our hummus!
Interesting couple of stories about a nationalistic competition for the largest serving of hummus! I had no idea that hummus was Lebanese. I knew it was middle-eastern, but not specifically Lebanese. If I had to guess, I would have guess Arabic or Egyptian. Turns out Israel held the record for the largest serving of hummus, so the Lebanese were miffed enough about it to organize this record-setting event.
Now, Lebanon accuses Israel of "stealing" these dishes and marketing them to the world as Israeli. And then the article gets very interesting because there apparently is a process to register food as belonging to a particular country. That gives the country the rights to market that dish as its own and prevent other countries from calling that dish theirs! The more you read, the more you know! Of course, the more you know, the more you forget. And the more you forget, the less you know. And the cycle continues . . .

Thursday, October 22, 2009

Vedic Mathematics Lesson 25: Multiplex Osculation

In the last lesson, we learnt about simple osculation and its utility in divisibility tests. The "simplicity" of simple osculation comes from the fact that we osculate one digit at a time. When we take the remainder after division by 10, and the integer quotient of division by 10, we separate the last digit from the rest of the number, and then perform osculation with it.

You can find all the 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

In this lesson, we will extend the method to osculation by more than one digit. This is equivalent to taking the remainder after division by a higher power of 10, multiplying it by some number and adding this result to, or subtracting it from, the integer quotient of division by the higher power of 10. This is called multiplex osculation.

Let us illustrate this procedure by trying it out on a few numbers.

For instance, supposed we have to positively osculate 487537 by 10, 2 digits at a time. The procedure simply consists of taking the last 2 digits, multiplying them by 10, and adding them to the number left over after removal of the last 2 digits. Thus, the given osculation would be performed as 4875 + 37x10 = 4875 + 370 = 5245. Performing the same osculation once more would give us 52 + 45x10 = 502. One more iteration would lead us to 5 + 02x10 = 25.

As a second example, we will try negatively osculating 4378374 by 2, 3 digits at a time. The procedure consists of taking the last 3 digits, multiply them by 2, and subtracting the result from the number left over after removal of the last 3 digits. Thus, the given osculation would be performed as 4378 - 374x2 = 4378 - 748 = 3630. When we perform the same osculation once more, we get 3 - 630 x 2 = 3 - 1260 = -1257.

Now that we know how to perform multiplex osculation, let us see why the procedure is useful.

In the previous lesson, we figured out how to derive the natural positive and negative simple osculators for any number that ends in 1, 3, 7 or 9. Unfortunately, we also figured out that this procedure can lead to large simple osculators that can make the test for divisibility a little difficult.

Multiplex osculators can make that burden a little lighter under some circumstances. That is why it is important to learn multiplex osculation. However, just so I keep expectations low, testing divisibility by large numbers is always going to be somewhat difficult, and multiplex osculation is not going to make it trivial by any stretch of the imagination.

Let us deal with some simple cases first and then see how to convert other cases to these simple cases if possible.

The first set of simple cases are numbers that end with a series of 9's. For instance, take the number 399. We can recognize immediately that its natural positive simple osculator is 40 (one more than the number left after dropping the 9 at the end of the number). However, osculation by 40, one digit at a time (simple osculation by 40) might get a little tedious. Vedic mathematics says that we don't have to do that: we can simple take one more than the number left over after removing the series of 9's and osculate with that number over as many digits as the number of 9's in the series.

To put it in practical terms, in the case of 399, the number left over after removing the series of 9's is 4. The number of 9's in the series is 2. Thus, we could say that P2 = 4. What the notation means is that for 399, the multiplex positive osculator for osculation by 2 digits at a time is 4. To test this, let us take a number like 1596 and check its divisibility by 399 using multiplex osculation. Since P2 = 4 for 399, we perform positive multiplex osculation of 1596 by 4. Our first iteration gives us 15 + 96 x 4 = 399. We see that 399 is divisible by 399, hence we conclude that 1596 is divisible by 399. We can verify by performing the actual division that this is indeed the case.

Applying the same logic to a few other examples, we can derive the natural positive multiplex osculators for the numbers below:

499: P2 = 5
2999: P3 = 3
1199: P2 = 12
999: P3 = 1
79999: P4 = 8

The second set of simple cases are numbers that end in a 1 preceded by a series of 0's. Take the number 2001, for instance. We can recognize immediately that is natural negative simple osculator is 200 (the number left over after dropping the 1 at the end of the number). However, osculation by 200 one digit at a time (simple osculation by 2) may sound somewhat inconvenient. Instead, Vedic mathematics provides us with following rule: The natural negative multiplex osculator of the number is the number left after dropping the series of 0's and the final 1. The number of digits to osculate by is the number of digits dropped.

To put it in practical terms, in the case of 2001, the number left after dropping the series of 0's and the final 1 is 2. The number of digits dropped is 3. Thus, we say that N3 = 2. The notation means that the negative multiplex osculator is 2 and the number of digits to osculate by is 3. Suppose we have to test the divisibility of 130065 by 2001. We perform negative osculation by 2, 3 digits at a time to get 130 - 065x2 = 0. Since 0 is divisible by 2001, we conclude that 130065 is divisible by 2001. Indeed it is easy to verify that 130065 is divisible by 2001.

Applying the same logic to a few other examples, we can derive the natural negative multiplex osculators for the numbers below:

21001: N3 = 21
501: N2 = 5
8001: N3 = 8
1501: N2 = 15
20001: N4 = 2

The natural multiplex osculators for other numbers (that do not end with a series of 9's or a 1 preceded by a series of 0's) can be derived if those numbers can be converted into numbers of these two types by multiplication with some other number. As you can imagine, this is not a completely straightforward process that can be done using a standard set of rules.

The easiest way to do this is to become familiar with the repeating decimals that result from division by certain numbers. For instance, 1/7 = 0.142857 repeated continuously. It is also easy to see that 142857 x 7 = 999999. Thus, we can say that P6 for 142857 is 1.

Similarly, 1/11 = .09, repeated continuously. Thus, it is easy to see that 90909 x 11 = 999999. Thus, we can say that P6 for 90909 is 1.

One might also be able to guess that 143 x 7 = 1001, so N3 for 143 is 1.

This is not a surefire method and will not work for many numbers. For many numbers, a little trial and error is necessary to find a multiplier that will convert the number to something for which the multiplex osculator is readily available. The idea is to get as many 9's at the end as possible so that the positive osculator becomes smaller. Ultimately, if one is able to find a multiplier that creates 28999, it is better than a multiplier that creates 7219. Similarly, a multiplier that creates 54001 is better than one that creates 27211.

Moreover, note that a multiplex osculator that osculates over too many digits is not particularly useful for testing divisibility. Take the case of the number 2857, for instance. After some trial and error, we may be able to figure out that 2857 x 7 = 19999. Thus we can say that P4 for 2857 is 2. But, let us see if we can apply this method to test divisibility of 8571 by 2857.

Applying the osculation rule, we immediately see that the results of the multiplex osculation are even worse than the original number when it comes to ascertaining divisibility by 2857. Successive multiplex osculations of 8571 by 2 give us 17142, 14285, 8571, 17142, 14285, 8571, etc. repeating continuously. Thus, multiplex osculation is not as useful as we found simple osculation to be.

In spite of the disadvantages associated with multiplex osculation, it is important to know the procedure for the sake of completeness. Moreover, there are some cases where multiplex osculation can give us answers to divisibility questions faster than simple osculation can. Practicing both forms of osculation is key to understanding when to use which method and what the advantages and disadvantages of each method are. Hope you take the time to practice so that you are expert at both and can choose whichever method gives you the best advantage, given the circumstances. Good luck, and happy computing!

Tuesday, October 20, 2009

I Am Better Than Your Kids!

This is an oldie but a classic. I was going through some old emails when I came across this. It brought tears of mirth and laughter to my eyes as I read and reread it over and over again! The comments on the fire engine are particularly good! I thought I would share it with everyone. Hope you enjoy too!

Sorry about the white space between the writing and the tables. Everything looks good in the preview, and the html is correct, but it shows up with this huge amount of white space which I can not eliminate. Maybe some HTML expert can diagnose the problem and suggest a solution to me!

Warning: Contains mild profanity throughout.

I am better than your kids.

If you work in an office with lots of people, chances are that you work with a person who hangs pictures up that their kids have drawn. The pictures are always of some stupid flower or a tree with wheels. These pictures suck; I could draw pictures much better. In fact, I can spell, do math and run faster than your kids. So being that my skills are obviously superior to those of your children, I've taken the liberty to judge art work done by other kids on the internet. I'll be assigning a grade A through F for each piece:




















Megan, age 4
First of all, I don't even know what this is. If it's supposed to be a dog, then it's the shittiest dog I've ever seen. F

Kyle, age 8
You spelled America wrong asshole. Also, I could have sworn America's colors were red, white and blue. There's no yellow anywhere, traitor.F

Lisa, age 6
I almost had a seizure when I saw this one. Three words: too many colors. Also, eggs aren't supposed to have ears, dipshit.F

Cameron, age 4
Terrible. F

Bryce, age 10
This one wouldn't be too bad if the color was kept inside the lines, if you picked a new perspective, used non-abrasive colors and asked someone with talent to paint it for you. On one hand I want to give an A for effort but... F

I can't believe how much I rule. More crappy children's art work:




















Jon, age 8
Ding Ding! Here comes the shit-mobile. I've never seen a fire truck that needed to be shaved. I would rather be burned to death than be saved by this hairy piece of shit. F

Rachel, age 7
That's interesting, everyone in this picture is white. Even the rainbow is white. Perhaps in an ideal world, everyone would be white isn't that right, Rachel? Or should I call you RACIST? Nice try, Hitler. F

Jason, age 6
This one would receive an "A" if the assignment was to throw as much random shit onto a paper as poorly as you can. I've pissed patterns on snow that look more coherent than this. F

Seth, age 4
Vrrrroooooooooooommmmmm! F

Kelly, age 9
This was a Christmas gift from Kelly to her parents. Good job Kelly, now pack up your shit and find a foster home. If my kids tried to pass this off as a gift, they'd come home from school and find all their shit outside in a box. What a lousy gift, seriously. You give them video games and toys, and they give you some half-assed drawing with a crooked tree. I wonder how much a gift like this would set someone back. Five, maybe ten minutes to find a napkin and some markers? F

Sunday, October 18, 2009

One More Busy Week!

It was another busy week. Both at work and at home.

The project planning for my new project continued at a brisk pace with more spreadsheets, presentations and documents being prepared, circulated, discussed, corrected, rewritten and so on. At least, when I get to work, I have a list of things to accomplish, so there is a sense of purpose in what I do at work.

My blogging activity has gone down somewhat because of the level of activity at work. It is a good think I started blogging a while back when things were slow. The down time was crucial in learning the ropes and becoming efficient at putting posts together. That efficiency and experience is coming in handy as I manage this project while putting posts together at a pretty regular, but manageable rate.

Because of the need to be efficient at it, I have noticed that my blog posts have also become more consistent in terms of formatting and other minor aspects that have nothing to do with the content. I don't spend hours or even minutes pondering the layout of my blog template and the elements in it. I don't spend hours trying to rearrange stories in my roundups for some unnoticeable improvement in the aesthetics.

Even the promotion of the blog posts has become a pretty standard exercise. I publish the post, then go on a bunch of standard sites like Digg, Buzz Up!, StumbleUpon and Reddit and post the URL there in the appropriate categories. When I initially started blogging, my hits per day barely reached the double-digits. Now, if I stick to my routine, I can count on a couple of thousand hits per day on a regular basis. Very rarely, something I post will touch a nerve and I will get a flood of visitors for a couple of days (I have had a couple of days when my hits have gone into the 5 digits, but that is still a pretty rare phenomenon). Then things will settle down again into the low four-digits.

I have a feeling that getting the readership beyond its current levels will require some concerted research and efforts that I don't have the time for right now. There seem to be a couple of hundred dedicated readers who read every post I make, and then there are a bunch of "opportunistic" readers who will follow my promotional links from various network sites to the blog. I also receive a couple of hundred hits a day from search engines when people search for specific terms, especially related to my series of posts on Vedic Mathematics.

I can not track this directly, but I do hope some of my visitors are clicking on the charity links on the left sidebar of the blog and visiting the charities that have made banners available for use on my blog. I have a few banners each to direct visitors to the World Wildlife Fund (WWF), World Food Program (WFP) and the Red Cross. I particularly recommend the FreeRice program that allows you to donate rice to the WFP by just playing interesting, educational games.

At home, things were a bit busy this week because one of my daughters celebrated her birthday last Friday. We invited some kids from her class and a few of our friends' kids for a pizza party and sleepover. The party took some time to organize during the week (shopping for goody bags, balloons, the cake, etc., keeping track of the invitations and RSVP's, etc.) too.

And then, of course, on the big day, it was total chaos at home once the guests arrived. I kept the guests entertained as much as I could, but kids will be kids. Once they started playing games, etc., the house was filled with noise, various real toys, and various other things that were standing in for toys in the kids' games. The kids eventually settled down to watch a movie and there was some relative calm for about 2 hours.

By this time it was 11 PM, but the kids thought the party was just getting underway. They started playing hide-and-seek and other games, and showed no signs of going to bed even at midnight. Eventually, I gave them a deadline and allowed them to play until about 12:45. Then I put my foot down and asked them all to go to bed. Finally, everyone settled down by about 1 AM, and I could go to bed too.

The kids were back up at 7 AM. My wife prepared them breakfast and they played some more games. Finally the parents of the kids started arriving at around 9:30 and the house started emptying out. Things came back to normal around 11 AM, and we started recovering from the party after that. The recovery is still going on as we catch up on our sleep, clean the house up, etc.

Today, the weather cooperated with me so that I could mow the lawn one last time for the season. I had wanted to do this a few weeks back, but I got busy with other things the one weekend when the weather was reasonable. After that, it has been very cold and wet for the past couple of weeks. In past years, I would consider that a sign from up above that I was done for the year and just leave the yard as it was! But, this year, I decided I would mow the lawn one last time. Coupled with my finding an easier way to take care of the weeds in my yard, I am hoping that my yard will start looking better over time. I think this is the latest I have ever mowed my lawn in any year since I moved into my house.

My kids also had a dance test and some practice sessions for a music competition they are participating in next week. So, that rounded off the activities for this week. Time to catch a good night's sleep and get ready for another busy week. It promises to be another eventful week at work. It will probably be a busy week at home also. Which is not bad, all things considered!

Thursday, October 15, 2009

Vedic Mathematics Lesson 24: Simple Osculation

I am sure many of you are wondering if I made some kind of spelling mistake in the title of this lesson. Osculation is not exactly a common word, but it is not misspelt either. Osculation is actually a very useful mathematical operation, and I will explain why shortly. Moreover, in this lesson, we will just use the term "osculation" instead of the full "simple osculation". We will learn about other types of osculation in subsequent lessons, and in the meantime, we will use "osculation" to mean just the simple kind.

You can find all the 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

In the previous lesson, while discussing the divisibility rules for 13 (and then 17 and 19) that the divisibility rules bear similarities to that for 7. I promised to explain why in a later lesson. This lesson will contain that explanation. I promise!

But, in the meantime, let me first explain what exactly osculation is.

Osculation is the mathematical process of adding or subtracting the product of a whole number and the remainder of dividing a number by 10, to or from the whole number result of dividing a number by 10. Think back to the divisibility rules for 7. The first of these is that if the sum of five times the last digit of the number added to the number obtained by removing the last digit is divisible by 7, then the original number is divisible by 7. The number obtained by removing the last digit of the original number is actually the whole number result of dividing it by 10. Adding five times the last digit to this is essentially the process of positively osculating the original number by 5.

Similarly, the second divisibility rule was that if twice the last digit subtracted from the number left over after removing the last digit is divisible by 7, then the original number is divisible by 7. Thus, we could have simply said that if the result of negative osculation of a number by 2 is divisible by 7, then the number is divisible by 7.

A number can thus be osculated by any other number. And the osculation can be negative or positive. Positive osculation can be performed indefinitely on any number, and the results will start repeating themselves after some time. Negative osculation can be performed only until the result becomes zero or negative.

Let us try some osculations first to familiarize ourselves with the process. After that, we will examine their significance in the process of testing divisibility by numbers, especially for which most people don't even know divisibility rules exist.

56 positively osculated by 2 gives us 5 + 6x2 = 17. Continuing the osculation by 2, you get 1 + 7x2 = 15, then after that 11, 3, 6, 12, 5, 10, 1, 2, 4, 8, 16, 13, 7, 14, 9, 18, and finally 17. As you can see, at that point, the results start repeating in a cycle.

Note that single digit numbers can also be osculated simply by padding it with a zero to the left. The right-most digit becomes the number itself, and the rest of the number left after the removal of the last digit is zero.

123 negatively osculated by 4 gives us 12 - 3x4 = 0. No further osculation is possible. Negative osculation of a single-digit number will always result in a negative result.

Note that repeatedly osculating a number positively by 1 will eventually give us the digital root of the number since the process is the same as adding each successive digit to the previous ones until we are left with a single-digit number which then repeats endlessly when the process is continued.

For instance, 287 positively osculated by 1 first gives us 28 + 7x1 = 35. This then gives us 3 + 5x1 = 8. Note that not only is 8 the digital root of 287, it is also the result of repeatedly osculating 8 positively by 1.

In Vedic Mathematics, there exists the concept of natural osculators for a number. Osculating a number by its natural osculators is the key to determining divisibility by numbers like 7, 11, 13, etc. So, the question now becomes, what are a number's natural osculators, and how do we determine them.

In Vedic Mathematics, the natural osculators of a number are called Vestanas. Every number that ends in 1, 3, 7 or 9 has two well-defined vestanas.

To find the natural positive osculator (positive vestana), follow the procedure below:

Step 1
  • For numbers ending in 1, multiply them by 9
  • For numbers ending in 3, multiply them by 3
  • For numbers ending in 7, multiply them by 7
  • Nothing needs to be done for numbers ending in 9

As you can see, the application of step 1 results in a number that ends in 9.

Step 2
  • Remove the 9 from the end of the number.
  • Increase the number left behind by 1. This is the natural positive osculator of the number

This is another application of the Ekadhikena Purvena sutra (By One More Than The Previous One).

Thus, for 13, step 1 gives us 39 and the natural positive osculator would be 4 (one more than the number left behind after removing the 9 at the end of the 39). Similarly, the natural positive osculator for 7 is 5 (step 1 results in 49, and application of step 2 gives us 5). Note that the natural positive osculator for 9 is 1, and the natural positive osculator for 3 is also 1.

It is immediately clear to the astute reader that one of the divisibility rules that were introduced for 7, 13, 17 and 19 in the previous lesson was actually positive osculation by the natural positive osculator of the number. Thus, a simple test for divisibility by any number that ends in 1, 3, 7 or 9 is to derive the natural positive osculator of the divisor, and then positively osculate the dividend by this osculator. If the result is divisible by the divisor, then the original dividend is divisible by the divisor.

Note also, that testing divisibility by using the digital root for 3 and 9 is actually a special case of testing divisibility using their natural positive osculator. As we have mentioned before, the natural positive osculator of 3 and 9 is 1, and positive osculation of a number by 1 eventually results in the digital root of the number.

To find the natural negative osculator of a number (negative vestana), follow the procedure below:

Step 1
  • Nothing needs to be done for numbers ending in 1
  • For numbers ending in 3, multiply them by 7
  • For numbers ending in 7, multiply them by 3
  • For numbers ending in 9, multiply them by 9

As you can see, the application of step 1 results in a number that ends in 1.

Step 2
  • Remove the 1 from the end of the number
  • The number left behind is the natural negative osculator of the number

Thus, for 13, step 1 gives us 91, and the natural negative osculator would be 9 (remove the 1 from the end of the number). Similarly, the natural negative osculator of 7 is 2 (step 1 gives us 21 and step 2 gives us 2).

The astute reader will once again have figured out that one of the divisibility rules introduced for 7, 13, 17 and 19 in the previous lesson was actually negative osculation by the natural negative osculator of the number. Thus, another simple test for divisibility by any number that ends in 1, 3, 7 or 9 is to derive the natural negative osculator of the divisor, and then negatively osculate the dividend by this osculator. If the result is divisible by the divisor, then the original dividend is divisible by the divisor.

If you calculate the natural osculators of many numbers, you will also notice that the sum of the natural positive and negative osculators of a number is the number itself.

The natural positive osculator of 7 is 5. Its natural negative osculator is 2. 2 + 5 = 7. Similarly, for 11, the two natural osculators are 1 and 10. For 13, the two natural osculators are 4 and 9. For 3, they are 2 and 1. For 9, they are 1 and 8, and so on. Thus, if you know one of the natural osculators of a number, you don't need to perform the 2-step procedure to derive the other natural osculator. Simply, subtract the known osculator from the number, and the result is the other osculator.

Going beyond 20, we can now derive divisibility rules for any numbers that end in 1, 3, 7 or 9 using this lesson. Take 47 for instance. The natural negative osculator of this number is 14. Thus, negative osculation of any number by 14 is the divisibility test for 47. Similarly, the natural positive osculator of 47 is 33. Thus, positive osculation by 33 is another divisibility test for 47.

Now you know (or can derive) at least two divisibility rules for every number that ends in 1, 3, 7 or 9. Believe me, people will be amazed when you derive these divisibility rules in your head and then tell it to them as if they should have known all along! The look on their faces is truly priceless!! The possibilities are endless!!!

You may think that being able to use osculation to test for divisibility is somewhat limiting because it applies only to divisors ending in 1, 3, 7 or 9. However, note that, apart from 2 and 5, every prime number ends in 1, 3, 7 or 9. Thus, osculation will help you derive divisibility rules for pretty much any prime number that exists. All you have to do for composite numbers is find a set of co-prime factors and test divisibility by them to determine divisibility by the composite number.

As the title of the lesson suggests, what we have learnt about in this lesson is called simple osculation. Obviously, as you can see from the example above, the natural positive and negative osculators of large numbers tend to get pretty large, and osculation by these large numbers may appear to be quite inconvenient (even though it would still be a lot more convenient that actually performing the division in most cases). We will extend this method further into something called complex multiplex osculation in subsequent lessons so that testing divisibility by larger numbers does not necessarily seem as inconvenient (though, obviously, nothing can make working with large numbers as convenient as working with smaller numbers).

In the meantime, be sure to practice osculation, and the derivation of the natural osculators of numbers thoroughly, so that you can do it in your head even for large numbers just as if you are deriving their digital roots. This will make for even more amazed audiences as you can work out not just the divisibility rules, but also the divisibility itself in your head! Good luck, and happy computing!!

Tuesday, October 13, 2009

Signs You May See At Your Workplace!

Remember!

The humorous sign you see here today may be the reality you face at work tomorrow!!
















Sunday, October 11, 2009

I Finally Have A Project To Lead!

Finally, some action on the work front. The last week has been pretty busy work-wise.

After all the politics surrounding my work in the past few months, I was beginning to think that I would never get back to working productively on anything. After my last email to my manager, I followed it up with several face-to-face conversations with him, but the situation was tricky and my manager and I did not see eye to eye all the time. My team's morale was down in the dumps as we were relegated to doing nothing but support work for the past few months.

Even support work was a little tricky. Some of the tools and models we were supporting were supposed to be obsoleted by the new vendor tool in the future. Every time we tried to do some support work on such models, the IT department wanted to know why we were working on a tool that was supposed to be obsoleted. We then had to explain that we were not enhancing it or making any improvements to it, just making sure it continued working.

In short, it was not a very pleasant work environment at all for the past several months.

Finally, we identified some functionality that none of the vendor tools could provide, and decided to explore if we could work on incorporating that functionality into any future system that was deployed, regardless of the vendor selection and evaluation process. Essentially, it was a modification of what I had suggested to my manager in my email, partially disassociating ourselves from what IT was doing, and concentrating on some project where we could add value.

The politics of it were probably horrendous, but my manager and director tried various tactics to get the IT department to carve out a project for us to work on while they went about their merry way doing useless stuff. We got final approval for starting a new project that would not be considered as stepping on IT's toes about 2 weeks back.

Then came the tough job of defining the scope of the project and coming up with requirements for it. The problem was that the project we would be working on was highly interconnected with what the vendor products would deliver. In fact, ideally, it should have been developed as one big integrated model, and our department had the expertise and experience to do it. We were hampered from actually doing it because IT never gave us the data infrastructure that would enable us to do it.

Now, as part of the vendor evaluations, they were creating the data infrastructure to get such a project off the ground, but we could not work on it without escalating tensions tremendously. We knew that none of the vendor products had the sophistication that we could bring to the final product, given that they lacked crucial functionality (such as the functionality we would be working on), and what functionality they had was present in separate modules instead of being in one integrated module.

In any case, what all this meant was that we had to be very careful about what the scope of our project was going to be. There had to be as little overlap as possible with the functionality that would be provided by the vendor tool. To do that, we had to meet several times with the IT department to understand what functionality IT considered to be under their purview and what functionality they would consider ceding to us.

Once the scoping exercise was done, we contacted the users and explained what we were doing. We had to get detailed requirements for this project from them. As far as the users were concerned, IT and our department were one big happy family that provided solutions to their problems. They were not privy to the dysfunctionality within this big happy family, so we had to keep up appearances!

We explained to them what our project was all about, and there were quite a few raised eyebrows on the user side that questioned why the vendor tool was not providing this functionality to them as part of the package they were promised by IT. We were tempted several times to just blurt out that the vendor tool was a useless product that we were buying only because of a trojan horse director in IT, not because of its technical excellence. But that would be like airing our dirty laundry in public. And anyways, the users would know how useless the vendor product was once they started using it soon anyways, so there was no point in coming off like sore losers right now.

Eventually the users understood that the problem ideally required an integrated solution. But, the vendor tool was not going to deliver such integrated functionality. In fact, it was going to be missing some functionality. And we were going to go in and fill in the gaps with our project. And, obviously, it would not be integrated with anything because we can not. But we promised them that it would be OK initially. We did not explicitly tell them that the ideal solution would require that the vendor product be thrown out eventually (along with the trojan horse director in IT, hopefully) and replaced by an expansion of the project we would be working on, but hopefully the users understood that!

After collecting the requirements, it was time to put it into a formal document and then come up with a project plan. Lots of meetings, lots of discussions with users, discussions within the team, no wonder the last week was quite a blur of intense activity. I created more new spreadsheets than I have created in the past few months before that combined. I wrote more powerpoint slides and put together more presentations than I have done in the past few months before that combined, as well.

All this meant less time to spend on doing other things I have gotten used to doing in the past few months - less time for blogging, less time to learn and/or write about Vedic Mathematics, less time to surf the web for interesting stuff. less time for personal emails, etc. But still, it was a good feeling. It is all well and good to be getting free money, but earning the money somehow feels better. My team and I will probably be busy with this project for at least the next year or so provided IT comes through with the right data feeds. I am keeping my fingers crossed for that.

I get paid to add value to my company, not sit around and surf the web, attend to personal emails, write blogs or learn and teach Vedic Mathematics. I add value by taking up and leading projects that make money or save money for my company. For the past few months, I have been sitting around without any projects to lead. As I told my manager last Friday, I finally have a project to lead! Time for me to get back into the work mode I was in before the past few months!! Wish me good luck!!!

Tuesday, October 6, 2009

Vedic Mathematics Lesson 23: Divisibility Rules

In this lesson, we will deal with some basics of how to determine the divisibility of a given numerator by a given denominator. These are commonly referred to as divisibility rules. In some cases, we will also be able to use these rules to figure out what the remainder of such a division would be if we determine that the numerator is not divisible by the denominator without a remainder.

You can find all the 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

Many of the divisibility rules mentioned in this lesson will already be familiar to many people. They are recounted here just for the sake of completeness. But some are obscure and are not taught in schools even though they are well-known in Vedic Mathematics. We will not have the time and space to derive the divisibility rules using Vedic Mathematics techniques in this lesson, but we will cover that in subsequent lessons. In this lesson, we will simply recount some of the rules and how they are applied.

Divisibility rule for 2

All even numbers are divisible by 2. Thus, any number ending in 0, 2, 4, 6 or 8 is divisible by 2. Another way to express this is that if the last digit is divisible by 2, then the number itself is divisible by 2.

If the number is divisible by 2, the remainder of division by 2 is 0. If it is not divisible by 2, the remainder will be 1.

Thus, 12, 4398750, 473874, 93876, and 43758 are all divisible by 2. 329, 9877, 633, 93721, and 76235 are all not divisible by 2, and they all produce a remainder of 1 when divided by 2.

Divisibility rule for 3

If the digital root of the number is divisible by 3, then the number is divisible by 3. We have dealt with how to find the digital root of a number in this earlier lesson. Testing for divisibility is an important application of digital roots.

The remainder obtained by dividing the digital root of the number by 3 is the same as the remainder that would be obtained by dividing the original number by 3.

699, 3204, 398475, and 326649 are all divisible by 3. 38782, 677584 and 759391 produce a remainder of 1 when divided by 3. 837038, 984335, and 33263 produce a remainder of 2 when divided by 3.

Divisibility rule for 4

There are two rules that can be used to determine divisibility of a number by 4. Both the rules use just the last two digits of the number.

The first rule is that if the last two digits of the number are divisible by 4, the original number is divisible by 4. This rule is easy to check against when the last two digits are small and their divisibility by 4 is easy to verify.

The second rule is that if the sum of the last digit and twice the next-to-last digit is divisible by 4, then the original number is divisible by 4. This rule is easier to check against when the last two digits are large and checking for their direct divisibility by 4 becomes more difficult.

439812, 4332, 858804, etc. are easy to verify as being divisible by 4 using the first rule. 876592, 437656 and 345784 produce 2 + 9x2 = 20, 6 + 5x2 = 16, and 4 + 8x2 = 20 as the answer when the second rule is applied. Thus these numbers are also divisible by 4.

The remainder obtained by dividing the last two digits of the number by 4 is the same as the remainder that would be obtained by dividing the original number by 4.

Similarly, the remainder obtained by dividing the sum of the last number and twice the next-to-last number by 4 is the same as the remainder that would be obtained by dividing the original number by 4.

33875, 49985 and 9222 produce remainders of 3, 1 and 2 respectively when divided by 4.

Divisibility rule for 5

Any number that ends in 0 or 5 is divisible by 5. The remainder from dividing a number by 5 is the same as the remainder one would obtain by dividing the last digit by 5.

This is just the last digit itself, or the last digit - 5 in cases where the last digit is greater than 5.

Thus, 987390, 27685, 38740, etc. are all divisible by 5. 32768, 45874, 34981 and 38437 produce remainders of 3, 4, 1 and 2 respectively when divided by 5.

Divisibility rule for 6

6 is the product of 2 co-prime factors, 2 and 3, that each have their own divisibility rules. The rule for division by 6 is therefore a combination of the divisibility rules of these two factors: if a number is divisible by both 2 and 3, then it is divisible by 6.

Thus, 32874, 46944, 945834, etc., are all divisible by 6.

The remainder of division of a number by 6 is a function of the remainder of division of that number by both 2 and 3. The table below shows how the remainder of division by 6 can be computed when the remainders after division by 2 and 3 are known:

Remainder after . . . Remainder after . . . . . Remainder after
Division by 2 . . . . Division by 3 . . . . . . Division by 6
0 . . . . . . . . . . 0 . . . . . . . . . . . . 0
0 . . . . . . . . . . 1 . . . . . . . . . . . . 4
0 . . . . . . . . . . 2 . . . . . . . . . . . . 2
1 . . . . . . . . . . 0 . . . . . . . . . . . . 3
1 . . . . . . . . . . 1 . . . . . . . . . . . . 1
1 . . . . . . . . . . 2 . . . . . . . . . . . . 5

Note that the first line of the table above is divisibility rule itself: if the remainders are zero after division by 2 and 3, then the number is divisible by 6 with a remainder of 0.

Divisibility rule for 7

The rules for divisibility by 7 are not well-known to most people. But there are actually not just one, but two simple rules for determining divisibility by 7.

Rule 1: Take twice the last digit of the number and subtract it from the number that is left after removal of the last digit. If the result is divisible by 7, then the original number is divisible by 7. This same rule can be applied repeatedly to check the divisibility of intermediate results by 7 until one obtains a final result for which the divisibility by 7 can be verified on sight.

Take the number 163198 for instance. When we apply the rule above, we get 16319 - 8x2 = 16303 as the first result. It is difficult to tell whether this is divisible by 7. So, we continue by applying the rule on this intermediate result. Our next intermediate result becomes 1630 - 3x2 = 1624. We apply the rule once more to get 162 - 4x2 = 154.

And finally, we get 15 - 4x2 = 7. This is clearly divisible by 7, so we can say with confidence that 163198, our original number, is divisible by 7.

Note that sometimes, this method can produce a negative result instead of a positive result (for instance, in the case of 35, we get 3 - 5x2 = -7). But the rule is still applicable, and in the case of our example in parentheses, we can say that 35 is divisible by 7 because -7 is divisible by 7 (albeit with a negative quotient).

Also note that because of the way the rule is formulated, all zeroes at the end of a number can be ignored safely when determining divisibility by 7.

Rule 2: Take 5 times the last digit and add it to the number that is left after removal of the last digit. If the result is divisible by 7, then the original number is divisible by 7.

This same rule can be applied repeatedly to check the divisibility of the intermediate results by 7 until one obtains a final result for which one can verify the divisibility by 7 on sight.

Take the number 163198 again. When we apply this rule, we get 16319 + 8x5 = 16359. Apply the rule once more to get 1635 + 5x9 = 1680. Applying the rule once again gives us 168. One more application gives us 16 + 8x5 = 56. We know that 56 is divisible by 7 on sight, but just to verify, we can simplify it further to 35, 28, 42, 14, 21, and 7.

Obviously, the last result above is undoubtedly divisible by 7, so we know that 163198 is divisible by 7.

This rule may appear simpler to apply than rule 1, but it does have one significant disadvantage: you can not determine the remainder after division by 7 using this method because the final results do not correspond to the remainders in any obvious way.

Divisibility rule for 8

Just like for 4, there are two rules for testing divisibility by 8. If one has astutely paid attention to the divisibility rules for the powers of 2 thus far (2 and 4), one can guess that both the rules for divisibility by 8 involve just the last 3 digits of the number.

The first rule, just like in the case of 4, is that if the last 3 digits are divisible by 8, then the number itself is divisible by 8. As in the case of 4, this rule can be difficult to apply when the last 3 digits are large.

The second rule is similar to that used for 4 also. We take the sum of three numbers: the first number is the last digit itself. The second number is twice the next-to-last digit. The third number is 4 times the digit 3rd from the end. As you can see, the pattern is very obvious, and I am sure anyone can guess what the divisibility rules for 16 are going to be!

Applying the second rule to 395768 for instance, we calculate 8 + 2x6 + 4x7 = 48. Since 48 is divisible is divisible by 8 (we can verify that by repeatedly applying this rule on all intermediate results until we get a single-digit number, 8 in this case), we conclude that 395768 is divisible by 8 too.

The remainder of division by 8 is the same as the remainder of division of the last 3 digits by 8. It is also the same as the remainder of dividing the sum, as calculated in the second rule, by 8.

Divisibility rule for 9

The rule for division by 9 is similar to the rule for division by 3: If the digital root of the number is divisible by 9, then the number itself is divisible by 9. The rule for calculating the remainder is even simpler: if the digital root is not 9, then the remainder of division by 9 is just the digital root itself!

Thus, 732987, 859878, 356679, etc. are all divisible by 9. 3987982, 937483, 2934636, etc. produce 1, 7, and 6 as remainders when divided by 9.

Divisibility rule for 10

10 is a composite number that has two co-prime factors, 2 and 5. Thus, just like for 6, if the number is divisible by both 2 and 5, it is divisible by 10. Since the divisibility rules for both 2 and 5 depend solely on the last digit of the number, a quick comparison of the two rules leads to a very simple rule for 10: If the last digit is is a 0, then the number is divisible by 10. The remainder after division by 10 (if the number does not end in 0) is the last digit itself.

Divisibility rule for 11

There are actually two rules to test divisibility by 11. The first rule is somewhat well-known and is therefore presented first. The second rule is much more obscure.

Rule 1: To test divisibility by 11, number the digits alternately (starting from either end) as zero digits or 1 digits. Take the sum of the zero digits separately and call it the zero-sum. Take the sum of the 1 digits and call it the 1-sum. If the difference between the 1-sum and the zero-sum is divisible by 11, then the original number is divisible by 11.

Take the number 549873489 for instance. We number the digits as zero-digits or 1-digits starting from the left, as below:

010101010
549873489

Adding up the zero-digits gives us 5 + 9 + 7 + 4 + 9 = 34.
Adding up the 1-digits gives us 4 + 8 + 3 + 8 = 23.

The difference between them is 34 - 23 = 11. Since 11 is obviously divisible by 11, we can conclude that 549873489 is also divisible by 11.

The remainder after dividing the difference between the two sums by 11 is the same as the remainder after dividing the original number by 11. Thus, for instance, 9475909 has a zero-sum of 9 + 7 + 9 + 9 = 34 (assuming the numbering starts with 0 at the left-most digit), and a 1-sum of 4 + 5 + 0 = 9. The difference between them is 25, and the remainder of dividing 25 by 11 is 3. Thus, we can conclude that the remainder of dividing 9475909 by 11 is also 3.

Rule 2: Subtract the last digit from the number left over after removal of the last digit. If this result is divisible by 11, then the original number is divisible by 11.

Take 549873489, once again. The first application of this rule results in the number 54987348 - 9 = 54987339. We apply the rule once again and get 5498733 - 9 = 5498724. Applying the rule repeatedly gives us the results 549868, 54978, 5489, 539, 44, 0. Since it is easy to recognize that 44 and 0 are both divisible by 11, we can conclude that the original number is divisible by 11 too.

Divisibility rule for 12

12 is the product of co-prime factors 4 and 3. Thus the divisibility rule for 12 is that if it is divisible by 4 and 3, it is divisible by 12. Note that even though 6 and 2 are also factors of 12, they are not co-prime, so one can not test for divisibility by 6 and 2 and conclude anything about the divisibility of the number by 12. One can easily derive a table, just like for divisibility by 6, to determine the remainder after division by 12 given the remainders after division by 4 and 3.

Divisibility rule for 13

The rule for division by 13, once again, is obscure enough that most people do not know about it. There are two rules to check for divisibility by 13, similar to those for division by 7 (for a reason we will explore in a future lesson).

Rule 1: Take 9 times the last digit and subtract it from the number left after removal of the last digit. If the result is divisible by 13, then the original number is also divisible by 13.

Take the number 9847591, for instance. Applying this rule the first time give us a result of 984759 - 9x1 = 984750. The next application of this rule results in 98475 - 9x0 = 98475. Subsequent applications get us 9802, 962, 78, -65. One can recognize that both 78 and -65 are multiples of 13, so we can conclude that 9847591 is divisible by 13. Once we get a negative result by the application of this rule, add 13 successively to the result until the result becomes non-negative. If the result becomes zero at some point during this successive addition of the divisor, then we can conclude that the divisibility rule is satisfied.

Rule 2: The rule is to take 4 times the last digit and add it to the number left after removal of the last digit. If this sum is divisible by 13, the original number is also divisible by 13.

Take 9847591, once again. Applying this rule, we first get 984759 + 1x4 = 984763. Applying the rule once more, we get 98476 + 3x4 = 98488. Continued application of the rule results in successive results of 9880, 988, 130, and 13. 13 is obviously divisible by 13, so we can conclude that 9847591 is divisible by 13.

Divisibility rule for 14

It is trivial, by now, for one to figure out that since 14 is the product of co-prime factors 7 and 2, divisibility by 14 requires divisibility by both 7 and 2.

Divisibility rule for 15

Similarly, 15 has co-prime factors 3 and 5, thus divisibility by 15 requires divisibility by both 3 and 5.

Divisibility rule for 16

This is simply an extension of the pattern we have already seen for divisibility rules that test for divisibility by 2, 4 and 8. Thus, a number is divisible by 16 if the last 4 digits of the number are divisible by 16. Alternatively, where this test is too difficult to apply directly, one can also take the sum of the first digit, twice the second digit, 4 times the 3rd digit and 8 times the 4th digits (digits are numbered from the right, not the left), and test this sum for divisibility by 16.

That second rule is completely wrong, and fails even when checking divisibility of 16 by 16. I have no idea whether anybody used this to come to wrong conclusions. I hope not. After a lot of thought and experimentation, I have come up with divisibility rules for powers of 2 such as 16 and 32 in this later post.

Divisibility rule for 17

There are, once again, two rules that can be used to check for divisibility by 17. Both the rules for division by 17 are similar to the rules for division by 7 and 13. They are very obscure and mostly unknown, but easy enough to apply.

Rule 1: Subtract 5 times the last digit from the number left over after removal of the last digit. If the result is divisible by 17, the original number is divisible by 17.

Take 221 for instance. We can see that the application of this rule produces 22 - 1x5 = 17, which is divisible by 17. So, we can conclude that 221 is divisible by 17. Just as in checking division by 7 and 13, if you get a negative result, add 17 to it until you get a non-negative number. If that number is 0, then the divisibility rule is satisfied.

Rule 2: Simply add 12 times the last digit to the number left over after removing the last digit. If the sum is divisible by 17, then the number is divisible by 17.

Take 221 once again. The first application of the rule gives us 22 + 1x12 = 34. This is obviously divisible by 17, so one can conclude that 221 is divisible by 17. One can also continue the process, getting 51 and 17 as further results. Since nobody could doubt that 17 is divisible by 17, we can conclude that 221 is indeed divisible by 17!

Divisibility rule for 18

18 is a product of the co-prime factors 9 and 2. Thus divisibility by 9 requires divisibility by both 9 and 2.

Divisibility rule for 19

Similar to the rules for divisibility by 7, 13 and 17, we have two obscure, but simple rules for checking divisibility by 19.

Rule 1: Subtract 17 times the last digit from the number left after removing the last digit. If the result is divisible by 19, the original number is too. Because of the obvious difficulties involved in multiplying by a large number such as 17, we will ignore this rule for now, and move on to the next rule.

Rule 2: Another rule for divisibility by 19, that is much easier to apply, is to take twice the last digit and add it to the number left over after removing the last digit (very similar to the rules for 7, 13 and 17). If the sum is divisible by 19, the original number is too.

Take 187606 for instance. Applying the rule first gives us 18760 + 6x2 = 18772. Repeated applications of the rule gives us 1881, 190 and 19. Since 19 is obviously divisible by 19, we can conclude that 187606 is divisible by 19.

Divisibility rule for 20

Given that 20 is the product of co-prime factors 4 and 5, it is trivial to derive the divisibility rule for 20.

Hope this lesson has given you some insight into how to determine the divisibility of any number by numbers upto and including 20. It is easy to derive divisibility rules for many composite numbers beyond 20 by checking to see if they are the product of co-prime factors for which the divisibility rule is known.

For many primes numbers above 20, divisibility rules are not well-known, but Vedic Mathematics does provide a simple method to derive divisibility rules for them. We will learn more about divisibility rules, and how to derive them using this Vedic Mathematics technique, in the upcoming lessons. 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