Showing posts with label numbers. Show all posts
Showing posts with label numbers. Show all posts

Sunday, July 01, 2012

Adventures in Fibonacci Numbers

You may remember the Fibonacci numbers from math class. The Fibonacci sequence of numbers is easy to generate: begin with 0, 1. Then add the two previous numbers to get the next number in the sequence:
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144...
If you take the ratio of consecutive numbers in the sequence, you can see an interesting pattern:
0, 1, 0.5, 0.667, 0.6, 0.625, 0.615, 0.619, 0.6176, 0.61818, 0.617977, 0.618056...
Graphing these numbers, we can see that they seem to be honing in to one number -- increasingly accurate lower and upper bounds to a number that turns out to be roughly 0.61803, or more exactly 2/(sqrt(5)+1), the reciprocal of the Golden Ratio.

(In the above graph, I cut out the first few ratios so we could see the trend better.)

There are a lot of cool applications to for the Fibonacci sequence. It is often found in nature -- for example, the arrangement of seeds in a sunflower head, or the unfurling of a fern. There are also computer science data storage techniques, such as Fibonacci heap, that are derived from the sequence.

But a really cool use of Fibonacci numbers that I learned recently is the conversion between miles and kilometers. As it turns out, the ratio of miles to kilometers (0.621371192 mi/km) is pretty close to the ratio to which sequential Fibonacci numbers converge (0.61803), so we can use the sequence of Fibonacci numbers to roughly convert from miles to kilometers and vice versa. If we want to convert 3 miles to kilometers, for example, we simply take the next number in the Fibonacci sequence, so 3 miles is about 5 kilometers. (Doing the actual math, it's 4.828, which is pretty close.) Similarly, if we want to convert 13 kilometers to miles, then we take the previous number in the Fibonacci sequence, so 13 km is about 8 miles. (Again, doing the actual math, we obtain 8.078, so not bad!)

If you have a number that is not in the Fibonacci sequence, you can simply break it down into two Fibonacci numbers (there's a theorem that says you can do that for any integer!), and do the conversion on those two numbers and add the results back together. So, if you want to know what 60 miles is in kilometers, you break down 60 into 5 + 55, and convert them both to kilometers, so 8 + 89, to obtain an answer of 97 km. The actual answer is 96.56 km, so not too bad!

I plan to use this handy conversion factor in Australia to help me transition into understanding distance in kilometers. But also because it is just about the coolest thing I have seen in a long time!

Saturday, March 19, 2011

My Little Mathematician

Vinny loves numbers.  (I wonder where he got that from?)

He loves to count.  He will just start counting and keep going as high as he can, sometimes with humorous results (e.g., ninety-eight, ninety-nine, ninety-ten, ninety-eleven...).  He also loves to count people, or toys, or anything else he can figure to count.  When he is upset, I can take advantage of his proclivity for numbers, and calm him down by counting to 100 together.

He loves clocks and timers.  I was getting exasperated with him the other morning for wasting time when I was trying to get him ready for school, so I turned on the timer and he suddenly saw it as a challenge to beat the countdown.  He is really into telling time, and remarks on the passing of nearly every minute in the car on the way to school.  He's also fascinated by the thermometer in the car, and we have nearly daily conversations about the relative heat or cold of a range of temperatures.

His favorite book these days is 26 Letters and 99 Cents, (the 99 cents part, not the letters part).  It has pictures of coins (or, as he calls them, "coinks") that add up to the numbers 1 through 99 (skipping quite a few at the end, thank goodness!).  From this book he has learned to identify pennies, nickels, dimes, and quarters, and how the coins add up to various numbers.  I swear I have read him this book a countably infinite number of times.

We play games with numbers.  We count together, alternating who says the next number, so that one is counting evens and one is counting odds.  We find cool number patterns and remark on how cool they are (e.g., "Mama, it's 12:34 -- one two three four!"  "Cool!  Good observation, buddy!").  He loves to type or lay out a string of digits, and make me say what number it is (e.g., 8537832104 is 8 billion, 537 million, 832 thousand, 104).

It is really fun to enjoy numbers together.  I look forward to teaching him how to play Sudoku and Kenken when he is older (games he already wants to play but lacks the skills at this point).  I hope he never loses his enthusiasm for math!

Wednesday, January 12, 2011

Adventures in Calendars

Yesterday I was talking about the fact that sufficient time has elapsed from the arbitrarily set starting point of our calendar system such that the date was filled with ones.  I have always been very interested in numbers, and starting when I was about Vinny's age, calendars were a big obsession.  I had my own perpetual calendar which I regularly studied.  I pored over it, seeking patterns in the days and months -- for example, my sister's birthday in April predicted the day of the week upon which both my September birthday and Christmas would subsequently fall.

That's why, when I saw the following on a Facebook friend's status, I had to respond:
I'm not superstitious, but this year July has 5 Fridays, 5 Saturdays and 5 Sundays. This happens once every 823 years. This is called money bags. So, copy this to your status and money will arrive within 4 days. Based on Chinese Feng Shui. The one who does not copy.....will be without money.
This July will indeed have five Fridays, Saturdays, and Sundays, but this is a frequent occurrence -- once every seven years, on average.

If you think about it, you can see why.  The reason July will have five Fridays, Saturdays, and Sundays is because the month will start on a Friday this year.  The day of the week July starts on is determined by what day January 1 is and whether it is a leap year.  There are fourteen unique calendars -- the year can start on one of seven days, and times two because it could be a regular year or a leap year.

There are 365 days in a (non-leap) year.  A week consists of seven days, so there are 365/7 = 52 weeks plus one day in a year.  This means that the next year begins one day of the week later than the current year.  The year that follows a leap year begins two days later.  So, this year (2011) began on a Saturday, next year (2012, leap year) begins on a Sunday, and the year after that (2013) begins on a Tuesday.

Non-leap years that begin on Saturday produce Julys with five three-day weekends.  So do leap years that begin on Friday (because that extra day occurs before July).  Thus there are two out of the fourteen possible calendars that exhibit this phenomenon.

But at what frequency do these calendars occur?  After all, there could be some calendars that occur more frequently than others.  Obviously, leap calendars are less frequent than regular calendars, but all leap and regular calendars occur with the same frequency as their counterparts.  In fact, there is a 28-year calendar cycle that is easily generated.

Let's code the days of the week as follows: Sunday = 0, Monday = 1, Tuesday = 2, Wednesday = 3, Thursday = 4, Friday = 5, Saturday = 6.  We can denote the year starting with a given day of the week with the corresponding number.

If there were no leap years, the sequence would look like this:
0, 1, 2, 3, 4, 5, 6, 0, 1, 2, 3, 4, 5, 6...

However, there are leap years, so the sequence gets interrupted once every four years.  Let's denote leap years with a prime (') and the color red:
0, 1, 2, 3', 5, 6, 0, 1', 3, 4, 5, 6', 1, 2, 3, 4', 6, 0, 1, 2', 4, 5, 6, 0', 2, 3, 4, 5'
(at this point we start over with 0, 1, 2...)

If you count it up, there are three of each of the years 0 to 6 in this 28-year span, and one of each leap year.  So, if we count up the number of sixes and five-primes in the sequence (years with five three-day weekends in July), we get four out of 28, or one in seven.

So, I'm sorry, Facebook friend, but this phenomenon occurs on average once out of every 7 years, more than 100 times more frequently than you have asserted.  Your post will be as effective as all the other forms of feng shui -- in other words, completely ineffective.  But, at least it gave me something interesting to write about!

Tuesday, January 11, 2011

Happy 1/11/11!

It is a pretty exciting day on the calendar today for those of us who love numbers -- all 1's (and notice my time stamp -- 11:11 pm).  I enjoy patterns like this even though the only meaning is that sufficient time has elapsed since the arbitrary starting date of our calendar system such that there are a lot of ones in the date.

In other news, we have had a lot of snow lately (where by "a lot of snow" I mean about three inches).  This has caused sufficient havoc that they even closed my workplace on Monday, and Vinny's school has been out for three days this week (another snow day tomorrow).  It was Vinny's snack day tomorrow, and I baked up some blueberry-banana muffins for school, which I now have to do something with since school was cancelled.

Saturday, September 18, 2010

Happy Birthday to Me!

Today is my birthday!  I am 35, which is the product of two odd prime numbers (5 and 7).  I haven't been the product of two odd primes since a decade ago (25), and won't be again for 14 more years (49) 4 more years (39).* which is the product of twin prime numbers (5 and 7).  I was last the product of twin primes two decades ago (3 and 5), and I will never again be the product of twin primes unless I live to be 143 (11 and 13).

The next time my age will be the product of two prime numbers that are adjacent in the sequence of primes is when I am 77.

Just as something cool to think about, 5 and 7 are one less than and one more than 6, respectively.  Remember in algebra the product of x-1 and x+1?  It's x2-1.  Plugging in six for x, we have an alternate way of computing 5 times 7. Six squared is 36, and 36-1=35.  Cool, huh?

This formula is actually more handy for computing the squares of numbers without resorting to a calculator or long hand calculations, in my experience.  For example, what is 21 squared?  It's 20 times 22 plus 1: 440+1 = 441.  You can change the 1 to any integer a, and get a formula (x-a)(x+a) = x2-a2.  So what is 43 squared?  It's 40 times 46 plus 9: 1840+9 = 1849.


* Math is hard.  Also, I need a vacation.

Wednesday, September 09, 2009

Lucky Nines

Today is the ninth day of the ninth month of the year two thousand nine. And this post is dated 9:09 AM. Cool!

Tuesday, August 11, 2009

Su(doku), Meet Ken(Ken)

I'm on business travel this week, and in celebration (?) of that, I decided to get myself a book of sudoku. When I looked on the shelf, there was a book of another sudoku-like game called KenKen. So I bought that to try out on the plane.

KenKen is like sudoku in the sense that all the numbers have to appear exactly once in each row and column, but there are bolded "cages" in which the numbers have to make a number in the upper left corner of the cage by using the operator that follows the number (e.g. 17+ means the numbers have to add up to 17).

I read the basic instructions at the beginning of the book before starting to work on the puzzles. It has been so much fun to develop my own techniques for solving these puzzles. I look out for unique cages first: for example, a two-square cage with 3+ must contain a one and a two, and a two-square cage with 15x must contain a 3 and a 5. I then use the column- and row-uniqueness rules to solve the puzzle.

I am fast falling in love with KenKen puzzles. I did 15 of them while on the plane! Okay, so I've only done the easy puzzles, but they are so much fun that it made the ache in my hand and arm from writing too much totally worth it.
Reblog this post [with Zemanta]

Saturday, June 13, 2009

Today's Milestone

Today, I had the opportunity to cross a major threshold with our 2005 VW Beetle. Here is a snapshot of the odometer when I was stopped at a stoplight, just before it happened:



And here it is, a couple of blocks down the street, when we had just rolled over to the 20,000 mile mark:


No, I wasn't driving when I aligned the camera to take this picture. In fact, I was stopped at a stoplight. Unfortunately the first picture I took was too blurry, so I just left the camera where it was and took another picture while I was driving.

It was a particularly auspicious day for my odometer, because as I approached a gas station a few miles later, I noticed that the price for a gallon of gas (in cents) and the number on my trip odometer matched. I took it as a sign that I should fill up.

Thursday, April 30, 2009

Grammatical and Mathematical Tip of the Day

The local Humane Society is running an ad on the radio asking for help taking care of all the pets that have been abandoned by people who have lost their jobs and/or homes and can no longer afford to keep them. While this is a very important message, their phrasing really irritates me every time I hear the ad.

They say "a countless number of pets" have been abandoned. This is wrong on many levels:
  1. You cannot say "a countless number." It doesn't sound right. Go with either "countless pets" or "a number of pets."
  2. If you're going to say "a countless number" and ignore the grammar, then I'm going to get pedantic on you and say that the number of pets cannot be countless. You see, countless means "too many to be counted," and it is impossible to have a number of pets that is too large to be counted. Too large to count easily or quickly? Sure! But it can't be too large to be counted. Here's why:
There are only non-negative integer numbers of pets. That is to say, you can't have 3.7 pets or √3 pets or -28 pets. Therefore, the number of pets must be countable.

In other words, if you took all the pets and lined them all up, you could map them one-to-one with the set of natural numbers (non-negative integers), kind of like this: {(Fido, 0), (Goldie, 1), (Muffin, 2), (Fifi, 3), ...}. Therefore, we could take the size of the set of one-to-one mappings of pets and natural numbers, and determine the number of pets.

I understand that what they really mean is an unknown and probably very large number of pets that need help. But they should express it in a more mathematically accurate way, especially if they're counting on the support of mathematicians.

Tuesday, May 20, 2008

Happy World Metrology Day!

I hope that you all had a wonderful World Metrology Day. Today marks the anniversary of the signing of the Meter Convention, which created the International Bureau of Weights and Measures.

The theme for this year's celebration is measurement in sports. I discovered this (and the existence of World Metrology Day) back in October when I wrote a critique of the techniques used to measure downs in American football.
Anyhow, I hope you're all enjoying the fruits of metrology today as well as every day!

Wednesday, April 23, 2008

Power of Two Cake

I know you've been long awaiting a post on my powers-of-two themed cake.  Now that I'm less swamped by work, I can oblige.

But first, a little math.  (I know you all come here for the math!)  Astute commenter Rico mentioned his fascination with the sum of the series 1/2n (where n = 0, 1, 2, ...).  If you add 1 + 1/2 + 1/4 + 1/8 +..., the sum approaches but never reaches 2.  For a given n, the sum of the series equals 2-1/2n.  So for n=4, the sum equals 2 - 1/16 = 1+15/16.

I decided to represent this sum in cake.  In order to do so, I needed to bake two square cakes.  I had one 8" square cake pan, but I needed another, so I did as The Joy of Cooking suggested and squared off a rectangular cake with aluminum foil, putting dried beans on the other side:

The cake was my favorite cake recipe: cocoa devil's food cake from The Joy of Cooking.  You've seen me make this cake twice already, so I won't duplicate it here.

Here's how it turned out: the foil edge is a little uneven, but not bad.  I decided to use it as the base of the cake, to hide the unevenness.

My dad and Marvis were visiting, and Dad helped cut the cake into the proper pieces.  You can see him measuring the fractions with a measuring tape.
Here are the pieces after he was done.  So, if the other square represents one, then we have a 1/2, a 1/4, 1/8, and two 1/16s (one of which will not be used), concretely (or maybe, more aptly, chocolately) demonstrating the sum I showed above.
The frosting is a simple buttercream: butter + milk + powdered sugar + vanilla.  Here's the 1 + 1/2 + 1/4.
And here is the completed cake.
Next I decorated it with chocolate chips, to illustrate positive powers of two.  I put four chocolate chips on the smallest piece, four more on the part of the next sized layer that's showing, eight on the part of the next sized layer that's showing, etc.
So that ideally, if you look straight down on the cake, it just looks like it has 64 evenly-spaced chocolate chips on it.
Here's the cake from its most photogenic angle, complete with tissue paper flowers in the background:
I ate the leftover 1/16th piece while I was decorating the cake.  Then, when I served the cake, I had the 1/16th piece, Jeff had the 1/8th piece, and Dad and Marvis split the 1/4 piece.  We all had equal portions of cake and equal numbers of chocolate chips.  How cool is that?!?

I took the leftover cake to work with me the following Monday, so that Jeff and I wouldn't eat it.  I told everyone it was made in celebration of powers of two.  One of my colleagues emailed me with a message of "Great cake -- terrible reason!"  I had to laugh.

I hope you all enjoyed this mathematically-inspired cake as much as I did!

Wednesday, April 16, 2008

Power Winners!

Sorry, my vast blogging audience, for my involuntary hiatus. I had intended to announce the winners of the contest on the 8th (=23) but then my life and my job got in the way. So I decided that the 16th, which is two squared, squared, was a good alternative date. I'm future-posting this at 2:32 am, just to get a few extra powers of two in there. I may be awake at that time, but doing all the work I'm supposed to be doing rather than writing this post.

Anyhow, there were some terrific entries in the contest, and it was hard to decide who should win. In keeping with the theme, I will announce them in terms of powers of two.

22 place: A tie between Lost Clown and Rico, who describe their geektastic obsessions with cyclic groups and sums of 1/2N, respectively. You are my kind of people! When I get around to it, I will post pictures of my powers of two cake, which illustrates concretely (actually, chocolately) the fact that the sum of 1/2N is finite.

2
2-1 place: Rachel, with the bimetalic Toonie, her favorite coin. If you bring those coins south of the border, they'll be worth more than $2. Heck, at the rate the dollar's plummeting, they might be worth $22 American sometime soon!

2
1st place: Laura, who shared a favorite song featuring the powers of two. See, math and music share a special relationship!

and...

20th place: Pete, whose father, mother, and he are each twins. 'Cause that's just cool.

All those of you who are not my family members or colleagues have won a very exciting prize: your choice of a Tennessee ball cap or t-shirt.

Why? Because a) I live in Tennessee, and you don't, and b) Tennessee is a power-of-two themed state name. It has four (=22) unique letters, each of which appears in it a power-of-two times (T -- once; e -- four times; n and s -- twice each). And, depending on where in the state you live, it is pronounced with either two or four syllables (TEN-see or TEN-uh-say-ee).

If you want to collect your prize, simply leave a comment with your choice, the size (if applicable), and a mailing address to which I can send your prize. The comments are moderated, and I promise not to publish your contact information. If you don't feel comfortable claiming your prize, don't worry about it; that's less work for me.

Friday, April 04, 2008

The Power of Twos

Today is a great day to celebrate the number two! Let me tell you why:
  • The date: it's 4/4/08, or, as powers of two, it's 22/22/23.
  • The timestamp of this post: 4:00 (=22) p.m. EDT, or in the 24-hour clock, 1600 (=24) hours. (Attention my workplace: I created this post in the morning before leaving for work, and used the cool new scheduled posts feature in Blogger in draft.)
  • Ages: Vinny is one (=20), my nephew Byron is 4 (=22), I am 32 (=25), and my dad is 64 (=26). Also, as of tomorrow (i.e., in =20 days) Vinny will be one and a half, which is 20+2-1.
  • Events: I've had my new job for half a year now (=2-1). We've lived here for two (=21) years. My dad and Marvis have been married for four (=22) years (although next weekend it will be five). I took my prelim exam almost four years ago. (Maybe those two almost average out.)
  • Other interesting facts: Four (=22) of the digits 0-9 are powers of two (1, 2, 4, and 8). Also, if we wrote out all these interesting numbers in base two, they would all consist of a single 1 followed by a number of zeros equal to the number of the exponent (e.g., 25 = 1000002).
In honor of this glorious day, I will (of course) be baking a powers-of-two-themed cake. (Stay tuned for pictures.) But also, I wanted to have a little contest for my vast readership.

Within the next 64 hours (that's 2 days and 16 hours, for more powers of two!), leave a comment with your favorite/most interesting connection to powers of two. I will select the "best" 2N of them, where N could be 0 but might be more, and the winner(s) will not only gain fame but also an appropriately themed prize!

Deadline: 8:00 a.m. EDT, Monday, April 7, 2008
Your favorite/most interesting connection to powers of two.

Saturday, November 17, 2007

Adventures in Probability (or, Why I Did Not Gamble in Reno)

As you might surmise, I made it back safe and sound from Reno last night. I had a good time at the conference, but I am very glad to be home.

Reno (like the rest of Nevada, I imagine) is chock full of slot machines, video poker, keno games, and other opportunities to gamble. There were slot machines in the airport terminal. There are video gambling consoles at the bar in many restaurants. They had keno runners in the restaurants, so you didn't have to interrupt your eating in order to gamble. The cost of lodging is relatively cheap, because it is subsidized by the gambling in the casinos.

The casinos felt incredibly depressing to me. They are designed for optimal gambling output, I imagine. They have no windows and the lighting makes it feel like it's the middle of the night, even at noon. You lose all sense of the passing of time.

I am of the opinion that the lottery is a tax on stupidity and desperation. Sure, somebody wins, but the probability of that person being you is lower than the probability that you will get struck by lightning. Similarly, I don't see the appeal of gambling games of chance. Maybe it is because I am not much of a risk-taker. Sure, I take risks, but I mentally calculate the probability of success before I take the jump. And all I have to do is take one look at the opulence of the companies that run casinos to know that gambling is a risk not worth taking!

As I was eating breakfast yesterday, I was offered the "opportunity" to play $1 Keno. In this "game," you pick any three numbers from 1 to 80. The casino draws twenty numbers from that same range, and if your three numbers were all drawn, you can win $35 and a $15 meal voucher.

I did a quick back-of-the-envelope calculation of my odds. Roughly speaking, there is a 1 in 4 chance that any number I pick will be drawn. So the chances of all my numbers being drawn is roughly (1/4)3 = 1/64 ≈ 1.56%. I knew that this calculation was not exact, but it gave me enough information to know that this game was set up in favor of the house.

Every time you play, you pay them a dollar. Once in 64 games, they have to give you $35 plus the meal voucher. If you spent the entire thing, that's still only $50 that they've given out, whereas they've taken in $64, for a net profit of $14.

The exact odds are actually lower. Here's how to compute them:

Let's suppose that you're picking numbers in the range 1-80 and that the casino has already drawn their numbers. The chance that the first number you pick is one that they drew is 20/80, because there are 20 numbers that they drew out of a total of 80. Let's suppose that you got that one right. What are your chances of getting the next one right? Well, there are now 19 possible right numbers out of a total of 79 numbers (because we've picked one of the right numbers and we can't pick it again). So the probability that we got this one right is 19/79. Similarly, if we have been lucky so far and are picking the third number, the probability that we pick another drawn number is 18/78 (because we've picked two of the right numbers and we can't pick them again). So the exact odds are 20/80*19/79*18/78 = 6840/492,960 ≈ 1.39%.

I wrote a little program to illustrate how this keno game works. It's short enough that I'll include my source right here.

#include <stdio.h>
#include <math.h>

int main() {
  long i = 0, ngames = 10000000, nwins = 0, npicked2 = 0, npicked1 = 0;
  int nmatched = 0, ndrawn = 20, nmax = 80, rand0, rand1, rand2;

  for (i = 0; i < ngames; i++) {
    rand0 = rand()%nmax + 1;
    do {
      rand1 = rand()%nmax + 1;
    } while (rand1 == rand0);
    do {
      rand2 = rand()%nmax + 1;
    } while ((rand2 == rand0) || (rand2 == rand1));
    nmatched = ((rand0 <= ndrawn) + (rand1 <= ndrawn) + (rand2 <= ndrawn));
    if (nmatched == 3) {
      nwins++;
    } else if (nmatched == 2) {
      npicked2++;
    } else if (nmatched == 1) {
      npicked1++;
    }
  }
  printf("Out of %ld games, you won %ld of them, or %f percent\n", ngames, nwins, (100.0*nwins)/ngames);
  printf("You picked exactly two numbers correctly %ld times, or %f percent\n", npicked2, (100.0*npicked2)/ngames);
  printf("You picked exactly one number correctly %ld times, or %f percent\n", npicked1, (100.0*npicked1)/ngames);
  printf("You picked no numbers correctly %ld times, or %f percent\n", (ngames-nwins-npicked2-npicked1), (100.0*(ngames-nwins-npicked2-npicked1))/ngames);
  printf("You paid %ld dollars, and won back %ld dollars\n", ngames, 50*nwins);
  printf("For a profit of %ld dollars (for the casino)\n", ngames - 50*nwins);
  return 0;
}
And here's the output of my program:

theano:~/misc rebecca$ gcc -o keno keno.c -lm
theano:~/misc rebecca$ ./keno
Out of 10000000 games, you won 139116 of them, or 1.391160 percent
You picked exactly two numbers correctly 1389265 times, or 13.892650 percent
You picked exactly one number correctly 4307469 times, or 43.074690 percent
You picked no numbers correctly 4164150 times, or 41.641500 percent
You paid 10000000 dollars, and won back 6955800 dollars
For a profit of 3044200 dollars (for the casino)

So as you can see, if I play keno ten million times, I pay ten million dollars and earn back nearly $6.96 million (including the meal voucher), resulting in a profit of over $3 million for the casino. So they earn a 30% profit on my "purchase" of keno.

This was the simplest game that they offered, but it is illustrative of all the games in a casino. You can see why I did not play any games of chance.

For keno, they draw actual balls. I wonder what sort of random number generation techniques they use for the video gambling games. I am curious to know, because it might be possible to take advantage of flaws in the random number generation. I've also read about people who used a computer program to defeat roulette. They used their cell phone to gather information about the current velocity and deceleration of the wheel and compute in which quadrant the wheel will stop. They had enough success at it that they made over £1.2 million. Not bad for a night's work!

Without fancy equipment like those three had at their disposal, your chances of overcoming probability are slim at best. My advice: don't bother. Keep your money and spend it on something else.

Sunday, October 14, 2007

Adventures in Measurement

It's often important to quantify the properties of objects around us. For example, if we were selling apples, we would need to have a way to quantify them in order to set consistent prices. We might decide to quantify the apples by number, weight, or volume. Maybe we'll sell 3 for $1, or 50¢ per pound, or $5.00 per peck.

The study of the science of measuring is called metrology. Metrologists concern themselves with several important questions: How can we quantify the properties of objects? What units of quantity are meaningful, and how do we measure them? How do we apply these methods of measuring in the real world? How can we create measurement systems and apply them in a manner that helps regulate trade, taxation, safety, etc.?

How do we assure that measures are accurate? For example, if I'm pricing apples by weight, how can my customers be assured that they're getting a fair deal?

The scale I use to measure the weight of the apples is calibrated to a certain accuracy, which assures that the "pound" of apples I sell you isn't lighter than the "pound" of apples somebody else sells you, at least within a certain margin of error. The pound is officially defined as 0.45359237 kilograms, and the kilogram is officially defined in relation to an artifact, the International Prototype Kilogram (IPK). "The IPK is the kilogram... [it] is made of a platinum-iridium alloy and is stored in a vault at the BIPM in Sèvres, France." The United States owns three replicas of the IPK, housed at NIST (National Institute of Standards and Technology).

How accurate is the scale I use to measure apples? There are NIST standards which the scale would have to meet before I could use it to sell apples. At a minimum, it would have to be accurate enough that the uncertainty of the measurement (e.g., x lbs ± y lbs) would not impact the cost of the product. So, for an uncertainty of y when buying x pounds of apples, the cost of x+y lbs should be the same as the cost of x-y lbs.

How could that be, you may ask, since x+y ≠ x-y (unless y=0)? Well, when we deal with money, we don't pay fractions of a penny; merchants round to the nearest penny. In other words, if I charge 50¢/lb, then if I weigh out an amount of apples a that has a "true" cost c such that 49.5 ≤ c < 50.5. If c is defined by the previous inequality, and c = 50 a, then what are the upper and lower limits on a?

Well, if c = 49.5, then 50 a = 49.5, and therefore a = 0.99. At the other extreme, if c = 50.5, then 50 a = 50.5, and therefore a= 1.01. Thus my scale would need to be calibrated such that it measures one pound to within an accuracy of 0.01 pounds. If we convert this to relative error, its percent error must not exceed 1%.

For measuring apples, we would need a much higher accuracy than we would need for measuring the weight of trucks at a highway weigh station. We don't need to know the weight of the truck to within a hundredth of a pound, but we might still need the same relative error (i.e., 1%).

Also, sometimes we don't need to know the exact size of something, we just need a ballpark figure. For example, if we're trying to fit a couch into the back of a pickup truck, we just need to make sure that the couch is shorter than the length of the truck bed.

Other times, we want the most accurate measure we can get, but are limited by uncertainty or human error. For example, if we want to measure the length of an ant, but all we have to do it with is a yardstick, we will be limited by the size of the calibrations on the yardstick, and by the ability of our eyes to see something so small. If we had better equipment (i.e. a smaller, more finely calibrated ruler, and a magnifying glass) we would get a more accurate measurement.

One of the things that makes me roll my eyes every time I watch American football is the questionable way in which the status of the downs is sometimes determined. The referees have a chain of length ten yards, anchored by bright orange poles at each end, which is handled by the chain crew. The chain crew holds one end of the chain on the sideline at a point that is parallel to the location where the ball starts upon first down. The length of the chain is stretched along the sideline in the direction the team is driving, to determine whether the team has made a first down. Sometimes, when it is a close call, the chain crew moves the chain onto the field, and the referees measure with it, to see if the first down has been achieved. Sometimes, by a matter of inches, the team doesn't make the down.

There are some problems with the manner in which the status of the down is determined. We need to see the errors inherent in the system, which compound to make this measurement wrong.

First, the starting point at which the chain is placed is lined up visually with the location of the ball more than twenty-five yards away (In the NFL, the field is 160 feet wide). If the angle between the ball, the end of the chain, and the sideline is off by one tenth of a degree (i.e. it's 89.9° or 91.1°), then the difference between the starting point of the chain and the true starting point of the ball is off by more than 1.5 inches.

Second, when the down attempt is over, the referee generally places the ball in the place he believes is the point of farthest advance. How accurate is his placement? This is something I don't know, but it can't be more accurate than within a few inches. Let's say within three inches for the sake of argument.

Let's assume that the length of the chain is perfectly accurate. (It is probably off by some small factor; also, we are neglecting shrinkage or expansion due to temperature, but that's okay.) Even so, in the worst possible case, the starting point of the chain was 1.5 inches ahead of the starting point of the ball, and the referee put the ball down three inches behind the line of farthest advance, meaning that the difference between the true advancement and the measured advancement exceeded 4.5 inches. Given that a football is about 11 inches in length, that means the measurement could be off by more than 2/5ths of a football length! I've seen downs decided by less than that!

So what happens in football is that they think they have an accurate measurement of the lengths involved, but in reality, the fate of a team's advancement down the field is determined by little more than luck.

This is a real-life example of an organization needing a consultation with metrologists. If I were the football commissioner, that would be one of the first things I did.

Metrology is a fascinating subject. It's about more than weights and lengths; metrologists also determine how to measure volume, time, energy, work, and many more qualities. If I weren't a computational scientist, I think I'd want to be a metrologist. I hope you enjoyed this foray into metrology as much as I did!

Monday, September 10, 2007

Transitions

A week from today, I will begin my new job. Also on that day, Jeff will turn 2N+1.

A week from tomorrow, I will turn 2N. Also, my mother-in-law will turn 2N (where Nme is less than Nm-i-l).

Wednesday, March 14, 2007

Saturday, September 30, 2006

Interesting Facts

Still around... no sign of Vinny yet. I thought I'd take this time to tell you some interesting things I've learned this week.


  • Only 5% of babies are born on their due date.
  • Most first babies are born late. (Damn!)
  • Before a baby is born, its head drops into the mother's pelvis. This can occur anywhere between several weeks to just before the baby is born. As of my last doctor's appointment, he had not dropped yet.
  • If I push on my swollen ankle with my finger, it makes a depression that doesn't immediately go away -- kind of like those Swedish memory-foam mattresses they advertise on TV.
  • The super-duper computer doesn't like it if you try to open more than 128 files at once. Doing so causes your job to crash. In addition (something I figured out a few weeks ago), if your job requires more time than you requested, and the super-duper computer cuts it off, this results in a segfault and core dump. It took me a week to figure this out and after confirming with a colleague, this is indeed a "feature" of this machine (where "feature" really means "error"). They should really tell you these things so you don't spend a week trying to track them down.
  • Facts about North American telephone area codes:

    • Telephone area codes used to be of the following format: xyz, where x is between 2 and 9, y is either 0 or 1, and z is 1-9 if y is 0, or 2-9 otherwise. In the case of y = 0, the area code was supposed to cover an entire state, whereas if it was a 1, the area code was supposed to cover only a city or part of a state.
    • Area codes with the fewest clicks on a rotary phone were assigned to the biggest cities. Thus, Chicago was 312 (6 clicks -- just add up the digits), while Hawaii was given 808 (26 clicks -- the 0 is really ten clicks).
    • From 1962 to 1981, only two new area codes were added to the system.
    • The proliferation of fax machines and cell phones resulted in the need to abandon this system, which is why today a telephone area code is of the form xyz = [2-9][0-9][0-9]. There are some reserved exchanges that cannot be used for area codes, such as x11, and the numbers 8yy (y= [2-5]) are reserved for future toll-free expansion.
    • There are still some area codes left, but not as many as we would like. There are various plans for increasing the number of available telephone numbers, including adding an extra digit to distinguish between United States and Canadian area codes.
    • If you're a numbers junkie like me, and you want to read more about the telephone number system, I got all this information from Wikipedia's articles about the North American Numbering Plan.