BetterExplained http://betterexplained.com Learning shouldn't hurt. Let's share the insights that made difficult ideas click. Wed, 18 Nov 2009 02:52:35 +0000 http://wordpress.org/?v=2.8.4 en hourly 1 Why Do We Need Limits and Infinitesimals? http://betterexplained.com/articles/why-do-we-need-limits-and-infinitesimals/ http://betterexplained.com/articles/why-do-we-need-limits-and-infinitesimals/#comments Fri, 13 Nov 2009 07:00:55 +0000 Kalid http://betterexplained.com/?p=380 So many math courses jump into limits, infinitesimals and Very Small Numbers ™ without any context. But why do we care?

Math helps us model the world. We can break a complex idea (a wiggly curve) into simpler parts (rectangles):

But, we want an accurate model. The thinner the rectangles, the more accurate the model. The simpler model, built from rectangles, is easier to analyze than dealing with the complex, amorphous blob directly.

The tricky part is making a decent model. Limits and infinitesimals help us create models that are simple to use, yet share the same properties as the original item (length, area, etc.).

The Paradox of Zero

Breaking a curve into rectangles has a problem: How do we get slices so thin we don’t notice them, but large enough to “exist”?

If the slices are too small to notice (zero width), then the model appears identical to the original shape (we don’t see any rectangles!). Now there’s no benefit — the ’simple’ model is just as complex as the original! Additionally, adding up zero-width slices won’t get us anywhere.

If the slices are tiny but measurable, the illusion vanishes. We see that our model is a jagged approximation, and won’t be accurate. What’s a mathematician to do?

We want the best of both: slices so thin we can’t seem them (for an accurate model) and slices thick enough to create a simpler, easier-to-analyze model. A dilemma is at hand!

The Solution: Zero is Relative

The notion of zero is biased by our expectations. Is “0 + i”, a purely imaginary number, the same as zero?

Well, “i” sure looks like zero when we’re on the real number line: the “real part” of i, Re(i), is indeed 0. Where else would a purely imaginary number go? (How far East is due North?)

Here’s a different brain bender: did your weight change by zero pounds while reading this sentence? Yes, by any scale you have nearby. But an atomic measurement would show some mass change due to sweat evaporation, exhalation, etc.

You see, there are two answers (so far!) to the “be zero and not zero” paradox:

  • Allow another dimension: Numbers measured to be zero in our dimension might actually be small but nonzero in another dimension (infinitesimal approach — a dimension infinitely smaller than the one we deal with)
  • Accept imperfection: Numbers measured to be zero are probably nonzero at a greater level of accuracy; saying something is “zero” really means “it’s 0 +/- our measurement error” (limit approach)

These approaches bridge the gap between “zero to us” and “nonzero at a greater level of accuracy”.

Overview of Limits & Infinitesimals

Let’s see how each approach would break a curve into rectangles:

  • Limits: “Give me your error margin (I know you have one, you limited, imperfect human!), and I’ll draw you a curve. What’s the smallest unit on your ruler? Inches? Fine, I’ll draw you a staircasey curve at the millimeter level and you’ll never know. Oh, you have a millimeter ruler, do you? I’ll draw the curve in nanometers. Whatever your accuracy, I’m better. You’ll never see the staircase.”
  • Infinitesimals: “Forget accuracy: there’s an entire infinitely small dimension where I’ll make the curve. The precision is totally beyond your reach — I’m at the sub-atomic level, and you’re a caveman who can barely walk and chew gum. It’s like getting to the imaginary plane from the real one — you just can’t do it. To you, the rectangular shape I made at the sub-atomic level is the most perfect curve you’ve ever seen.”

Limits stay in our dimension, but with ‘just enough’ accuracy to maintain the illusion of a perfect model. Infinitesimals build the model in another dimension, and it looks perfectly accurate in ours.

The trick to both approaches is that the simpler model was built beyond our level of accuracy. We might know the model is jagged, but we can’t tell the difference — any test we do shows the model and the real item as the same.

That trick doesn’t work, does it?

Oh, but it does. We’re tricked by “imperfect but useful” models all the time:

  • Audio files don’t contain all the information of the original signal. But can you tell the difference between a high-quality mp3 and a person talking in the other room?
  • Computer printouts are made from individual dots too small to see. Can you tell a handwritten note from a high-quality printout of the same?
  • Video shows still images at 24 times per second. This “imperfect” model is fast enough to trick our brain into seeing fluid motion.

On and on it goes. We resist because of our artificial need for precision. But audio and video engineers know they don’t need a perfect reproduction, just quality good enough to trick us into thinking it’s the original.

Calculus lets us make these technically imperfect but “accurate enough” models in math.

Working In Another Dimension

We need to be careful when reasoning with the simplified model. We need to “do our work” at the level of higher accuracy, and bring the final result back to our world. We’ll lose information if we don’t.

Suppose an imaginary number (i) visits the real number line. Everyone thinks he’s zero: after all, Re(i) = 0. But i does a trick! “Square me!” he says, and they do: “i * i = -1″ and the other numbers are astonished.

To the real numbers, it appeared that “0 * 0 = -1″, a giant paradox.

But their confusion arose from their perspective — they only thought it was “0 * 0 = -1″. Yes, Re(i) * Re(i) = 0, but that wasn’t the operation! We want Re(i * i), which is different entirely! We square i in its own dimension, and bring that result back to ours. We need to square i, the imaginary number, and not 0, our idea of what i was.

Beware similar mistakes in calculus: we deal with tiny numbers that look like zero to us, but we can’t do math assuming they are (just like treating i like 0). No, we need to “do the math” in the other dimension and convert the results back.

Limits and infinitesimals have different perspectives on how this conversion is done:

  • Limits: “Do the math” at a level of precision just beyond your detection (millimeters), and bring it back to numbers on your scale (inches)
  • Infinitesimals: “Do the math” in a different dimension, and bring it back to the “standard” one (just like taking the real part of a complex number; you take the “standard” part of a hyperreal number — more later)

Nobody ever told me: Calculus lets you work at a better level of accuracy, with a simpler model, and bring the results back to our world.

A Real Example: sin(x) / x

Let’s try a conceptual example. Suppose we want to know what happens to sin(x) / x at zero. Now, if we just plug in x = 0 we get a nonsensical result: sin(0) = 0, so we get 0 / 0 which could be anything.

Let’s step back: what does “x = 0″ mean in our world? Well, if we’re allowing the existence of a greater level of accuracy, we know this:

  • Things that appear to be zero may be nonzero in a different dimension (just like i might appear to be 0 to us, but isn’t)

We’re going to say that x can be really, really close to zero at this greater level of accuracy, but not “true zero”. Intuitively, you can think of x as 0.0000…00001, where the “…” is enough zeros for you to no longer detect the number.

(In limit terms, we say x = 0 + d (delta, a small change that keeps us within our error margin) and in infinitesimal terms, we say x = 0 + h, where h is a tiny hyperreal number, known as an infinitesimal)

Ok, we have x at “zero to us, but not really”. Now we need a simpler model of sin(x). Why? Well, sine is a crazy repeating curve, and it’s hard to know what’s happening. But it turns out that a straight line is a darn good model of a curve over short distances:

Just like we can break a filled shape into tiny rectangles to make it simpler, we can dissect a curve into a series of line segments. Around 0, sin(x) looks like the line “x”. So, we switch sin(x) with the line “x”. What’s the new ratio?

\displaystyle{ \frac{sin(x)}{x} \sim \frac{x}{x} = 1 }

Well, “x/x” is 1. Remember, we aren’t really dividing by zero because in this super-accurate world: x is tiny but non-zero (0 + d, or 0 + h). When we “take the limit or “take the standard part” it means we do the math (x / x = 1) and then find the closest number in our world (1 goes to 1).

So, 1 is what we get when sin(x) / x approaches zero — that is, we make x as small as possible so it becomes 0 to us. If x became pure, true zero, then the ratio would be undefined (and it is at the infinitesimal level!). But we’re never sure if we’re at perfect zero — something like 0.0000…0001 looks like zero to us.

So, “sin(x)/x” looks like “x/x = 1″ as far as we can tell. Intuitively, the result makes sense once we read about radians).

Visualizing The Process

Today’s goal isn’t to solve limit problems, it’s to understand the process of solving them. To solve this example:

  • Realize x=0 is not reachable from our accuracy; a “small but nonzero” x is always available at a greater level of accuracy
  • Replace sin(x) by a straight line as a simpler model
  • “Do the math” with the simpler model (x / x = 1)
  • Bring the result (1) back into our accuracy (stays 1)

Here’s how I see the process:

In later articles, we’ll learn the details of setting up and solving the models.

Caveats: The Trick Doesn’t Always Work

Some functions are really “jumpy” — and they might differ on an infinitesimal-by-infinitesimal level. That means we can’t reliably bring them back to our world. It looks like the function is unstable at microscopic level and doesn’t behave “smoothly”.

The rigorous part of limits is figuring out which functions behave well enough that simple yet accurate models can be made. Fortunately, most of the natural functions in the world (x, x2, sin, ex) behave nicely and can be modeled with calculus.

Limits Or Infinitesimals?

Logically, both approaches solve the problem of “zero and nonzero”. I like infinitesimals because they allow “another dimension” which seems a cleaner separation than “always just outside your reach”. Infinitesimals were the foundation of the intuition of calculus, and appear inside physics and other subjects that use it.

This isn’t an analysis class, but the math robots can be assured that infinitesimals have a rigorous foundation. I use them because they click for me.

Summary

Phew! Some of these ideas are tricky, and I feel like I’m talking from boths ides of my mouth: we want to be simpler, yet still perfectly accurate?

This famous dilemma about “being zero sometimes, and non-zero others” is a famous critique of calculus. It was mostly ignored since the results worked out, but in the 1800s limits were introduced to really resolve the dilemma. We learn limits today, but without understanding the nature of the problem they were trying to solve!

Here’s the key concepts:

  • Zero is relative: something can be zero to us, and non-zero somewhere else
  • Infinitesimals (”another dimension”) and limits (”beyond our accuracy”) resolve the dilemma of “zero and nonzero”
  • We create simpler models in the more accurate dimension, do the math, and bring the result to our world
  • The final result is perfectly accurate for us

My goal isn’t to do math, it’s to understand it. And a huge part of grokking calculus is realizing that simple models created beyond our accuracy can look “just fine” in our dimension. Later on we’ll learn the rules to build and use these models. Happy math.

]]>
http://betterexplained.com/articles/why-do-we-need-limits-and-infinitesimals/feed/ 4
A BetterExplained Guide To Calculus http://betterexplained.com/articles/a-betterexplained-guide-to-calculus/ http://betterexplained.com/articles/a-betterexplained-guide-to-calculus/#comments Mon, 09 Nov 2009 05:37:30 +0000 Kalid http://betterexplained.com/?p=345 I’ve struggled with how to write about calculus. The standard techniques seem to be:

  • The “bag of formulas”: memorize ‘em and move on
  • The anal-retentive, rigorous treatment: written by math robots, for math robots!
  • The happy smiles tour: oversimplifications without examples (Calculus helps scientists solve problems!)

No, nyet, nein! I know what I need: intuition (What does it really mean?) followed by examples to back it up. I want a calculus series that lets calculus be calculus — wild, interesting, and fun.

The Explanatory Approach

I started writing in a vacuum, but realized I don’t remember calculus. I need a refresher — in fact, I need the insights I want to share! These articles are for us both (it’s what I’d want to relearn the subject), and here’s my approach:

  • As I study the chapters, I’ll share the insights I find and the concepts I struggled with.
  • I’ll sprinkle examples along the way. They’re a gut check, not the focus (if you want practice problems, the book has plenty).

It’s a lack of insights, not information, that makes calculus hard. We don’t need another course repeating the definitions that confused us the first time (Here’s the definition of a limit, again!).

We shouldn’t be struggling with the true meaning of a subject centuries after its invention. This is my intuition-laced hat in the ring.

The Calculus Articles

The goal is to be concise, informal, and fun. Dabble, skim and ignore the examples if needed — focus on the insights. The elegance of calculus can be appreciated progressively: we don’t need astrophysics to enjoy a starry night.

Learning Math

Calculus Overview

Small numbers: Limits and Infinitesimals

Measuring Changes: Derivatives

Accumulating Changes: Integrals

This post is the table of contents for the series. Happy math.

]]>
http://betterexplained.com/articles/a-betterexplained-guide-to-calculus/feed/ 9
Navigate a Grid Using Combinations And Permutations http://betterexplained.com/articles/navigate-a-grid-using-combinations-and-permutations/ http://betterexplained.com/articles/navigate-a-grid-using-combinations-and-permutations/#comments Tue, 20 Oct 2009 17:25:20 +0000 Kalid http://betterexplained.com/?p=205 Puzzles can help develop your intuition -- figuring how to navigate a grid helped me understand combinations and permutations.

Suppose you're on a 4 × 6 grid, and want to go from the bottom left to the top right. How many different paths can you take? Avoid backtracking -- you can only move right or up.

Spend a few seconds thinking about how you'd figure it out.

Insight: Convert Pictures To Text

When considering the possible paths (tracing them out with your finger), you might whisper "Up, right, up, right...".

Why not write those thoughts down? Using "u" and "r" we can write out a path:

r r r r r r r u u u u

That is, go all the way right (6 r's), then all the way up (4 r's). The path in the diagram would be:

r r r r u u u u r r

Using the text interpretation, the question becomes "How many ways can we re-arrange the letters rrrrrruuuu?"

Ah, the ubiquitous combination/permutation problem -- never thought it'd be useful, eh?

Understanding Combinations And Permutations

There's several ways to see combination and permutation problems. Once the first explanation clicks, we can go back and see it a different way. When trying to build math intuition for a problem, I imagine several mental models circling a core idea. Starting with one insight, I work around to the others.

Approach 1: Start The Same

Instead of having 6 rights at 4 ups, imagine we start with 10 rights (r r r r r r r r r r).

Clearly this won't do: we need to change 4 of those rights into ups. How many ways can we pick 4 rights to change?

Well, we have 10 choices for the first 'right' to convert (see the combinations article). And 9 for the second, 8 for the third, and 7 choices for the final right-to-up conversion. There are 10 * 9 * 8 * 7 = 10!/6! = 5040 possibilities.

But, wait! We need to remove the redundancies: after all, converting moves #1 #2 #3 and #4 (in that order) is the same as converting #4 #3 #2 #1. We have 4! (4 * 3 * 2 * 1 = 24) ways to rearrange the ups we picked, so we finally get:

\displaystyle{\frac{(10!/6!)}{4!} =  \frac{5040}{24} = 210 }

We're just picking the items to convert (10!/6!) and dividing out the redundancies (4!).

Approach 2: Just Use the Combination Formula

Halfway through that explanation, you might have realized we were recreating the combination formula:

\displaystyle{C(10,4) = 210}

That's the shortcut when you know order doesn't matter. However, sometimes I'm not sure whether I need a permutation or combination from the outset. While saying "Just use C(10,4)" may be accurate, it's not helpful as a teaching tool. Sometimes it helps to re-create the situation on your own.

Approach 3: Start Different

Here's another approach: instead of letting each r and u be interchangeable, label the 'right' moves r1 to r6, and the 'up' moves u1 to u4. How many ways can we re-arrange these 10 items?

This question is easy: 10! = 3,628,800 (wow, big number). We have 10 choices for the 1st move, 9 for the second, and so on, until we have 2 choices for the 9th and only 1 for the last. Cool.

Of course, we know that "r1 r2 u1 u2" is the same path as "r2 r1 u2 u1". We can shuffle the r's and u's in their own subgroups and the path will stay the same.

  • How many ways can we shuffle all 10? 10! = 3,628,800
  • How many ways can we shuffle 6 r's? 6! = 720
  • How many ways can we shuffle 4 u's? 4! = 24

So, we start with the total number of possibilities (10! = 3,628,800) and divide out the cases where we shuffle the r's (6! = 720) and the u's (4! = 24):

\displaystyle{10! / 6! / 4! = 10! / (6! \cdot 4!) = 210}

Neat! It's cool seeing the same set of multiplications and divisions in different ways, just by regrouping them.

Why is this useful?

One goal is to learn how problems can be transformed. Remember that painting of the old lady & young woman?

Do you see both? Can you switch between them? Isn't that cool?

Part of the fun of the grid-path puzzle is seeing how to look at a problem using a visual or text metaphor. The more math you learn, the more models you have available, and you can turn problems into each other.

This doesn't have to be "practical" -- it's fun to see how listing out paths can be be done simply using letters on paper.

In math lingo, problems which can be converted to each other are *isomorphic". Mathematically, they may be the same -- but from a human perspective, one may be easier than the other (like seeing the old woman or young woman first).

For the grid puzzle, we used each perspective where comfortable:

  • Visualizing the grid to understand the general problem and see a single path.
  • Write the paths as text to see the general format of all paths & an easy method to enumerate them

And that's the key lesson: It's completely fine to use one model to understand the idea, and another to work out the details. Math becomes difficult when we think there's only one way to approach it.

Variations and Extensions

Now that we've been building our mental models, let's tackle some harder problems.

Imagine your "grid" is actually in 3 dimensions. This is harder to draw, but the text representation keeps on working. Let's say we have a cube (x, y and z dimensions) that is 5 units long on each side. How many paths are there from one corner to its opposite?

Hrm. In this case, I might try the second approach, where we listed out all the possibilities. Assume we label each move differently: we have 5 uniquely-labeled moves of each type (x1-x5, y1-y5, z1-z5). We can arrange these in 15! ways (it's a huge: 1.3 trillion). But, we need to remember to divide out the redundancies for each dimension.

There are 5! ways to rearrange the 5 identical motions in each direction, and we divide them out:

\displaystyle{15! / 5! / 5! / 5! = 15!/(5!\cdot 5!\cdot 5!) = 756,756}

Wow, that's huge number of paths on a small cube! Earlier today you'd have trouble with the question -- I know I would have. But starting with the grid example and converting it to text, we've beefed up our model to handle 3 dimensions. Paths in four, five our 10-d should be no problem.

Redefining The Problem

Here's the fun part: instead of changing how we see the solution, why not change the problem? What else could "Find paths on a grid" represent?

  • Trap platform: Let's say you're making a set of trapdoors 4 × 6, with only 1 real path through (the others drop you into a volcano). What are the chances someone randomly walks through? With a 4×6 it's 210, as before. With a 12×12 grid it's 24!/12!12! = 2.7 million paths, with only 1 correct one.
  • Order of operations: Suppose you have 10 sets of exercises to do: 4 identical leg exercises, and 6 identical arm exercises. How many different routines can you pick? This is the same as navigating the path, except the axis labels are "legs" and "arms" instead of "right" and "up".
  • Random walk. Suppose we know an object moves randomly up or right. What's the chance it hits our desired endpoint after 10 steps? Well, there are 2^10 = 1024 ways to move up or right (pick "u" or "r" 10 times), and 210 ways to get to our exact destination. Therefore, you can expect to hit our spot 210 / 1024 = 20.5% of the time!

Here's a calculator to play with a few variations:

Onward and Upward

Puzzles are a fun way to learn new mental models, and deepen your understanding for the ones you're familiar with. While I might "know" combinations and permutations, it's not until I recognize them in the wild do I feel really comfortable. Ideas do no good sitting inside your head like artifacts in a museum -- they need to be taken out and played with. Happy math.

]]>
http://betterexplained.com/articles/navigate-a-grid-using-combinations-and-permutations/feed/ 9