## Monday, November 22, 2010

### The intersecting sphere and cylinder

The bonus task I gave you last week involved looking at the curve created by the intersection of a sphere and cylinder. For purposes of this demonstration, I will assume that the sphere has radius 4 and the cylinder correspondingly has diameter 4. Thus the sphere is x2 + y2 + z2 = 16 and the cylinder is (x − 2)2 + y2 = 4.

We will now show that the self-intersection curve crosses itself at right angles at the point (4, 0, 0).

Here is one way to do it:

We parameterize the path by r = xi + yj + zk, where we need to find appropriate functions for x, y, and z. Let's rewrite everything in cylindrical coordinates, because that form is more useful in this situation. The sphere's equation is r2 + z2 = 16, the cylinder is r = 4 cos θ, and the intersection curve we are looking for is r = (r cos θ)i + (r sin θ)j + zk.

Since the cylinder requires that r = 4 cos θ, we can substitute for r in the expression for the curve r. We obtain r = (4 cos θ cos θ)i + (4 cos θ sin θ)j + zk.

What can we do about that z? According to the sphere, we must have z = (16 − r2)1/2. Substituting r = 4 cos θ into the equation for z, we get z = (16 − (4 cos θ)2)1/2 = (16 − 16 cos2 θ)1/2 = 4 sin θ. We can now write our curve with θ as our parameter:

r(θ) = (4 cos θ cos θ)i + (4 cos θ sin θ)j + (4 sin θ)k.

Observe that r(0) = 4i and r(π) = 4i, indicating that the curve intersects itself for θ = 0 and θ = π. If we find the tangent vectors at these two points, the angle between them is supposed to be a right angle. Of course, the easiest way to find tangent vectors is to use r′(θ), the velocity vector:

r′(θ) = (−8 cos θ sin θ)i + 4( cos2 θ − sin2 θ)j + (4 cos θ)k.

Plug in θ = 0 and θ = π to find the pertinent tangent vectors:

r′(0) = 4j + 4k
r′(π) = 4j − 4k.

If we dot these vectors we get zero. The vectors are perpendicular, so the intersection curve crosses itself at ninety degrees. QED.

## Sunday, August 22, 2010

### Computing a weighted average

It's not too difficult to turn the points you earn on an assignment into a percentage. You just divide them by the total number of points possible and move the decimal point two places. For example, if you get 15 points on a 20-point quiz, your percentage score is 15/20 = 0.75 = 75%. No problem.

However, I do not use just a point system to figure grades for a class. I use a weighted average of the scores you earn in three categories: HWQ (homework & quizzes, lumped together), Exams (the chapter tests), and Final (the comprehensive final exam at the end of the semester). For example suppose that HWQ is 15% of your grade, Exams are 70% of your grade, and the Final is 15%. (If you check, you'll see that the percentages add up to 100%, as they should. I may vary these weights depending on the number of exams I give.)

Suppose that you earn 72% of all the points possible on the homework and quizzes, you average 84% on the exams, and you get 79% on the final. Did you earn a B? Let's find out. The weighted average is computed by multiplying each score by its percentage weight and then adding everything together. Recall that the percentage weight of HWQ is 15% of your grade, which we can write as the decimal 0.15. For Exams we have 70% or 0.70, and the Final is 15% or 0.15, just like HWQ. The formula for grades is

Course Grade = HWQ*0.15 + Exams*0.70 + Final*0.15.

Using the scores we pretended you got during the semester, your course grade would be given by

Course Grade = 72%(0.15) + 84%(0.70) + 79%(0.15) = 81.45%.

Congratulations! You earned a B for the class, with just a little bit to spare.

It's not too surprising. Most of the weight of the grade is on Exams. Homework and quizzes get only 15% because I treat them more as a learning experience. The final gets only 15% because it's only one exam. While other instructors might choose to give the final more weight, I prefer to limit the importance of any single exam.

In general

If you ever want to compute a weighted average for any reason, the main thing to keep in mind that the weights have to add up to 100%. If, for example, you wish to compute the weighted average of four numbers, X1, X2, X3, and X4, you can do it as long as the weights, w1, w2, w3, and w4, add up to 100%. Then you compute the sum of their respective products:

Weighted average = X1w1 + X2w2 +X3w3 +X4w4.

That's all there is to it. Of course, if you choose to use equal weights, so that w1 = w2 = w3 = w4 = 25% = 0.25, your result will just be the usual arithmetic average. (It would be simpler to add up the numbers and divide by 4.)

I'll leave it to you to figure out what to do if there are more than four numbers for which you wish to compute a weighted average.