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

Lab #4 - Observing retinal inhomgeneities

Lab #4 - Observing retinal inhomgeneities Back-to-back lab activities, but there's a method to the madness: In this set of exercises, you'll make a series of observations designed to show off how your ability to see depends on which part of your retina you're trying to see with. Here's a link to the lab document: https://drive.google.com/file/d/1VwIY1bDNF4CI4CUVaY5WSvQ0HxF9Mn6Y/view When you're done here, we're ready to start saying more about the retina and how it works. Our next posts will be all about developing a model that we can use to describe the retina's contribution to your vision quantitatively, so get ready to calculate some stuff!

Lab #3 - Photopigments

Lab #3 - Photopigments Our next task is to work out how you translate the image formed in the back of a pinhole camera into some kind of signal that your nervous system can work with. We'll start addressing this question by examining photopigments  in Lab #3. To complete this lab, you'll need access to some sunprint paper, which is available from a variety of different sources. Here's where I bought mine:  http://www.sunprints.org . You can find the lab documents at the link below: https://drive.google.com/file/d/17MVZqvyiCRdT_Qu5n_CtK3rVcUP0zoOG/view When you're done, move on to the Lab #4 post to make a few more observations that will give us a little more information about the retina. Afterwards, we'll try to put all of this together into a more comprehensive description of what's happening at the back of the eye.

Color Constancy: Intro

Color Constancy: Estimating object and surface color from the data. In our last post, we introduced a new kind of computation that we said was supposed to help us achieve something called perceptual constancy . That term referred to the ability to maintain some kind of constant response despite a pattern of light that was changing. For example, complex cells in V1 might be able to continue responding the same way to a line or edge that was at different positions in the visual field. This would mean that even when an object changed position over time because you or the object were moving, your complex cells might be able to keep doing the same thing throughout that movement. This is a useful thing to be able to do because your visual world changes a lot as time passes, but in terms of the real objects and surfaces that you’re looking at, the world is pretty stable. Think about it: If you just move your eyes around the room you’re sitting in, your eyes will get very different pattern...