Monday, September 15, 2008

Proofs and Even/Odd Functions

Here is the second part of my chat discussion. I have edited this some, but I hope the essence of the questions and answers.

[Student]: ok, so im still iffy on how to structure proofs, ill know the assumption (obviosly) and the conclusion, but I'm unsure how to structure the premises and justify them
[Professor]: Well, basic ideas include starting the proof with your assumptions.
These are the basic statements you know are true.
[Student]: right

[Professor]: The very last line of the proof should match the conclusion. (and it shouldn't appear earlier) The hard part is what comes in between :-)
[Professor]: But seriously, usually, you take a look at your conclusion and see what type of statement it requires.

[Professor]: If it is an equation that is needed, then you can usually start with one side of the equation and then see what you can put on the other side that you know must be true. (Usually using a definition or algebra)

[Professor]: Then you see how you can use your assumptions to create a statement that leads to your conclusion.

After turning to an actual problem, we started to get into more specifics. The problem was stated as: Suppose that f1 and f2 are odd functions. Prove that f1*f2 is an even function.


[Professor]: What is given knowledge?
[Student]: f1 and f2 are both odd and g1 and g2 are even
[Professor]: What is desired? (conclusion)
[Student]: f1 * f2 is even
[Professor]: What does it mean that f1 is odd?
[Student]: that f(-x) = -f(x)
[Professor]: Make the f into f1, and correct.
[Student]: ah ok ya
[Professor]: So in the actual proof, one line would be...
f1 is an odd function
[Professor]: The next line would interpret...
f1(-x) = -f1(x) for all x in domain of f1
[Professor]: Repeat these two lines for f2.
[Professor]: So far, we have simply restated facts based on the assumptions and our knowledge of odd functions.
[Student]: and that is all stuff that is under the given part? rite
[Professor]: In the proof, it doesn't belong to a "given" part per se, but the reason on the right hand side (if in tabular form) would be that the statement was "Given"
[Professor]: So our proof now has 4 statements.

[Professor]: Now, (scratch work) look at what you need to show: f1*f2 is even. What does that mean?
[Student]: ok ya i have no idea, i feel like it would involve one of the multiplicative properties involving f1 and f2 but i dont really know where to start
[Professor]: What does it mean if I said that G is an even function? g(x) = g(-x) My name was G, so it would be G(x)=G(-x).
[Professor]: But the name could be Brian: Brian(-x)=Brian(x). Voila! I [Brian] am even.
[Professor]: f1*f2 is the name of a function. And for f1*f2 to be even, you need: f1*f2(-x) = f1*f2(x)
[Professor]: It just happens that the name looks like a formula.
[Student]: theres noit a step in between there?
[Student]: to justify how multiplying the functions is ok
[Professor]: Well, there are still steps. But we need to know what we are aiming for.
[Student]: ah
[Professor]: You know what f1 and f2 are. They are odd functions. But exactly what is this new function that we call f1*f2?
[Student]: idk f1(x) * f2(x)
[Professor]: Exactly!
[Student]: or f1(-x)
[Professor]: No
[Student]: * f2(-x)
[Student]: no ok
[Professor]: So we know f1*f2(x) = f1(x)*f2(x)
[Student]: yep
[Professor]: And it looks like you were in the middle of the thought: f1*f2(-x) = f1(-x)*f2(-x)
[Student]: ya
[Professor]: Okay, things are starting to come together.
[Student]: sort of
[Professor]: We want to show f1*f2(-x)=f1*f2(x)
[Student]: substitution?
[Professor]: Yep. Back to the proof. We need to use substitution to get our final result. But we do it one step at a time.

[Professor]: I'll type the left hand side, you type the right hand side.
[Professor]: f1*f2(-x) = ?
[Student]: f1(-x) * f2(-x)
[Professor]: Good. But f1(-x) = ? and f2(-x) = ?
[Student]: f1(x) * f2(x)
[Student]: oh
[Professor]: And finally, f1(x)*f2(x) = ?
[Student]: f1*f2(x)
[Professor]: Precisely. Putting those together, we now know f1*f2(-x) = f1*f2(x).
[Professor]: And that means ...
[Professor]: f1 * f2 is even
[Professor]: Q.E.D. :-)
[Student]: sooo i guess i then assemble all of those steps or just some of them
[Professor]: You can leave out the parts that I said belonged as scratch work.
[Professor]: There were four lines associated with the given information. Then I said "back to the proof" and there were probably four more lines. That is the proof.
[Student]: ic ok
[Student]: ugh, this is def not my fav stuff, i cant believe i haven't learned this before

In summary, here is our proof:
f1 is an odd function
f1(-x) = -f1(x) for x in domain
f2 is an odd function
f2(-x) = -f2(x) for x in domain
f1*f2(-x) = f1(-x) * f2(-x)
= (-f1(x))*(-f2(x))
= f1(x)*f2(x)
= f1*f2(x)
So f1*f2(-x) = f1*f2(x) for x in domain
f1*f2 is an even function

Now, back to the discussion. Another problem dealt with composition. That is, students were to prove: If f1 is an odd function and g1 is an even function, then g1•f1 is an even function. Here is where part of that discussion went.


[Student]: so how do the g1(f1(x)) differ, i guess proving that f1(x) is odd, and then proving then that g1(x) is odd because of f1(x)?
[Professor]: One key point is that the definition of odd or even --- f(-x) = -f(x) and g(-x)=g(x) --- is that the x is simply a place-holder and the same statement would be true regardless of what is in the place of the x.
[Professor]: So for example f(-(x+2)) = -f(x+2), where the "x" was actually the formula x+2.
[Student]: right
[Professor]: Now, be more specific on your question related to composition.
[Student]: so once i prove that f1 is even then it would be the same justification for g1
[Professor]: Careful! f1 is odd (from the given information), so you can't prove it is even.
[Student]: well, opposite justification
[Student]: I'm still not sure of the question.
[Professor]: g1 alone is known to be even. There is nothing to prove about that.
[Student]: ok
[Student]: timeout, so all id have to do is justify g1 as being even regardless of f1?
[Professor]: Why? What are your steps?
[Professor]: And what are you trying to prove?
[Student]: so its given that g1 is even and f1 is odd and we're trying to prove that g1(f1(x)) is even
[Professor]: Technically, g1•f1 is even.
[Professor]: g1(f1(x)) is a value, not a function.
[Professor]: So you need to show g1•f1(-x) = g1•f1(x).
[Student]: wait im confused
[Student]: ok
[Student]: i get it
[Student]: couldnt you just subsitute -x for f1(-x)
[Professor]: No for what you said. f1(-x) and -x are different, so they don't substitute.
[Professor]: But I don't think that is what you were thinking. Try to restate.
[Student]: you could justify g1(f1(x)) = g1(f1(x)) with g(x)=g(-x)
[Student]: -f1(x)*
[Professor]: I think you're on the right track. But be careful that you go step by step.
[Professor]: What are all the steps?
[Professor]: I'll start it off... g1•f1(-x) = ?
[Student]: thats where im confused, do you need a a step for that?
[Professor]: Yes. You must relate the function (g1•f1) to the rest of the formulas.
[Student]: g1(f1(-x))= g1(f1(x) )
[Professor]: What justifies that? The -x belongs to f1, not g1
[Student]: g1(-f1(x)) def of odd fcn
[Professor]: So don't skip that step
[Student]: so whats after that then?
[Professor]: Well, why don't you summarize the statements so far. Start again with: g1•f1(-x) = ...
[Student]: g1(f1(-x)) = g1(-f1(x)) b/c of the def of odd fcns
[Professor]: Very good. Now, what does g1 do when you have g1(-[anything])?
[Student]: g1(-x)=-g1(x) ? but that would make it odd
[Professor]: So use the fact that g1 is even. g1(-x)=?
[Student]: g1(x)
[Professor]: So g1(-U) = g1(U) or g1(-f1(x)) = g1(f1(x))
[Student]: k
[Professor]: It doesn't matter what appears.
[Professor]: g1(-[stuff]) = g1([stuff])
[Professor]: So you left off at: g1 o f1(-x) = g1(f1(-x)) = g1(-f1(x)) = ... (finish it off)
[Student]: g1(-f1(x))=g1(f1(x))
[Professor]: And how does that relate to g1•f1?
[Student]: g1(f1(x)) = even
[Professor]: not equal even. g1(f1(x)) = g1• f1(x).
[Professor]: Recall, you are working with the function g1•f1. You need to show g1•f1(-x) = g1•f1(x).
[Student]: i just got a little confused
[Student]: whats the diff between g1(f1(x)) = g1•f1(x)
[Student]: ah i c nev mind
[Professor]: same value but only g•f can be called the name of the function
[Student]: ok
[Student]: so g1•f1(x) = g1•f1(-x)
[Professor]: That would be the final line to show that g1•f1 is an even function.
[Student]: ok that makes sense

And that leads us to our second proof:
f1 is an odd function
f1(-x) = -f1(x) for x in domain
g1 is an even function
g1(-x) = g1(x) for x in domain
g1•f1(-x) = g1(f1(-x))
= g1(-f1(x))
= g1(f1(x)
= g1•f1(x)
So g1•f1(-x) = g1•f1(x) for x in domain
g1•f1 is an even function

Do you know how to do the justifications of each line now?

Domain and Codomain

I had a nice chat this afternoon with one of my students. The first topic had to do with the notation f : D→S. Here is what we said:

hi prof walton, i have a quick question
Shoot (but don't hurt me.)
haha, ok so i am under the impression that when functions
say f: x → x that means that the domain and the codomain
are the same but the ranges can be different correct?

The codomain (after arrow) lists the type of numbers
that might be values in the output, while the domain
(before arrow) lists all of the numbers that are in the
list of potential inputs. The range is the list of numbers
that actually are outputs. Is this the question?

yep, so the range is a sub"field" of the codomain rite
it lists all possibles while the range is what numbers
are in the function ?

subset instead of sub"field". Otherwise, yes.
haha ya i was lookin for that word
The cheapest answer for codomain would be simply R
(all real numbers). If the codomain is listed as something
more specific, that helps us understand the function better,
but we still might skip some of the numbers in the set.
ic, so when im looking at f and g that have the same
codomain, that then would not imply that f(g) = g(f)
because the ranges could be different?
or is
f(g) being = to g(f) relational to the domain only
Equality of functions requires that they have the same
domain and the same values at every point in that
domain.
If the domain is different, then the functions
must not be equal.
If the functions have different
values for any point, then the functions are not equal.

so d → s just means that the domain could produce
these outputs right?

That's right. The outputs must be somewhere in the
list known as S.
And the inputs only make sense if they
are in D.

but s just means possible outputs because its the codomain rite
Yes, because it is the codomain (after arrow)
rite rite rite, gotcha, this stuff is weird

Monday, September 8, 2008

Fun with Functions

Cryptography is an interesting application of functions. A cipher allows you to take text (for example) and encrypt it into a new form of information that can then be transmitted. Most children learn a particularly simple cipher that is called a substitution cipher. Such a cipher does a direct translation of letter for letter. Below is a simple example, motivated by the "stage-appearance" of the letters in the phrase "The quick brown fox jumps over the lazy dog."



Other simple ciphers include shifting the alphabet a fixed number of letters or reversing the alphabet.

If we think of encrypting a message as being a function from character sequences to new character sequences, then we might imagine applying two different encryptions one after the other. This is function composition. Or we might want to decrypt a message. This is applying the inverse function. In particular, note that for an encryption method to be useful, the inverse must exist. That is, the function must be one-to-one.

Here is a message that I constructed using the QUICKBROWN cipher (above) followed by a shift cipher where an A becomes an R. Have fun!

JLWH EL MBSJ KJ LPMGK VGLHSM ZOG DCSX TGKHL.

Wednesday, August 27, 2008

Absolute Value Inequalities

Well, perhaps I muddied the water for some of you. Sorry about that. In terms of skills, when you solve |u|<a where u is any expression and a is another expression [I thought it was for constants, but it turns out to always work], you can solve by finding the intersection (and) of the solutions to u<a and to -u<a, which we write u<a and -u<a. When you solve |u|>a, you find the union (or) of the solutions to u>a and to -u>a, which we write u>a or -u>a.

My explanation in the supplemental handout was to motivate why this works. After all, the course is not just about skills, but it is also about justification. The absolute value is a piecewise-defined function. That is, there are different rules depending on the value of the expression being worked with. The skill-based method that works for absolute value does not work for other piecewise-defined functions. But thinking about each of the "pieces" separately and joining them properly will always work.

Since the handout was a first edition, I'm curious where you found the biggest issues.

Monday, August 25, 2008

Solving Equations Graphically

So, in class today, some of you may have been wondering about the computer program that I was using. This utility is called Grapher and it is installed in any recent Mac OS computer. You'll find it in the Utilities folder within Applications.

I was wondering then whether there is a similar resource available for Windows computers as well. Doing a Google search on "Graphing Calculator" I found the following possibility: GraphCalc. I don't have immediate access to check this out, so I'd certainly welcome some comments here as to how well it works.

Now that you have something to work with (and a calculator will work as well, just a little slower), here is something interesting to notice. To solve ax=sin(x), we need to plot y=ax and y=sin(x). You also need to choose a value of a. In Grapher, you would add a New Equation (Cmd-Opt-N) like a=0.25. You now need to find where these graphs intersect.

In class, we learned that we can create new equations that have the same solutions by performing the same operation to both sides (other than division, where we worry about division by zero). So we could get a new equation like a=sin(x)/x. Now we plot y=a and y=sin(x)/x. If you add these as two new graphs instead of getting rid of the old plots, you can compare the two equations graphically. Here is the plot:
I used different colors to distinguish which intersections I was looking for.

For the original equation (ax=sin(x), shown in red), we see there are three intersections. For the new equation (a=sin(x)/x, shown in green), we only have two intersections. But those two intersections agree exactly with the original (see the highlighted intersection at the same value of x marked by circles), and the third corresponds to x=0 which disappeared because we divided both sides by x.

Calculus I -- Welcome Fall 2008

Welcome to JMU and your first semester of calculus. I'm excited this semester to be teaching calculus again. I hope that you're excited as well.

So, while I was preparing for class, I came across MIT's open courseware program. This is a pretty amazing collection of knowledge that is freely accessible. Feel free to browse it. In particular, I found a text written by Gilbert Strang that will be an outstanding parallel reference for our course this year. I'm especially impressed with how he makes the text conversational in style rather than the more typical dry style of math textbooks.

We'll be pushing through the first chapter of our official textbook very quickly as it should be a review of mathematics that you have already taken.

See you in class!

Monday, March 31, 2008

Central Limit Theorem

The central limit theorem allows to use a standard normal random variable as an approximating proxy for a properly centered and rescaled sample mean.

First, for any random variable Y with expected value E[Y]=μy and variance Var(Y)=σy2, if we center and rescale as W=(Y-μy)/&sigmay;, then W will always have expected value E[W]=0 and variance Var(W)=1. But it is not the case that W behaves like a standard normal distribution unless Y is somehow special. However, in special cases, when Y can be represented in terms of a sum of many independent and identically distributed random variables, then the central limit theorem can help us.

In particular, if Y is the sample mean of a random sample X1, X2, ..., Xn, then Y=(X1+...+Xn)/n. Suppose that each Xi has expected value E[Xi]=μx and variance Var(Xi)=σx2. Then we know that μyx and σy2x2/n. Our centered and rescaled version of Y can be expressed in terms of the parameters for X: W=(Y-μy)/σy = (Y-μx)/(σx/√n). Because Y can be defined in terms of a constant times the sum of i.i.d. random variables, W has an approximately standard normal distribution.

As a second example, suppose that Y is the sum of a random sample X1, X2, ..., Xn, with Y=X1+...+Xn. Suppose that each Xi has expected value E[Xi]=μx and variance Var(Xi)=σx2. Then we know that μy=nμx and σy2=nσx2. Our centered and rescaled version of Y can be expressed in terms of the parameters for X: W=(Y-μy)/σy = (Y-nμx)/((√n)σx). Again, since Y can be defined in terms of a constant times the sum of i.i.d. random variables, W has an approximately standard normal distribution.

Quite a few of our known distributions can be described as a sum of i.i.d. random variables. The most famous is the binomial distribution. Suppose that Y has a binomial distribution with n trials and probability p. Then we can think of Y as the sum of n i.i.d. Bernoulli random variables X1,...,Xn, each with parameter p. Then μx=E[Xi]=p and σx2=p(1-p), leading to μy=np and σy2=np(1-p). Consequently, W=(X-np)/√(np(1-p)) has an approximately normal distribution. In this example, we usually find that we need np≥5 and n(1-p)≥5 for the approximation to be good.

Other random variables that can be represented as a sum of simpler i.i.d. random variables. The Poisson distribution for large value λ can be rewritten as the sum of many smaller Poisson RVs with small values of λ (X1,...,Xn each Poisson with rate λ/n). The Gamma distribution (including Chi-Square) can similarly be written as a sum of many simpler Gamma (or Chi-Square) random variables. In each of these cases, a centered and rescaled version of the random variable W=(Y-μy)/σy will be approximately a standard normal distribution.