Why the digits of multiples of 9 add up to 9

Today (happy π day!), my daughter told me that she learned a cool trick at school. They are learning multiplication, and so she showed me that when you multiply a number 1 through 9 by 9 and then add up the digits of the result, they add up to 9.

I was curious why it is true, and it is easy to see with some arithmetic:

we want to show that if 9x = ab, where 0 < x ≤ 9 and a,b are digits, i.e. 9x = 10a+b
then a + b = 9.
9x = 10x-x+10-10 = 10x-10 +10-x = 10(x-1) + (10-x) = 10a+b = 9a + a+b = 9(x-1) + a+b
9x-9(x-1) = a+b
9 = a+b.

In general, if number is divisible by 9 then the sum of its digits will be also divisible by 9.
e.g.  number abcd = 1000a + 100b +10c +d = 999a + 99b + 9c + a+b+c+d =
= 9 (111a+11b+c) + a+b+c+d ==> a+b+c+d is divisible by 9.

This also generalizes nicely to any base-n such that, if number is divisible by n-1 then the sum of its digits is divisible by n-1.
e.g. number abcd = n³a + n²b + nc + d = (n³-1)a + (n²-1)b + (n-1)c + a+b+c+d =
= (n-1) ((n²+n+1)a + (n+1)b + c) + a+b+c+d ==> a+b+c+d is divisible by n-1.

Leave a comment if you know a nicer way to prove this or if you find any errors.

 

 

Why the digits of multiples of 9 add up to 9

U.S. schools are teaching math wrong

Recently, I got a chance to attend a presentation by Dr. Jo Boaler, who is the professor of Mathematics Education at Stanford University and co-founder of youcubed (www.youcubed.org). She shared her views on the issues of math education in the U.S. and presented some ideas on what teachers and parents could do to improve the way we teach math to our kids.
I will not go into the details of the talk, because a lot of the same information could be found on the youcubed web site, which, I believe, is a great source of inspirational material for parents and teachers. But I did feel compelled to shout out this blog, because so much of what Dr. Boaler said resonated with me.
As a background, I’ve learned math in another country. My family emigrated to U.S. from Russia after I graduated high school, but I had to take a senior year of high school in the U.S. in order to get some course work needed for getting into college  (and also to learn English), so my comparisons are based on the two different teaching approaches that I got exposed to personally.
Below are some points I took away from Dr. Boaler’s talk, in bold, along with  my comments. They are not the most important points (she presented many other great ideas/facts), but I just list two of them, where I had to restrain myself from shouting “hallelujah, amen to that!”

Math is not a speed race
So true. My high school exit exam, we were given five problems and six hours to solve them (actually I can’t recall exact time since it was long ago, but it was at least an hour per problem). They were difficult problems; only about ten kids solved four and only two kids solved all five. Tests throughout the school year were similar – about three problems per test and about 45  minutes to solve. Fast forward to my U.S. experience, I used to joke that all we are being tested on is who can add and multiply the fastest. It was a shock to my system at first, because my brain was trained/wired to tackle problems that did not have an obvious answer and several techniques or approaches had to be considered before discovering the solution. When I took the SAT test, it was a really a test of how fast I could read a problem text and then perform basic operation(s). To be fair, when I took AP Calculus test, it was a real math test.

Memorizers are lowest achievers
This made me flash back yet again into my own experience. The emphasis was always made on showing the understanding of the concepts and showing the work. Correct answer without showing how one arrived to it was not accepted. And, in some cases, when work showed correct logic but had an arithmetic error, that error played little role in the final grade. There were many kids who just tried to memorize all the formulas and they never did as good as kids who actually tried to understood the principles. I’ve always thought why should I memorize something I could easily derive. Of course, it is still useful, and in some cases essential, to remember some facts and formulas, so it is a balance and not one extreme or the other. The point is that, when learning, it is better to understand the idea and then try to remember some shortcut/formula than to memorize shortcut/formula in order to avoid having to understand the idea. There is nothing wrong with memorizing things later on. In fact, why even bother memorizing anything you could quickly look up somewhere. But, you can’t memorize or look up problem solving skills.

When I look at the new Common Core materials, I see a step in the right direction. There are, of course, many other issues that stand in the way, so just moving to the Common Core is not nearly enough to turn around the math education in U.S. However, it is very encouraging to have people like Dr. Boaler who inspire, educate,  and empower parents and teachers to make a difference in their kids’ math education.
It was a very good talk by Dr. Boaler, and I got some value and great insight out of it.
Visit the youcubed web site for tons of great material!

U.S. schools are teaching math wrong

Picking up the team’s trash

In any decent society, majority of citizens, when noticing a piece of trash on their way, would pick it up and throw it in a garbage can. They do it because it is the right thing to do, and does not take that much extra effort.
Don’t take this too literally (yeah, depends on what kind of trash it is, it’s size, stinkiness, consistency, etc.), but the idea is that people go about their business towards some goal or task, and then they notice something that is not right, that is totally unrelated and not really in their way, but they just fix it anyway.

Software development is social. A team working together is kind of a small society with it’s own common beliefs and principles, practices and rituals. Wouldn’t the same “being a good citizen” principles of the human society apply to developing software and be beneficial to the team?
Robert C. Martin describes “the boy scout rule” and advocates to “Always check a module in cleaner than when you checked it out.”, as well as not “littering” in the first place. As he points out, it’s just “common decency”, and I think of it as “being a good citizen”. It should be applicable to everything we do in the society/team.

Working in a team, I frequently encourage the “picking up the trash” behavior that goes beyond the coding aspect. For example, one recent real life example of “trash” manifestation we’ve run into was when some testing of a functional change was not done, because “extra setup” was required that apparently would take days to achieve. Team decided to look for reasons and justifications of why that particular test was not necessary. Even if there was a perfectly reasonable justification of not performing more comprehensive test in this specific case, the “picking up the trash” behavior would be for the team to at least investigate why this resource intensive setup was needed to test the part of our product and to communicate to the team that we have a gap in our test environment setup. Maybe I am too picky, but seems like a reasonable expectation to me.

 

Picking up the team’s trash