Skip to main content

Mathematical Preliminaries

Mathematical Preliminaries
To get the most out of these lessons, I need you to be familiar with a few different mathematical concepts. If you’ve had a course in algebra at some point in your life, you may dimly remember some of what’s below, but in case you don’t, I thought I’d go over the things you’ll need. This is a light treatment of these concepts, but it’s really all that we’ll make use of. If you want to know more, there are a ton of resources online to get into the mathematics more rigorously.
            Besides these specific concepts, I also need you to be comfortable with basic arithmetic (adding, subtracting, multiplying, and dividing) and to have some fluency thinking about the graph of a function (y=f(x) and such). We’ve already used some material that relies on arranging numbers into lists (which we’ll call vectors) and soon we'll be working with arrays (which we’ll call matrices), but we won’t work with any tools for manipulating these besides what you see here.

Calculating Distances
At several points in the course of these lessons, we’ll use distance as a tool for comparing things (colors, objects, etc.). This concept of distance is much like what you’re used to thinking about in everyday situations: How far away is one place from another? To be precise about this, we need to describe both places with numbers that we’ll call coordinates. You can think of coordinates as just a list of numbers that describe the “address” for a place. If it helps, think about latitude and longitude for real-world locations, or cross streets (4th Ave. and 5th St.) as examples of how we use numbers to describe where a place is precisely.
            Assume that we have two locations, p1 and p2, each with coordinates x,y in two-dimensions (e.g. p1 = [x1, y1]). The diagram below depicts both of these points, along with the distance we want to know about (the dashed line).

Figure 1 - Distances between points in 2D can be calculated using their coordinates and an application of the Pythagorean Theorem.

 With just a little arithmetic to help us work out the horizontal distance between these points and the vertical distance (in both cases, we subtract the larger coordinate from the smaller), we can use the Pythagorean Theorem to help us work out that the distance between p1 and p2 is as follows:


We won’t actually be doing a ton of work in just two dimensions, so we'll need to use generalizations of this formula for 3 dimensions or more. 

Dot-products
Now I need to introduce you to a computation you may not have run into before: The dot-product. This is a way of multiplying two lists of numbers together to get a single number in return. Why would you want such a thing? For now, you can just take it on faith that it might be useful (and you can look in the Appendix for some additional material about the dot-product if you care). The definition of the dot-product for two vectors u and v is below:


If you don’t remember what to do with the capital sigma and the subscripts, etc., here is a description of the dot-product in words:

For each number in the first list, u, pair it up with the corresponding number in the second list, v. Multiply each pair together, then add up all those products.



Both definitions require that u and v are the same length. We can’t match items up between u and v unless every item in u has one and only one partner in v. As long as that’s true, it doesn’t matter how many numbers we have in the two lists – we can just pair everybody up, multiply, then add to get the dot product. The result is always just a single number, remember, which we’ll end up using in a few different ways. Now that you know how to calculate the dot-product, take a look at the exercises in the problem set that involve computing them. It isn’t terribly hard, but some practice never hurt.

Trigonometric functions and the unit circle
Finally, we will end up using a few trigonometric functions here and there so we can be precise about angles and the relationships between distances and angles that we care about in some situations. There is tons of stuff to be said about these functions in a full course on trigonometry, and we’ll need almost none of that stuff. What we do need are some definitions of the functions sine, cosine, and tangent. We can say what these are using a single diagram of a right triangle, like the one below:


Figure 2 - Trigonometric functions are based on ratios between sides of an arbitrary right triangle.

The thing you need to know about all three of these functions is that they are essentially machines for turning one number (an angle in a right triangle) into another number. This second number is always a ratio between two sides in the same right triangle that the angle we started with came from. Which two sides we use to compute this ratio depends on the trigonometric function.

We also need another piece of information: These machines can also be run backwards using inverse versions of each function. That is, if the thing you know is the ratio between two sides, you can ask the inverse function to tell you what angle would have given you that ratio for the two sides that function is concerned with.
            One very important thing to know about both sets of functions is that if you’re using a calculator or any computer application to try and work with them, you may need to be careful about the difference between describing an angle using degrees and using radians. You’re probably used to thinking about an angle in degrees (a right angle has 90 degrees in it, for example), but a lot of software prefers to think about them in radians. To convert between the two units, you need to know the following:

360 degrees = 2*pi radians

This means that a right angle (90 degrees, remember!) can also be described as subtending p/4 radians.

Alright – that’s it for now. Believe it or not, we’re ready to start calculating some things about how your eye and your brain work. Remember: We’re rarely going to stray beyond adding and multiplying, so the mathematics won’t usually be the hard part. The hard part will be making sure you understand why you’re doing what you’re doing and what it means.

Comments

Popular posts from this blog

Motion perception and sampling in space and time

Motion perception and sampling in space and time The next property of real objects that we want to be able to recover from images involves introducing a feature of your experience that we haven’t considered before: change over time. Besides having reflectance properties that are independent of the light falling on them and occupying positions in 3D space, objects also change the way they look over time. That is to say, objects can move . One of those objects that can move is you, which is another way that the images you receive on your retina change from moment to moment. We’d probably like to know something about the real movements that are happening out there in the world that give rise to the changing images that we measure with our eyes and our brain, so how do we interpret change over time in a way that allows us to make guesses about motion? To motivate this discussion, I want to start thinking about this problem by considering a simple model system that represents a basi

Visual processing in the retinal ganglion cells and the LGN

Visual processing in the retinal ganglion cells and the LGN To continue discussing how your vision works, we’re going to have to abandon structures that are relatively easy to see (like your retina – which is tricky, but not impossible, to see directly) and start talking about parts of your visual system that aren’t so accessible. Our next stop will be cells in two different locations: We’ll consider cells called retinal ganglion cells (or RGCs) and cells within a structure called the lateral geniculate nucleus (or LGN). We’ll be talking about these cells together because it turns out that they have very similar computational properties even though they’re located in different parts of your visual system. The retinal ganglion cells are located in a layer just “above” your photoreceptors if you’re looking at a cross-section of your eye, and receive inputs directly from the rods and cones. The lateral geniculate nucleus is a good bit further along – the retinal ganglion cells send p

What does light do?

What does light do? In the first set of lab exercises, you should have been able to observe a number of different behaviors that light can exhibit. What do these different behaviors tell us about the nature of light, and do they provide any insights regarding what exactly is different about lights that are different colors? Let’s talk a little bit about what exactly light did in each of these different situations and what we can conclude about the nature of light as a result. Reflection This set of observations probably didn’t hold too many surprises for you, but we should still talk carefully about what we saw. First of all, what did light do when it encountered a mirror? When we measure the various angles that light makes relative to the surface of a mirror on the way in and the way out, we should find that the incident angles of the light are equal (see Figure 1). Figure 1 - When light reflects, it makes equal incident angles relative to the surface. By itself,