This Place is Taken

Thursday, April 30, 2015

How does the calculator percent key work?

 

The Windows calculator percent sign works the same way as those cheap pocket calculators (which are often called four-function calculators even though they have around six function nowadays). What you first have to understand is that the percent key on those pocket calculators was not designed for mathematicians and engineers. It was designed for your everyday person doing some simple calculations. Therefore, the behavior of the key to you, an engineer, seems bizarrely counter-intuitive and even buggy. But to an everyday person, it makes perfect sense. Or at least that's the theory.

Let's look at it from the point of view of that everyday person. Suppose you want to compute how much a $72 sweater will cost after including 5% tax.¹ Pull out your handy pocket calculator² (or fire up Calc if you don't have a pocket calculator) and type

72 + 5% =

The result is 75.6, or $75.60, which is the correct answer, because 5% of 72 is 3.6. Add that to 72 and you get 75.6.

Similarly, suppose that sweater was on sale at 20% off. What is the sale price?

72 − 20% =

The result is 57.6 or $57.60. This is the correct answer, because 20% of 72 is 14.4. Subtract that from 72 and you get 57.6.

You can chain these percentage operations, too. For example, how much will you have to pay for that 20%-off sweater after adding 5% tax?

72 − 20% + 5% =

The result is 60.48. A mathematician or engineer would have calculated the same result via the equivalent computation:

72 × 0.80 × 1.05 =

Okay, now that we see how the calculator product designer intended the percent key to be used, let's look at what the calculator engineer it has to do in order to match the specification. When the user enters A + B % =, the result should be A × (1 + B/100) or A + (A × B/100) after you distribute the multiplication over the addition. Similarly, when the user enters A − B % =, the result should be A × (1 − B/100) or A − (A × B/100).

Aha, the calculator engineer says, we can achieve this result by defining the percent key as follows:

When the user enters a value, an operator, a second value, and then the percent key, the first two values are multiplied and the product divided by 100, and that result replaces the second value in the ongoing computation.

Let's walk through that algorithm with our first example.

You type
Remarks

72
First value is 72

+
Operation is addition

5
Second value is 5

%
72 × 5 ÷ 100 = 3.6

3.6 becomes the new second value

=
72 + 3.6 = 75.6, the final result

If you watch the display as you go through this exercise, you will even see the number 3.6 appear in the display once you press the % key. The percentage is calculated and replaces the original value in the ongoing computation.

This algorithm also works for the chained percentages.

You type
Remarks

72
First value is 72


Operation is subtraction

20
Second value is 20

%
72 × 20 ÷ 100 = 14.4

14.4 becomes the new second value

+
72 − 14.4 = 57.6, intermediate result

57.6 is the new first value

Operation is addition

5
Second value is 5

%
57.6 × 5 ÷ 100 = 2.88

2.88 becomes the new second value

=
57.6 + 2.88 = 60.48, the final result

This even works for multiplication and division, but there is much less call for multiplying or dividing a number by a percentage of itself.

500 × 5 % =

The result of this is 12,500 because you are multiplying 500 by 5% of 500 (which is 25). The result of 500 × 25 is 12,500. You aren't computing five percentof 500. You're multiplying 500 by 5% of 500. (It appears that the authors of this Knowledge Base article didn't consult with the calculator engineer before writing up their analysis. The percent key is behaving as designed. The problem is that the percent key is not designed for engineers.)

What if you want to compute 5% of 500? Just pick a dummy operation and view the result when you press the percent key.

500 + 5 %

When you hit the percent key, the answer appears: 25. You could've used the minus key, multiplication key, or division key instead of the addition key. It doesn't matter since all you care about is the percentage, not the combined operation. Once you hit the % key, you get your answer, and then you can hit Clear to start a new calculation.

Monday, April 27, 2015

More One - Ways in Bangalore

 

I was out for a ride Sunday night, and almost got a ticket, because I didn't know they had converted the two lane either way traffic to a two lane one way in Madiwala.

To decongest traffic on Hosur Road, the city police have put some restrictions on the traffic flow at Silk Board and Madiwala junctions from Sunday.

While motorists will be allowed to go from Silk Board Junction to Sarjapura Road Junction and Madiwala check-post, movement of vehicles going to Hosur Road from Madiwala check-post will be restricted.

Vehicles coming from Sarjapura Road junction can go up to Krupanidhi College junction, take a right turn and join Madiwala Santhe Beedi to reach Madiwala Police Station junction-Total Mall junction, Silk Board junction to proceed to Hosur Road.

Motorists going towards Maruthi Nagar can take a right turn at the Koramangala water tank junction, take a right at the Kendriya Sadan and proceed further.

Traffic going towards Madiwala and Silk Board from Koramangala BDA Complex by taking a left turn at Koramangala Water Tank junction, reach Krupanidhi College junction and reach Hosur Road via Madiwala Santhe Beedhi.

 

pic_article_Traffic_rearrangement_at_Adugodi_and_Madiwala

Pencil Sharpening is a Serious Business

 

Its amazing what you run into on the internet. Today I found out that somebody has opened up a very active business on the internet with the sole intention of sharpening…you guessed it, pencils ! I still don't recall how I landed there, but one thing led to another, and I was on David Rees's website: http://www.artisanalpencilsharpening.com/

Here is a guy who sharpens pencils for a living. And he dead serious about it. You can mail him your pencils, and he will mail you back the sharpened pencils as well as the shavings !

Check out this video.

 

Here's another one.

Saturday, April 25, 2015

A Better Windows clock display

 

The Windows system has always had an alway on, clock display on the task bar. By default, it displays only the time. You can customize this so that it diplays more details. For instance, here is what my clock displays:

tmp9C4B

The top line shows time in AM/PM format. The bottom line displays the day and date in detail format. Even the date display in Explorer reflects this detail display.

tmp669F

Here is how you can have this display format your Windows machine:

1: Left click on your clock and choose "Change date and time settings". After that, click on "Change Date and Time" button.

tmpD98D

2:  Click on "Change Calendar Settings", and choose these settings for Date:

tmpDA0B

Short Date: dddd, MMM dd, yyyy

Long Date: dddd, MMM dd, yyyy

3: Click OK all the way back.

Thats it ! You may have to resize the controls on your taskbar to break the clock display into two lines.