## Discrete! #32: Interesting Problems in 2.3 B

2.3: Interesting Problems in 2.3 Part B

Oh man, this one tried to kill me. I’m not sure if I’ve noted it explicitly, but I never actually got past chapter 3 in the book way back when I was self-teaching. So, we’re getting close to the edge of my knowledge here. Wish me luck.

39

For this problem set, we’re introduced to the horrific notation for inverse images. Horrific because it doesn’t quite mean “inverse function.” The book says “We define the inverse image of S to be the subset of A whose elements are precisely all pre-images of all elements in S. We denote the inverse image of S by $f^{-1}(S)$.”

So, basically, suppose you have two sets, A and B. There’s a chunk of B called S (S for subset). Then, there’s a subset of A called the “inverse image” denoted $f^{-1}(S)$. Or, in a pretty way, we say that $f^{-1}(S)$={ a∈A| $f^{-1}$(a)∈S }.

Simply put, we’re mapping between subsets in A and B.

NOW THEN, to the actual problem:

“Let g(x) = ⌊x⌋. Find the inverse image of

a) {0}

b) {-1, 0, 1}

c) {x| 0<x<1}”

For (a), we’re saying “You took the floor of x and got 0. What are the possible pre-images of g(x)? Well, if it floors to 0, it must be bigger than 0 and less than 1. So, that’s your set.

For (b), It floored to a couple numbers. So, the possibilities are a bit larger. It must be greater than -1 and less than 2.

For (c), you’re only talking about non-integers, and you can’t floor to a non-integer. So there are no images. The set of inverse images is just the empty set: ∅

41

“Let f be a function from A to B. Let S be a subset of B. Show that the inverse image of the complement of S equals the complement of the inverse image of S.”

You can actually prove this to yourself really easily by drawing it. Draw a circle on the left called A, with a subset that is the inverse image of S. Draw a circle on the right with a subset that is S. If you’re talking about the inverse function of B – S, you have to be mapping only to things in A-(inverse image of S), since by definition, the images in S are the images that map to the inverse image of S.

Once that makes sense, the proof is pretty straightforward.

51

“The function INT is found on some calculators, where INT(x)=⌊x⌋ when x is a nonnegative real number and INT(x)=⌈x⌉ when x is a negative real number. Show that this INT function satisfies the identity INT(-x)=-INT(x).”

So, you can basically think of INT(x) as “locate x on a number line, go toward 0, and stop at the first integer you pass.”

That idea helped me believe this was true. Either way you do it, you’re moving toward 0. So, you’re either starting in negative territory then moving to zer0 or starting in positive territory, then moving to zero, then flipping.

For the proof, with these ceiling and floor deals, it seems to be best to start by splitting your variable into its integer and decimal part. You can denote these as n and ϵ (epsilon).

So, now we can rephrase to: INT(-(n+ϵ))=-INT(n+ϵ)

For the left hand side, we can simplify to

INT(-n-ϵ)

This simplifies down to

⌈(-n-ϵ)⌉

Which is simply

-n.

For the right hand side, we have

-INT(n+ϵ)

Which is the same as

-⌊n+ϵ⌋

Which is the same as

-n.

BAM. You may at this point argue “HEY! You assumed x was positive.” This is true. But, if you follow the above logic, if x is negative you simply switch the floor and ceiling and switch the sign. And, it still all works out

There are a number of other good problems here, but in the interest of saving space and time I’m not going to work them all. A bunch of the 60s are just graphmaking busywork, but 67 was very interesting, as was 77. I recommend mentally chewing on them a bit when you work the problems yourself.

Next stop: Sequences and Summations

Posted in Autodidaction, Discrete Math | 3 Comments

## Calculus! #64: Interesting Problems in 5.1

Interesting Problems in 5.1

A lot of these were a bit easy, but were designed to give you intuition. So, best to go through some of these on your own, if you found the limit-of-a-summation thing confusing. That said, much of this is about doing simple computer loops, or drawing rectangles. NO FUN.

But, 21 was interesting:

21

Determine a region whose area is equal to the given limit. Do not evaluate the limit.

$\lim_{n \to \infty} \sum_{i=1}^{n} \dfrac{\pi}{4n} \tan{\dfrac{i\pi}{4n}}$

What the who what? They want me to what?

Here’s what they want you to do: Recognize that with a little fiddling, this is actually the form for the definition of area as a limit goes to infinity for a certain region.

Remember, we’re taking the limit of certain heights (aka y values aka f(x) values) times certain widths as those widths get tinier and tinier. The mathematical formula for that is just the sum of all those rectangles. Now, how does that relate to the above.

Well, remember each member of the summation is multiplied by the change in x, aka Δx. No matter what, in the summation, every member is multiplied by π/4n. So, we can just think of that as our Δx. That is, the width of the bottom of each rectangle is π/4n.

Now, let’s see if we can convince the rest of each member to be f(x). Note that because increases by 1 each step, you’ve got a sequence of tan functions that are each π/4n distant from each other. So, you can rephrase things as Δx*tan(i*Δx). That’s just the width times the length of the rectangle at intervals of Δx. You may be wondering where the n went. Well, it’s rolled in Δx. Remember, n divides here, so the bigger it gets, the thinner the rectangles, and the more precision you have.

For clarity, we can restate Δx*tan(i*Δx) as simply Δx*f( 0+i*Δx ). The zero just indicates the starting point.

Lastly, recall that Δx = (b-a)/n, where b and a are just the interval over which we’re talking. Well, we know the starting point (a) is just 0. We also know that π/4n=Δx. So, we can solve for the missing ingredient, b, algebraically. The result is just π/4.

Feels a little weird, but we’ll get a much better understanding of this trick in the next section.

Next Stop: The Indefinite Integral

## Physics! #47: University Physics Chapter 7 Discussion Questions

Discussion Questions in Chapter 7

Q7.1

“A baseball is thrown straight up with initial speed $v_0$. If air resistance cannot be ignored, when the ball returns to its initial height its speed is less than $v_0$. Explain why, using energy concepts.”

Basically, the ball is giving up energy to the air molecules as it smacks into them. Thus, it never reaches the height it would if all K became U. So, first up, it doesn’t have as much potential energy. Then, on the way down, it gives more energy to air molecules, so it doesn’t speed up as fast as it would in a vacuum. Thus, it’s at a lower speed when it lands.

Personally, I’d prefer to not think about K and U here and just imagine what the atoms are doing. It’s a lot more clear mentally. Of course, if you’ve got to do some math, thinking of energy is a lot simpler.

Q7.3

“An object is released from rest at the top of a ramp. If the ramp is frictionless, does the objects speed at the bottom of the ramp depend on the shape of the ramp or just on the height? Explain. What if the ramp is not frictionless?”

This is one of those fun weird physics questions. For the strange case of the frictionless ramp, all that you care about is the change in height. Because of the lack of friction (and I assume lack of air), there is no energy loss, only energy change. So, over a steep ramp, it’s a lot like just dropping the ball. On a long slow incline, it’ll take longer for the ball to build up speed, but it’ll end up at the same final speed because it’s gained the same amount of energy. Note: if the question had been about velocity, as opposed to speed, this wouldn’t work. Remember, speed is the magnitude of velocity. For different ramps with different inclination, the direction of final motion will not be the same!

This may strain the brain a little because it’s very unrealistic. So, in reality, with friction, a steep ramp is obviously better for pure speed. The friction can be thought of as a constant force push the ball back. Or, you can think of the ball as doing work on the ramp. This requires energy. So, at the bottom, the ball will be slower.

Q7.5

“A physics teacher had a bowling ball suspended from a very long rope attached to the high ceiling of a large lecture hall. To illustrate his faith in conservation of energy, he would back up to one side of the stage, pull the ball far to one side until the taut rope brought it just to the end of his nose, and then release it. The massive ball would swing in a mighty arc across the stage and then return to stop momentarily just in front of the nose of the stationary, unflinching teacher. However, one day after the demonstration he looked up just in time to see a student at the other side of the stage push the ball away from his nose as he tried to duplicate the demonstration. Tell the rest of the story, and explain the reason for the potentially tragic outcome.”

If I read that right, the point is that a student tried to copy him and almost got his face bashed in. If that’s so (the language is a little unclear, I think), the rest of the story is probably that the student didn’t just “release” the ball, but rather gave it a little push. This meant that the ball had extra energy on the return trip, which allowed it to get far enough to beat his stupid face in.

Q7.7

“Is it possible for a frictional force to increase the mechanical energy of a system. If so, give examples.”

I feel like this one’s a little weird since friction is a fictional force, so it’s human-defined. That said, I assume it’d count if you were on a conveyor belt that was frictioning you forward.

Q7.9

“People often call their electric bill a power bill, yet the quantity on which the bill is based is kilowatt-hours. What are people really being billed for?”

This is a classic physicist pet peeve. Watts are energy per time. So, you multiply that by a unit of time and you get plain old energy. So, you’re really being billed for how much energy goes into your house, not the power per se.

Q7.11

“On a friction-free ice pond, a hockey puck is pressed against (but not attached to) a fixed ideal spring, compressing the spring by a distance of $x_0$. The maximum energy stored in the spring is $U_0$, the maximum speed the puck gains after being released is $v_0$, and its maximum kinetic energy is $K_0$. Now the puck is pressed so it compresses the spring twice as far as before. In this case, (a) what is the maximum potential energy stored in the spring (in terms of $U_0$, and (b) what are the puck’s maximum kinetic energy and speed (in terms of $K_0$and $v_0$?”

Okay, so (a) is pretty simple. We know that spring potential is proportional to the square of the compression distance, and that for a given spring (especially an ideal one), the proportionality constant is… constant. So, if it is twice as displaced, it’ll have 4 times as much potential. This jives with your real world experience, I think. To press the garbage down a foot doesn’t take much effort. Getting it that extra inch so it’ll fit in the fucking trash bag takes a lot of effort.

If we have 4x as much U, in an ideal system, we get 4x as much K. So the maximum K is just 4 times larger. Now, recall that kinetic energy is proportional to velocity squared. So, we have to take a square root to get it back out. The result is the new velocity is 2x the old. So, double compression gets you double speed.

Q7.13

“You often hear it said that most of our energy ultimately comes from the sun. Trace each of the following energies back to the sun: (a) the kinetic energy of a jet plane; (b) the potential energy gained by a mountain climber; (c) the electrical energy used to run a computer; (d) the electrical energy from a hydroelectric plant.”

(a) Sun makes life grow. Life dies, gets smooshed into hydrocarbons. Hydrocarbons get made into jet fuel. Jet fuel speeds up jet.

(b) Sun makes plants grow. Plants are turned into deep fried pies. Climber eats deep fried pies, converts them to ATP. ATP causes muscle contractions at just the right time to move his body up the mountain, gaining potential energy.

(c) Sun grows alfalfa. Alfalfa compressed into hamster pellets. Hamsters use pellet energy to run on wheel. Resulting energy powers computer.

(d) Sun melts ice to water. Water flows toward ocean. Water drops off man-made cliff past turbines. Turbines take that energy and convert it into useful form.

Q7.15

“In physical terms, explain why friction is a nonconservative force. Does it store energy for future use?”

Friction is just a human level aggregate force we use to model what is actually the interaction of atoms electromagnetically.

That said, although the individual interactions by be, very complexly, conservative, the friction ain’t. If you push a rock one way across your lawn, you don’t get the energy back when you return the rock to its initial position. Or, if you take a rock and push it on a winding path from point A to point B, you use MORE energy than if you’d used a direct route. Compare this to moving a ball around.

Point is, with friction, you don’t get that work “back.”

Q7.17

“Since only changes in potential energy are important in any problem, a student decides to let the elastic potential energy of a spring be zero when the spring is stretched a distance of $x_1$. The student decides therefore to let $U={1/2}k(x-x_1)^2$. Is this correct?”

This one is trying to figure if you really understand these systems. You have to remember that the change in position is not ANY change in position – it’s the displacement from the spring’s natural state. So, in this case, it is most convenient to call that place zero. Technically, you can define your axes however you like, but doing anything but saying x=0 when the spring is uncompressed and unstretched is basically just making more work for yourself.

This is a good example if why it’s important to understand things physically. You might get tripped up by the math here, but you know from real life that there’s a difference between compressing one inch and compressing two inches regardless of how you define your axes.

Q7.19 and Q7.21 and Q7.23

(Skipped because they require a diagram)

Next stop: Exercises in Chapter 7

Posted in Autodidaction, physics | 1 Comment

## Discrete! #32: Interesting Problems in 2.3 A

2.3: Interesting Problems in 2.3 Part A

Wow, this is a long set. This is one of those homework assignments you get in college where you think “only ten problems? I could do that?” and then all the problems are multiple part and require you to have worked even problems.

As I’ve mentioned earlier, discrete is not an area I’m comfortable in, so a lot of this is learning for me. As a result, I’m gonna work more problems on the blog. In real life, I work all the odd problems that I can’t immediately think of a solution for.

LET’S DIG IN.

3

Determine whether f is a function from the set of all bit strings to the set of integers if

a) f(S) is the position of a 0 bit in S.

b) f(S) is the number of 1 bits in S.

c) f(S) is the smallest integer i such that the ith bit of S is 1 and f(S)=0 when S is the empty string, the string with no bits.”

Christ, that was set up like a comic. Easy, easy, WAY HARDER. But, perhaps not as hard as it seems at first glance.

First, remember bit strings look like this: 010101001110010100010100101010, etc. Each digit is a “bit.”

So, a good way to get intuitive is to draw a set on the left that consists of all bit strings: 0, 1, 01, 10, 000, 001, 010, 100, 011, 110, 111, and so on. On the right, write the set of all integers. I just did -3 through +3. Now, start mapping. You’ll not that for (a) you quickly start getting preimages that map to more than one image. In fact, any time you have more than one 0, you have to map to multiple things in the second set. So, this is clearly not a function. In fact, as the bit strings get larger, pretty much all of them map to multiple images. NO GO.

For (b) we draw out the same left and right stuff. We note that each bit string identifies with just one element on the right. Why? Because it’s a sum of a bunch of ones. If you can figure out a way to sum a bunch of ones to more than one result, you can create an infinity machine and the universe will end. So, it’s not allowed. You may also note that it is common for two bit strings to point to the same integer. This is fine – it just means the function isn’t 1-to-1. BUT, it’s still a function. There is no place where f maps to a undefined and there is no place where an element in S maps to more than one element of the codomain. You are safe.

For (c), let’s parse that sentence. Mathematicians have a way of making simple things complex. “f(S) is the smallest integer i such that the ith bit of S is 1 and f(S)=0 when S is the empty string, the string with no bits.” This is saying something like… suppose you have a bit string. And suppose the first position in it is “bit 1,” and second position contains “bit 2,” the third “bit 3” and so on. Each of those bits is a 0 or a 1. For each bit string, find the 1 in the lowest position. The number value of the position is the element of the codomain to which that bit string maps. So, for example, for a given bit string, if the first 1 you encounter is in position 3, that bit string maps to 3 in the codomain.

OKAY, now that you understand, you must ask… is it a function? Well, draw it out. Similar to (a) it is not one-to-one, since (for example) 1 and 01 map to the same number (1). BUT, you notice something that nags you. What do I do with 0 or 00 or 0000000000? They are undefined, so you’ve got a bunch of preimages with no place to go. Thus, it’s not a function. If you were to define sets containing no 1s as equal to 0, that’d do it. BUT, you’ve only defined the empty string to equal 0, and the bit string 0000000 is not empty.

10 and 11

I’m combining those two into one uberquestion:

“Determine whether each of these functions from [a,b,c,d] to itself is one-to-one and/or onto.”

a) f(a)=b, f(b)=a, f(c)=c, f(d)=d

b) f(a)=b, f(b)=b, f(c)=d, f(d)=c

c) f(a)=d, f(b)=b, f(c)=c, f(d)=d

The easiest thing here is just to draw out your maps with a,b,c, and d on the left and right. Remember, 1-to-1 and onto are like sex parties with guests and hosts, with the preimages being guests, the images being hosts, and the function indicating that they got to hook up.

At a 1-to-1 sex party, only monogamous pairing is allowed, even if it means certain hosts get left out.

At an onto part, EVERYONE gets laid, even if it means more than one guest had sex with the same host.

That is, 1-to-1 is a bit more of a prudish sex party. Onto is where the kinky stuff happens.

The combination is called bijection, and it’s when everyone has sex, but the whole party is monogamous pairs.

In the case of problem (a), each preimage gets with exactly one image, and every image is mapped to (or, if you will, sexed up). Thus, it’s a bijection – it’s one-to-one and onto.

In problem (b) it’s not one-to-one OR onto. It’s the WORST kind of sex party. One person gets a threesome while another is left out entirely!

In problem (c), it’s once again neither. Mr. a gets left out, while Mr. d gets double teamed.

19

“Determine whether each of these functions is a bijection from R to R

a) f(x) = 2x+1

b) f(x) = x^2 +1

c) f(x) = x^3

d) f(x) = (x^2 + 1)/(x^2 + 2)”

In other words, for each function, make sure you can map from R to everything in R, and make sure that you don’t have a situation where one preimage maps to 2 or more images.

For problem (a), it’s pretty clearly a bijection. Visually, it’s a line that goes up. So you can’t draw a horizontal line that touches more than one value of f(x). And you can clearly get to every real number using that line.

For (b) it’s clearly not a bijection. Any time you have a squared x, you can have preimages of opposite sign map to the same image.

For (c), it’s a bijection. To map to another number, you just start with the cube root of that number.

For (d) you might get tripped up like I did. Since I’m working problems, I automatically tried to see if I could simplify this to a polynomial that’d be easier to work with. But, it’s actually not necessary. Because the numerator and denominator are each squared and added to, both have to be positive. So, you can’t map to the negative numbers in R. Thus, f(x) is not onto, and thus f(x) is not a bijection.

21

“Let f: R→R and let f(x)>0 for all x∈R. Show that f(x) is strictly decreasing if and only if the function g(x) = 1/f(x) is strictly increasing.”

I believe there’s actually a fairly simple calculusy way to solve this. The derivative of 1/x with respect to x is going to be negative. So, you can show that it’s is decreasing everywhere, so it has to be largest as you approach 0.

BUT, I’m guessing that’s not what they want. So, this becomes one of those problems that is annoyingly simple. The book provides a proof that basically says that if you know f(x) is shrinking, and you know dividing by a smaller number results in a larger output assuming the numerator is held constant, it’s clear that g(x) must be growing. And, you can just prove that the other way around, thereby getting yourself an “if and only if.” I have to admit, these sorts of proofs always feel weird to me. The more obvious the truth of something, the harder it is to show it’s true in math!

31

“If f and f∘g are onto, does it follow that g is onto?”

This one tricked me. At first, it seems like a definite yes. f maps A to everything in B. f∘g maps everything in A to everything in C. Where’s the room for a gap?

Well, suppose g maps from A to B. And suppose it’s not onto – that is, some elements are not mapped to. But, of course, everything in A is mapped to SOMETHING. Then, you map from B to C with f and it IS onto. So, by this means, everything in A gets mapped to something in C. It sounds a little weird, but draw it out and it makes perfect sense. The important thing to remember is that in f∘g, the g executes first.

OKAY, I’m gonna cut it off there for this post. We’ll round things out next time, and then go into summations, which will conveniently elucidate our calculus stuff.

Next stop: Interesting Problems in 2.3 Part B

Posted in Autodidaction, Discrete Math | 2 Comments

## Calculus! #63: Early Transcendentals 5.1

5.1: Areas and Distances

HOO BOY we’re getting to some more fun stuff.

Now then, let’s talk about area. Area is a function of length times width. Usually, we think of this as a rectangle. There’s a reason that, when calculating area, you always divide it into rectangles (area of a right triangle is just half a rectangle). The reason is that we’re talking about how much 2D space there is. So, since we’re in 2D, we care about 2 orthogonal directions. Usually, we call these x and y.

But say you want to know the area under a curve. Say, for example y is energy emitted per second by a fire and x is time. Say you want to know how much energy is emitted in total.

Well, if emitted energy is constant, it’s easy. Your graph is a horizontal line and you just multiply length times width. It’s even easy if you’ve got a linear function – you’ll just get a right triangle of some sort, for which area is easy to calculate.

But say you have a more realistic function that wobbles and curves. How do you figure that out?

Well, as it turns out, there are a number of handy ways to approximate it.

Probably the easiest is just to draw some shapes under the graph that are easy to deal with. Rectangles are quite good for that. So, suppose you draw a bunch of rectangles under the graph of energy emitted per time, forming what looks sort of like a skyline, and then you add up their areas. You’ll get a pretty solid approximation to the total. But, because you’re missing some space under the curve, your estimate will be low.

Another way you could do it would be to select regular points along the graph, then draw rectangles using those points as the upper right corner for each shape. In that case, if the graph is increasing, you’ll overestimate, and if the graph is decreasing, you’ll underestimate.

You could also use the left corner to do this trick.

Whatever you do, you’re going to end up with a summation of areas at regular intervals. The math here is fairly simple. The x distance of each rectangle (width) is the same because we say it is. The y distance of each rectangle (length) is the value of the function at that point. Assuming you know the function, you just use it to generate a bunch of particular values, add them up, then multiply the whole thing by x. Presto – a solid approximation of the area under the curve.

NOW, suppose that you want a better approximation. How would you do this? The easiest way is just to decrease those x distances. Narrow rectangles mean smaller differences between your sum and the actual area. That is, if you overshoot, it’s by less, and if you undershoot, it’s by less.

Remember from Calc 1 that there’s this awesome thing called a limit that allows you to do maneuvers like this as some value goes to infinity. Will, say we stipulate that the x distance gets smaller and smaller and smaller. Eventually, we’ll reach a point where we have an exact answer.

This method of taking the limit of the sum of those rectangles as x gets infinitesimal is called integration. You can probably see how it’s quite a powerful tool.

I want to take a second here, however, to talk about intuitively what an integral really is. What you’re usually told is that an integral is “the area under the curve.” This really gets it backward.

My friend Khalid wrote a great article on this: http://betterexplained.com/articles/a-calculus-analogy-integrals-as-multiplication/

You should read it. But, the short version is this – saying “the integral is the area under a curve” is sort of like saying “multiplication is finding the area of a rectangle.” It’s… kinda true? But, thinking about it in that limited sense can mess you up. When you take an integral, you’re really doing a fancy version of multiplication in which the values change at given points. I like to think of integration is the calculus version of multiplying – you have two functionally related value sets (in the above example, time and energy emission per unit time), and so to speak, you’re multiplying them across the function. The result makes nice sense in terms of units, since the time units cancel out and you’re left with just energy emission.

Just as with derivatives, people tend to use time as the independent variable. Don’t let this mess you up. Calculus often deals with time, but it’s not ABOUT time. Any time you’re doing an integral, you’re really doing a fancy version of multiplying. It’s not about time necessarily any more than multiplication is about space.

OKAY, opining done.

Next stop: Interesting Problems in 5.1

## Physics! #46: University Physics 7.5

7.5: Energy Diagrams

Kids, graphs are magic. Graphs are magic because your fancy monkey brain is very visual. So, with a little training, a graph can tell you a lot of information about a system in high detail at a glance.

In this case, we’re talking about energy diagrams.

One of the pretty things about conservation of energy is that in a closed (idealized) system, total amount of energy stays the same. So, the graph of energy vs. position is just a horizontal line somewhere. In a system where you’re only dealing with potential energy and one other thing, you can draw a curve under that line to indicate what sort of energy you’re dealing with at a given position.

Take for example a guitar string. When you yank it to one side, it’s all spring potential energy. When you let it go, it starts losing potential energy to kinetic energy (remember, E = K+U). Since spring potential is given by displacement, at the moment it passes its natural position, it has 0 for potential energy. So, at that moment, it’s all K. It passes the middle then goes to the other side, where it goes back to being all U. That releases, and it swings back. In an ideal system, this goes on forever. In the real world, it loses a little energy to vibrating the air and making pleasant sounds.

So, you diagram this is a parabola. under the E line. The curve of the parabola is U at a given position. In the middle, it touches (0,0) meaning it has no U and no displacement. then it ramps up to grab displacement and therefore more U. The cute thing is due to E = K+U, you can figure out its K at a given time by saying E – K = U. That is, the distance between the parabola and the horizontal line is equal to K at a given position.

You can also make an upside down version of that parabola to diagram K versus position. When U is 0, K maxes out. When U is maxed out, K is 0.

Now here’s where it gets even cooler. Recall that the derivative of potential energy with respect to position is force. Intuitively (think about it for a sec), for something like our guitar string, force should never be positive. Why? Because, except at exactly x=U=0, the direction of acceleration is back toward 0. That is, the force is always acting opposite to the direction of motion. Thus, it must be negative.

And we can see this mathematically.

E = K + U

E – K = U

(d/dx)E – (d/dx)K = (d/dx)U

Recall that E is constant, so it goes away when we take the derivative.

The book skips over this next part, for the good reason that most people at this point won’t know how to do it, but I’ll give it to you if you want it.

You might be tempted to say dK/dx = mv because $K=0.5mv^2$. But, you know that’s wrong because mv is momentum, not force, and you know from last section that dU/dx = force. So, you’ve got a unit problem? What’s the problem then? Well, momentum is the derivative of K with respect to VELOCITY, not with respect to POSITION. We care about position.

This is why it’s annoying that you always learn functions x as time. It’s often true, but not always. So, let’s take the derivative of K with respect to position.

$K = 0.5mv^2$

Because we don’t care about the coefficient, we can move it back. We can also say v = x/t so we know where the x that we care about is. And, because we don’t care about time, we can treat it like part of the coefficient. If this seems weird, it’s really just a version of the partial derivative we learned a little about last time. So, the result after pushing things around is:

$K = (0.5m/t^2)x^2$

Everything in that first parenthetical is constant, so this becomes quite simple.

$dK/dx = xm/t^2$

And that result does in fact have the proper units. However, because we’re idealizing the system, that mass thing is gonna be a problem. We could probably imagine a guitar string where all the mass is at the center, but you get the idea. So, returning to our earlier derivation:

(d/dx)E – (d/dx)K = (d/dx)U

We now so that F is always going to be negative except at a displacement of 0. Because dU/dx = -dK/dx.

For this section, all we really care about though is that the force, being always restorative, will always be negative.

This leads to neat results. For example, as you know, when the guitar string hasn’t been plucked, it doesn’t move. It’s at “stable equilibrium.” It’s also at a minimum of potential energy. Guess what? It’s the same thing. Of course, you can have a system with more than one stable equilibrium. Imagine for example a roller coaster track. Any point where it bottoms out is a point where you could place the roller coaster cart and it wouldn’t move. So, any local minimum is going to be stable.

You can also imagine unstable situations. Suppose that roller coaster is at the top of a flipped parabola. It’s at equilibrium in that if you just put it at the top, it’ll sit there. But it’s an unstable equilibrium because if you displace it at all, it’ll gain energy and zoom away. The book uses the example of a marble balancing atop a bowling ball.

Mathematically, the difference is that if you’re at a minimum, you have to use up kinetic energy to move away. If you’re at a maximum, you gain kinetic energy by moving away. Clearly, one is more stable than another.

Hopefully the above all makes sense. One of the hardest things about basic mechanics, in my opinion, is that you have to do a lot of idealizing, and sometimes it can be hard to know when you’re talking about something “real” and something “ideal.” In this section we do a lot of idealizing. We’re talking about massless springs that never break or radiate energy. Then, once you accept that, we start talking about derivatives of its potential energy. If you start with an idealization, it often gets harder and harder to maintain as you start doing more stuff to the equations. Anecdotally, I’ve heard from many people that classical mechanics is where they got their worst grades. Partially this is probably due to being new to physicsy ways of thinking, but I suspect it’s also the case that it’s easier to discern assumptions in later material. The further you get into physics, the more the textbooks look like series of equations. To some this may look intimidating. To me, it just means that what’s under the hood is more clearly stated. SO, if you’re trying to parse this section and stuff is a little confusing, make sure to say to yourself “this is all true if I accept the premises.” It’ll just mess you up if you start thinking “what if the spring breaks?” or “what if the marble leaves the gravity field?” We’ll be able to answer those questions more effectively later.

Next stop: Interesting Problems in 7.6

Posted in Autodidaction, physics | 2 Comments

## Discrete! #31: Discrete Mathematics and Its Applications 2.3, Part C

2.3: Functions Part C (Starts with Inverse Functions and Compositions of Functions)

Inverse Functions and Compositions of Functions

Inverse functions are pretty much what you’d guess. If you have a function that maps from A to B, inverse functions get you back.

BOOK DEFINITION:

“Let f be a one-to-one correspondence from the set A to the set B. The inverse function of f is the function that assigns to an element b belonging to B the unique element a in A such that f(a) = b. The inverse function of f is denoted by $f^{-1}(a)$. Hence, $f^{-1}(b)=a$ when f(a) = b.”

This may seem pretty straightforward, but there’s a bit of cleverness going on. Remember how we said that if a single element in a maps to two elements in b, it’s not a function? Well, for that functions inverse, things get flipped. You can’t have a single element in b map to more than one element in a. In other words, in order to have an inverse, a function must be onto. In addition, in order that all the elements in B can get to some element in A, the function must be one-to-one.

Perhaps now you’re getting a sense of why this stuff matters. You have now got the power to determine if a function has an inverse within certain bounds.

Thus, when you have one-to-one correspondence (a.k.a. bijection, a.k.a. it’s one-to-one AND onto), we say the function is “invertible.” Now you understand why. If it is not in one-to-one correspondence, it is not invertible.

Note, that invertibility is not JUST about the functions. For example, f(a) = |b| is not invertible because, for example, -1 and 1 have the same absolutely value. BUT, if we restrict it so that we only ever use positive numbers, it IS invertible. It’s also a quite boring function, but that’s fine. So, you see, invertibility is about specific functions, specific domains, and specific codomains. This is why problems of this sort will specify a domain using a big letter, like R (reals) or Z (integers).

Compositions

Now, suppose you have a function that maps from A to B and another function that maps from B to C. We’ll call that first function g and the second one f. When you do both operations, we express that as f(g(a)) or f∘g(a). Personally, I prefer the former notation, annoyingly large amount of parens notwithstanding.

The book makes a quick note that’s very important: “Note that the composition of f∘g cannot be defined unless the range of g is a subset of the domain of f.”

That is, you start with the stuff in A, then you run g on it. If the output of g is not in the domain of f, you can’t run f on it.

Or, think of it like this:

Input 1 turns into Output 1 via function g.

Output 1 is now the Input for a new function, f. So, let’s call Output 1 “Input 2.”

If f can’t deal with “Input 2” (for example, if input 2 is zero and the function is 1/x), then shit don’t work. And, in the case of shit not working halfway through, you’ve got no composite function f∘g. For that matter, if you have a longer composite string, like f∘g∘h∘q∘n∘x, if it breaks down somewhere in the middle, you’re hosed.

(Sidenote: I feel like a deserve some applause for not mentioning “Human Centipede” even once here)

You can also just combine f(g(a)) into a brand new function. For example if running g means “add 2″ and running f means “multiply by 6″ then f(g(a)) = h(a) = 6*(a+2).

Graphs

Uh… yeah. If you don’t know what a graph of a function looks like, get off my Internet lawn.

Some Important Functions

Can you round up to the nearest integer? Can you round down to the nearest integer? Then you can do ceiling and floor functions.

Next stop: Interesting Problems in 2.3

Posted in Autodidaction, Discrete Math | 5 Comments

## Calculus! #62: End of Calc 1 Wrap-Up

Chapter 4 Review and Calc 1 Wrap-up

After giving it a bit of thought, I’ve decided to not personally work the problems in this section. That you can do on your own, but if you’ve followed along so far, it should be relatively simple.

What I’d rather do is just talk about the important things I have a better grasp of going through Calc 1 for the second time.

1) Functions

I think I was always taught really to think of a function as a thing on a graph that relates x to y. This is a very impoverished understanding of things. A function is much more essential than that. Going back through calc 1 after learning a little discrete really clarified this for me.

A function is really a method to map from one set of numbers to another set. Understanding this idea really helps you understand what it means to take a derivative. You have a relationship between two sets of numbers.

A derivative is a way to meaningfully ask a certain type of question about that relationship. If the relation is between a set that describes your position and a set that describes your time, the derivative with respect to time asks how you change over time, as times changes. That is, it asks what your velocity is over time. Another derivative with respect to time gives you acceleration – how your position changes with respect to time, with respect to time, over time. In other words, when you’re taking the derivative, you’re asking a question about how two related things change their relation with respect to one more thing.

Hopefully that’s more enlightening than confusing. But, it helped me to be able to think of derivatives this way. Out of convenience, we often talk about derivatives in terms of change over time, but this is not the general case any more than it is the general case that y should always depend on x. It’s just convenience. So, it’s important to remember that a derivative is about how two things change with respect to each other.

3) Proofs

Going through the calc proofs was a lot easier this time around. For that, I of course credit my small knowledge of discrete, but I also credit having read Russells “History of Western Philosophy.” One of his great points is about the difference between science and math. To paraphrase, he says that science is the study of what is, and philosophy is the study of what would be if. I think there’s reason to suppose that these things overlap a bit, but it’s a great rule of thumb, and helped me think about proofs.

If I recall correctly, his example went something like this: In mathematics, someone might say “suppose there is a triangle, ABC, and blah blah blah.” This is perfectly permissible. In science, if someone says “suppose there is a triangle, ABC, and-” another person would be allowed to interrupt with “but there is no such triangle!” This is obviously not how things are done in math.

This helped me because I used to get bogged down in specifics. A proof might start “suppose there’s a disk,” which would always make me want to shout “there is no such damn disk!” Russell helped me relax about this. In math, your place isn’t to say “nuh uh” to a starting premise – it’s to accept the premise and see where it leads.

Well, I hope some of that was useful. As I’ve said before, I’m mostly doing this for myself, so the above is really just an inventory of my thoughts. Generally speaking, the intuitive feel for things is hard to transmit to other people. But, perhaps some of what I said can give you a head start. I find I’m always stumbling through the rocky path understanding, only to find out later there was a royal road I chose not to take.

Next stop: Chapter 5: Integrals

## Quote from G.K. Chesterton’s “The Napoleon of Notting Hill”

This would apply rather nicely to people predicting the future of China today.

All these clever men were prophesying with every variety of ingenuity what would happen soon, and they all did it in the same way, by taking something they saw “going strong,” as the saying is, and carrying it as far as ever their imagination could stretch. This, they said, was the true and simple way of anticipating the future. “Just as,” said Dr. Pellkins, in a fine passage,—”just as when we see a pig in a litter larger than the other pigs, we know that by an unalterable law of the Inscrutable it will some day be larger than an elephant,—just as we know, when we see weeds and dandelions growing more and more thickly in a garden, that they must, in spite of all our efforts, grow taller than the chimney-pots and swallow the house from sight, so we know and reverently acknowledge, that when any power in human politics has shown for any period of time any considerable activity, it will go on until it reaches to the sky.”

From “The Napoleon of Notting Hill.”

## Physics! #45: Force and Potential Energy

7.4: Force and Potential Energy

If you’ve been following along with calc, this should be relatively easy.

Here’s the idea: Force is the derivative of potential energy, with respect to position.

Mathematically, that’s: F(x) = dU/dx. This makes sense, since energy is force times distance. So, when you take the derivative with respect to change in position, you’re just taking distance back out.

To get a sense of what this means in reality. Suppose you hold a rock up (in a vacuum), then drop it. As it lowers, it has less potential energy, since its potential depends on its position in the gravity field of Earth. If you’re on the surface of the Sun (and, you know, not dead) what’s going to happen?

The rock is gonna drop a lot faster. The force of gravity is 28 times stronger than on earth. More importantly right now, when it lands on your toe, it’s gonna hurt a hell of a lot more. Why? Because to get that rock up there took a tremendous amount of potential energy. So, in the same distance, a lot more force of gravity does work on the rock.

The above equation is an expression of this idea in precise terms. If only a little force is acting on something, there won’t be a lot of change in U as the something changes position. If a lot of force is acting on something, there will indeed be a big change in U as x changes.

Flipping it around, if something gets a big change in U by changing position just a little, there must be a strong force in the area.

Of course, this is all true for any force, not just gravity. The book gives the example of spring energy. This is nice because it shows you that the equations you’ve got so far fit together nicely.

Remember how spring potential energy is given by $0.5kx^2$? Well, that’s the derivative of that? It’s kx, of course, which is the expression for force of an ideal spring.

You can do a similar trick to go from mgy (gravitational potential) to mg (force due to gravity).

Neat, right?

There’s a subsection here where the idea is extended into 3D. If you haven’t done any vector calc or partial derivatives, this might look freaky. It’s actually pretty simple.

As you know, there are 3 dimensions of space (at least… in Newtonland). This means that pushing something left or right doesn’t affect its position in up-down or North-South, and so on. So, long story short, for purposes of a derivative, if you only worry about one direction, the other stuff doesn’t matter (because the derivative of a constant is 0). So, for something moving in 3D, you can simply consider each direction separately for the purpose of derivatives, and then reassemble everything into a pretty vector.

If that sounds tricky, don’t worry. We’ll get more into it much later. For now, just know that such an operation is called “gradient” as in “I took the gradient of U” or “I took the grad of U.” And, that operation is denoted by an upside-down triangle.

Here they’re denoting it with an upside-down triangle with an arrow over it, but as far as I know, that’s just a notation choice.

For this case, you can think of gradient as the 3D analog of the derivative.

SO, once you have that in mind, it’s pretty easy. You can imagine a really contrived case where something has three different functions for U: an up-down one from gravity (the k direction), a left-right one from wind (i direction), and a North-South one from magnets (j direction). Using the gradient with respect on those functions, you can pretty easily figure out the force that acted on an object as it changed position and energy in that really contrived field.

Next stop: 7.5 – Energy Diagrams

Posted in Autodidaction, physics | 1 Comment