December 28, 2005

Yak Shaving Razor -- Math Hacks


Yak Shaving -- [MIT AI Lab, after 2000: orig. probably from a Ren & Stimpy episode.] Any seemingly pointless activity which is actually necessary to solve a problem which solves a problem which, several levels of recursion later, solves the real problem you're working on. (From the on-line hacker Jargon File)

#68 -- The De Finetti Game The De Finetti Game is a method to gauge someone’s confidence in the chances of a given event occurring by measuring it against a lottery with a known probability. Say for example a friend claims he is 95% sure he aced a test. Is he really that confident? Offer him a hypothetical choice. He can either get the result of the test, and if he aced it, he wins one million dollars, or he can pick a ball out of bag. There are 90 red balls and 10 blue in the bag, and if he picks a red ball then he wins the million. Now if he doesn’t choose his test score then he is at most 90% confident.

Now tell him that there are now 70 red balls in the bag and 30 black ones. If he answers that he would rather wait on the results of the test rather than draw, then he is between 70-90% sure of the outcome. You can keep adjusting the ratio of red to blue balls until he chooses the test score to find out how confident he really is. (Source: Amir D. Aczel’s Chance; HT: Poker Words)

♦ ♦ ♦ ♦ ♦

#86 How to Succeed in Love -- How do you know when you’ve met Mr./Ms. Right? How do you determine who, among the available range of candidates in your life, is the person you should marry? The best way to increase the chances that you’ve made the right decision is to follow this simple sampling strategy:

You will maximize your probability of finding the best spouse if you date about 37 percent of the available candidates in your life and then choose to stay with the next candidate who is better than all the previous ones.

Suppose that during your single years you will date 100 candidates for marriage. If you marry the first one that comes along then your chance of finding the best of the lot is only 1/100. The same probability is applicable if you date 99 of them and marry the last one. The chance that the last candidate is the best choice is only 1 in 100. Following the formula allows you to sample the options and increases the likelihood that you will choose the best of the available choices. (Note: This strategy also works for similar choices, such as buying a house.)

(HT: Amir D. Aczel, Chance)

♦ ♦ ♦ ♦ ♦


#108 -- "Measuring probabilities," says Amir Aczel, "is a simple as counting." Simply count the possibilities of an event and divide this number by the total number of possibilities (assuming the possibilities are equally likely). For example, what is the probability of rolling an even number on a six-sided die? Since there are three even numbers (two, four, six) out of six equally likely numbers, the answer is 3/6 = 1/2, or fifty percent. What if you have a deck of fifty-two playing cards, what is the probability of drawing an ace? Since there are four aces out of fifty-two cards equally likely to be chosen, the probability of an ace is 4/52 = 1/13 = 0.0769, or about eight percent.

♦ ♦ ♦ ♦ ♦


#118 -- With this trick, you will be able to multiply any two numbers from 11 to 19 in your head quickly, without the use of a calculator:

  • Take 15 x 13 for an example.

  • Always place the larger number of the two on top in your mind.

  • Then draw the shape of Africa mentally so it covers the 15 and the 3 from the 13 below. Those covered numbers are all you need.
  • First add 15 + 3 = 18

  • Add a zero behind it (multiply by 10) to get 180.

  • Multiply the covered lower 3 x the single digit above it the "5" (3x5= 15)

  • Add 180 + 15 = 195.

With a few minutes practice you should be able to multiply up to 20 x 20 in your head. (It's actually easier than it sounds.) (HT: Fantastic Math Tricks)

♦ ♦ ♦ ♦ ♦

#128 -- To multiply by 9:

(1) Spread your two hands out and place them on a desk or table in front of you.
(2) To multiply by 9 by 3, fold down the 3rd finger from the left. To multiply by 4, it would be the 4th finger and so on.
(3) The answer (i.e., 9 x3 = 27) is read by counting the fingers on the left hand (the two fingers on the left of the folded down finger) and then the ones on the right (the 7 fingers on the right of the folded down finger).

This works for anything up to 9x10.

♦ ♦ ♦ ♦ ♦

#138 -- Square 2 Digit Number: UP-DOWN Method

Square a 2 Digit Number, for this example 37:

* Look for the nearest 10 boundary

* In this case up 3 from 37 to 40.

* Since you went UP 3 to 40 go DOWN 3 from 37 to 34.

* Now mentally multiply 34x40

* The way I do it is 34x10=340;

* Double it mentally to 680

* Double it again mentally to 1360

* This 1360 is the FIRST interim answer.

* 37 is "3" away from the 10 boundary 40.

* Square this "3" distance from 10 boundary.

* 3x3=9 which is the SECOND interim answer.

* Add the two interim answers to get the final answer.

* Answer: 1360 + 9 = 1369

With practice this can easily be done in your head.

♦ ♦ ♦ ♦ ♦

#148 -- Determining the Probability of Independent Events -- Everyone knows that the chances of rolling a three on a six sided dice is 1/6th or .16. But what is the probability of rolling threes twice in two rolls? To determine the probability of independent events (events where the probability of one does not affect the other) simply multiply their two probabilities together. So for our example, the probability of rolling two threes in two rolls of the die would be 1/6 x 1/6 = 1/36. Out of 36 rolls, on average you will roll two "threes" once. (Source: Chance, Amir Aczel)

♦ ♦ ♦ ♦ ♦

#158 -- Need to calculate a 15% tip? Follow these steps:

1. Choose a 2-digit number. 2. Multiply the number by 3.
3. Divide by 2.
4. Move the decimal point one place to the left.

Example:

1. If the number selected is 43:
2. Multiply by 3: 3 × 43 = 129
3. Divide by 2: 129/2 = 64.5
4. Move the decimal point one place to the left: 6.45
5. So 15% of 43 = 6.45.
♦ ♦ ♦ ♦ ♦

#168 -- The Rule of 72 provides a useful heuristic for determining how long it takes to double your money on an investment (assuming the interest is compounded annually).To find the number of years required to double your money at a given interest rate, divide the interest rate into 72. For example, if you want to know how long it will take to double your money at eight percent interest, divide 8 into 72 and get 9 years. You can also use it in reverse. For example, if you want to double your money in six years, just divide 6 into 72 to find that it will require an interest rate of about 12 percent. (Note: This "rule" is accurate as long as the interest rate is less than about twenty percent. At higher rates the error starts to become significant.)

♦ ♦ ♦ ♦ ♦

#178 -- Multiply two numbers near 10 in your head. For example, we'll mulitply 14 x 13:

First, subtract 10 from both 14 and 13: 14 - 10 = 4; 13 - 10 = 3

Next, add either number's difference from the opposing number from the equation. In this example, you can either add 4 to 13 or 3 to 14 (you'll get the same answer either way): 4 + 13 = 17; or 3 + 14 = 17

This number is then multiplied by 10 (the reference point we've been using): 17 x 10 = 170

The two differences are then multiplied together: 3 x 4 = 12

Finally, you add this number to the previous answer: 170 + 12 = 182

Thus, the answer to 14 x 13 is 182!

♦ ♦ ♦ ♦ ♦

#188 -- How to value an investment -- The more likely or unlikely an outcome, the more or less you (should) value it. Suppose, for instance, someone offers you an investment that has a 30% chance of earning $1000, a 20% chance of earning you $2000, and a 50% chance of losing you $400 dollars. How much is the investment worth (i.e., how much can you expect to make on this investment)?

The answer is found by adding the sum of the products of the values and their probabilities. For example:

0.3 x 1,000 x 0.2 x 2,000 + 0.5 x (-400) = $500

Over the long term you can expect to make, on average, $500 every time you invest. (HT: Amir D. Aczel, Chance)

♦ ♦ ♦ ♦ ♦

See also: The Yak Shaving Razor Archives. New additions to YSR are added each Wednesday.


comments
Steve writes:

1

Actually #108 and #68 are the same thing. DeFinetti was a Bayesian and his game is for eliciting prior probabilities. If I'm not mistaken DeFinetti is known for having said "probability does not exist." (If it wasn't DeFinetti it was Savage.) So measuring probabilities is not merely as "simple as counting".

posted on 01.01.2006 12:31 PM
Joe Carter writes:

2

Steve,

Actually #108 and #68 are the same thing.

I'm not sure what you mean by "same thing." #68 refers to Baynesian subjective Bayesianism while #108 is an example of finite frequentism. Didn't you argue before that the two interpretative frameworks are not only different but incompatible?

posted on 01.01.2006 1:06 PM
Steve writes:

3

Actually I should have written "refer to the samething". De Finetti was a big gun in the Bayesian inference field. His work dealt with how to come up with prior probabilities. You can't always use the method that Aczel advocates. Once again we see the limitations of the Classical/Frequentist concepts.

As for the incompatibility, it does relate in part to the concepts of probability, but that doesn't mean that one can't use Aczel's methods in some instances if one is a Bayesian. The differences run throughout the entire approach to inference.

posted on 01.02.2006 11:53 PM
Mark Daniels writes:

4

Joe:
As a decidedly right-brained person, I've got to tell you that the scheme of using the shape of Africa to cover numbers and then adding those still visible and then doing whatever else he says to do, seems like a frightful waste of brain cells. I just pull out a scratch pad.

But this is all very fun.

By the way, check out Jan's take on #86 How to Succeed in Love. She's at TheViewfromHer. Funny.

Mark Daniels

posted on 01.08.2006 6:35 AM
Mike Furir 521 writes:

5

Mike Furir Mike 82

posted on 03.07.2006 6:18 AM