MathJax

Showing posts with label math. Show all posts
Showing posts with label math. Show all posts

Monday, September 29, 2014

Your MOM's a determinant

To my sister and her classmates, so that their math homework can be just a little less depressing.

Here are a few perfectly reasonable questions from high school sophomores about finding the determinant of a matrix:

  • What are they good for?
  • Who cares?
  • This is stupid and I hate you.
Let's address these questions. The first stop in the 21st century is, of course, Wikipedia:
The determinant provides important information about a matrix of coefficients of a system of linear equations, or about a matrix that corresponds to a linear transformation of a vector space. In the first case the system has a unique solution exactly when the determinant is nonzero; when the determinant is zero there are either no solutions or many solutions. In the second case the transformation has an inverse operation exactly when the determinant is nonzero. A geometric interpretation can be given to the value of the determinant of a square matrix with real entries: the absolute value of the determinant gives the scale factor by which area or volume (or a higher-dimensional analogue) is multiplied under the associated linear transformation, while its sign indicates whether the transformation preserves orientation. Thus a 2 × 2 matrix with determinant −2, when applied to a region of the plane with finite area, will transform that region into one with twice the area, while reversing its orientation.
Determinants occur throughout mathe
matics. The use of determinants in calculus includes the Jacobian determinant in the substitution rule for integrals of functions of several variables. They are used to define the characteristic polynomial of a matrix that is an essential tool in eigenvalue problems in linear algebra. In some cases they are used just as a compact notation for expressions that would otherwise be unwieldy to write down.
Ugh, I think I see the problem. These are, actually, really good reasons to be familiar with determinants, but most of these concepts are held back until a college-level Linear Algebra course. On that day when these sophomores take Linear Algebra, they will realize the brilliance of determinants--but they're depressed now. Let's try to do better than that.

A matrix's determinant tells you
  • whether a matrix is invertible, which tells you
    • whether you can undo a matrix multiplication operation
    • whether you can solve a system of equations based on that matrix
  • what happens to a vector when it's multiplied by the matrix:
    • How much does it stretch?
    • Does it flip inside out?
    • There could also be some rotation of the vector, but if we only care about its size and inside-outness, we can save the trouble of matrix multiplication if we know the determinant.
This, of course, presupposes that you care about matrix multiplication, which is itself a worthy topic for a similar post.

In addition to what a determinant tells you about a matrix, there are a few mathematical formulas that can be succinctly represented as computing the determinant of a matrix. This could save space on a cheat sheet for a future physics test. This is a nice collection of determinants doing cool things.

Look, this determinant is doing volume!

The procedure for computing the determinant of a 3x3 or larger matrix illustrates a key idea in mathematics: recursion. You find the determinant of a large matrix by finding the determinants of smaller submatrices and combining the results. This pattern of a procedure for solving a problem including running the procedure against a smaller version of the current problem is called recursion and pops up everywhere once you start looking for it.

The most important thing you get out of studying determinants in high school...


Drumroll, please.

It's tedious and awful.

You're insane.
Let me explain. Why is it important for high school students to be tortured with tedious, awful plug-n-chug work? Because it's a strong motivator for the self-study of computer programming.
That came out of nowhere.
Let me explain.

If you're in high school today, you've never known a planet without personal computers. You probably spend more time on tablets than you do watching TV. More and more data about what you do every day are winding up in computer systems. More and more jobs require the ability to analyze and manipulate data. Literacy was to the 20th century as digital literacy is to the 21st. Until computer programming is part of a normal curriculum, you're on your own to learn this stuff.

Computing the determinant of a large matrix is the sort of "hard" that mankind invented computers to solve: lots of simple steps strung together. You won't be hired to find the determinant of a matrix because we have software that does that. There are lots of other computational activities taken over by computers as well--pretty much any well-defined useful task that can be broken down into simple steps. This is a good thing because it lets people focus their time and energy on the next problem (there's always a next problem). The lessons you learn writing software to help you cheat on your math homework will be applied again and again throughout your career.

Knowing all this won't make finding determinants less tedious, but hopefully it won't seem like entirely random torture. Good luck!

Monday, December 16, 2013

Brain90X: Thoughts from "Characteristics of Games" and "Thinking, Fast and Slow"

There's a disturbing correlation between getting older and losing the ability to learn new things. Since learning new things is one of my favorite things in the whole wide world, I'd like to keep this ability as long as possible and increase this ability to its full potential. My plan? Games.

Here is my 3am rationale from last month, cleaned up slightly on a Saturday afternoon:

Learning new things takes a lot more energy than applying what's been learned. In a modern life, we're able to learn enough after a few decades to subsist mostly on applying what we have learned with a minimal amount of new learning required. Once we can pay our bills simply by applying learned knowledge, we aren't so motivated to go out and engage in the relatively mentally taxing enterprise of learning new things. My theory, then, is that the declining ability to learn new things with age is not a biological inevitability, but a function of atrophy once we've learned enough to pay our bills. What we need is a way to exercise the learning part of our brain so that it stays with us in perpetuity.

Climbing the heuristics ladder of a good game is the best kind of exercise you can give your brain. A "heuristics ladder" for a game is the set of increasingly complex set of rules-of-thumb you build up for yourself to let you know how well you're doing ("state heuristics") and what choices you make to maximize your chances of victory ("directional heuristics"). This type of mental activity is very different from memory recall and applying "street smarts."

Directional heuristics: Who's winning?
The first type of cheap, fast brain activity is memory recall: Erudition. The process of rote learning, while oft-scorned, is critical to competently functioning in a field. If your brain is a computer system, this is similar to "warming up your cache." (What is a cache?) I like to think of memory recall as "book knowledge." Literacy is the practice of transferring this type of information between humans (books, speech, this blog, plugs from The Matrix). (An interesting tangent is to note that body language and flirtatious subcommunication don't fit here at all. In fact, this information is background noise for the reality of most social interactions.)

Literacy of the future!
The second kind of cheap, fast brain activity is "street smarts": Worldliness. Street smarts assess both nouns and game strategies based on what has come before. Street smarts come from a statistical learning style where you observe classified and regressed examples in order to assess a new instance. In the computer world, this is how most kinds of machine learning work. Street smarts can be partially transferred through literacy as well--if it's done right and the source is trustworthy.

This leaves us with the most risky and expensive operations our brains perform: experimentation and creativity while climbing heuristics ladders: Cleverness. This is where the brain that comes up with new things to try out, where the brain sets up new literacy caches for information and aggregate data stores for examples. The more novel the situation, the more this part of the brain is engaged. It creates, tests, imagines, evaluates, and combines strategies. It working at its hardest when the answer is not available from recall or street smarts. Recall and street smarts are automatically and invisibly applied first in understanding a situation (thus introducing personal biases and new approaches). Heuristic ladder climbing is difficult, and our brains automatically take shortcuts to get to a passable approach.

This difficulty is a good thing for the brain. This is how the brain hits the gym to stay in shape. What an over-trained brain looks like is an exercise in imagination left to the reader.

Climbing heuristics ladders can itself be a function of literacy (chess books) and street smarts (what has worked for you and others in the past). There's also the punting strategy (try something. What happens?) and the combination strategy (adjust a strategy based on the assessed strengths and weaknesses of previous approaches). This engages Kahneman's "System 2" from Thinking, Fast and Slow. What's great about games is that this process happens when the stakes are low: you can face a variety of novel situations without having to bet your fortune, your business, or your life.

Now let's talk about logic's role here. Logic can transform novel situations into something we are better equipped to deal with: a rote answer or a way to proceed. It is also a System 2 function to multiply the abilities of System 1. Something about logical training is critical to our ability to climb heuristics ladders presented by games. It's a force-multiplier for erudition and honed instinct because it multiplies the situations where we can apply hard-won lessons.

Logic can take the lessons you learned from here...
...and suggest looking for opportunities such as this here.
Climbing heuristics ladders also sharpens creativity. Try something out. Give it your best shot. Compare it against what you know and how it works out. Build a logical system for thinking about the new situation. This is creativity. The germ of creativity can be something simple, but giving it an honest, competent try requires discipline. Plus as you gain experience, you realize that most ideas fail. The ones which succeed are precious. You develop a filter based on book smarts and street smarts to filter out the strategies you will even attempt! The more you know and can apply, the more narrowly you can/will filter the narrative of a creative experiment's success.

So as you get more worldly and erudite, you won't need to be as clever. Unfortunately, the clever part of the brain is a muscle. This is the learning center. This workout is what keeps your mind young and nimble. This is why we need games. Games of all sorts. Low cost of experimentation/success/failure. Creative heuristic ladder climbing/mental model building. Logical transformations to existing data stores. Creation of new data stores. Logically transforming and making analogies from games to other situations and novel situations to each other.

Playing games could keep this muscle in shape. It could be that the reason for declining mental strength is only partly chemical and very behavioral. Once you have enough book and street smarts to live and live comfortably, why continue engaging in this expensive mental exercise? Why sell past the close? Why work hard when you already have enough? To stay in shape.

Another exercise for the reader: How does this sort of narrative apply to the idea of upward mobility in a free economy?

I'd like to finally emphasize that this natural progression from the clever/creative to the worldly to the erudite is inevitable. Even in games with deep, rich heuristics ladders such as chess, a player with many years of experience can fall into winning on erudition and street smarts alone without realizing it. The key is to find competition at around the same level of erudition and worldliness so you force each other into the realm of the clever. Failing that, the game, as beautiful as it is, no longer keeps your brain in shape. It may still be enjoyable to play and very enjoyable to win, but in order to progress you'll need tougher opponents or new games.

Finally, an alternative to games, if none are available, is the deep study of various branches of mathematics. Try it out. There's much to learn, much to experiment with, and much to stir creativity.

Sources:
Footnotes:
  • A cache in computing is local storage of data that is expensive to retrieve; for example, it's faster to read from and write to RAM than to a traditional hard drive, so the contents of often-referenced files are loaded into RAM for fast manipulation. Similarly, microprocessors have a cache on the chip for data that are stored in RAM to speed up computations. When a cache is initialized, it is empty, but as the system is used the cache starts getting populated and the hoped-for speedup is realized. Using a system to populate the cache is sometimes called "warming it up."
  • Kahneman's "System 1" is the fast, cheap, automatic side of the brain. "System 2" is the slow, expensive, methodical part of the brain, sometimes an apologist for System 1, sometimes the only thing helping us see past the biases such automatic processing induces.

Sunday, September 30, 2012

The Joy of Set: Hint 1

Problem: http://gottablogsomewhere.blogspot.com/2012/09/better-living-through-mathematics-set.html

Hint 1: Choosing any two Set cards, there is exactly one card which will complete a Set.

We know this because in a Set, all four attributes of the three cards must be the same, or they must all be different. Each attribute has three values, so the third card has exactly one way to be either the same or different in each attribute from the other two. Each card is unique, giving us 34 = 81 Set cards.

Better living through mathematics: Set

Given a Set board with n cards in play, calculate p(n) = the probability that there is at least one set on the board, e.g. p(n) = 0 | n < 3, p(3) = 1/79. Now find the rest.

http://www.setgame.com/set/rules_set.htm