Tuesday, November 10, 2015

Math in Your Head

I often find myself doing math in my head, and people are shocked and amazed that I can quickly come up with an answer without using a calculator.  I should probably be the one who is shocked that so few people can do simple math in their heads.  Then again, someone who does high level mathematics is not necessarily good at arithmetic.

I suppose the logic comes easy for a programmer, but the trick to solving complex problems is to break them down into simpler operations.

Multiplication

Multiplication is really addition, multiple times.

10 x 3 = 10 + 10 + 10 = 30

One common problem is percentages.

Percentage

Percentage is really a division or multiplication problem, depending on how you look at it.

  • What is 20 percent of 120?

There are several ways to approach such problems, and I don't always use the same method.

Method 1

Sometimes it is easier to break things up into 10's 100's or multiples of 2.

120 = 100 + 20

So work on each portion separately, and combine them later.  First, find 20% of 100 = 20.  Very easy.

Then there is the remaining portion of the problem, which is to find 20 percent of 20.  For this, I like to use multiples of ten.

20 = 10 x 2

20% of 10 = 2.  This is basically the same as the original portion, except the decimal point is shifted.  Any X percent of 100 is aways X.  Here we just imagined that 10 was 100, and when we got the answer of 20, we just shifted back to come up with 2.

OK, so far we have 20% of 10, but there are two tens, so we just have to multiply by 2:

20% of 20 =
(20% of 10) + (20% of 10) =
2 + 2 = 4

To put it all together, we have
20 + 4 = 24

Method 2

We want 20%, so we multiply by .2

120 * .2

Not sure how to multiply fractions, so we shift the decimal point

2 * 12 = 24

Method 3

Find 20% off of the original price

Multiply by the opposite of the desired percentage.

We want 20% off (100% - 20% = 80%), so we multiply by 80%

120 * .8

Not sure how to multiply fractions, so we shift the decimal point

8 * 12 = 96

Then, if we wanted the original 20%, we could subtract the result from the original amount.

120 - 96 = 24