Showing posts with label tutoring. Show all posts
Showing posts with label tutoring. Show all posts

Monday, 20 April 2015

Maths on Steroids (Accelerated Mathematics 1, 2015): 3

If-statements, for-loops, while-loops, what are they good for? Absolutely...everything in programming?

For most of you, last week would have been the first time that you've seen an if-statement in Matlab. And you were given a slightly involved task: you were asked to write up a function that takes in a matrix \(A\) and does the following:
  1. checks if \(A\) is square;
  2. checks if the columns of \(A\) each add up to \(1\);
  3. checks if the entries of \(A\) are all non-negative;
  4. puts out a message if any of the checks fail;
  5. outputs the row-reduced form of \(I-A\) if \(A\) satisfies the checks.
To begin with, let's have a think about how to write if-statements for each of the checks in Matlab.

1. If \(A\) is square.

Here's a simple if-statement to check for square-ness:

[m,n]=size(A);
if m~=n
    'Not square enough?'
end

So, what does it do? We first compute the size of the matrix A, this is a vector whose first entry is the number of rows that \(A\) has and whose second entry is the number of columns. Thus, writing "[m,n]=size(A)" is to assign "[m,n]" to be this vector; i.e.: m=the number of rows of \(A\) and n=the number of columns of \(A\). Then, if m isn't equal to n, this little if-statement outputs the message "Not square enough?", but if m is equal to, then nothing happens.

One question that you should be asking at this point is: what's the deal with the semi-colon ";" at the end of the first line. Why do we bother having it at all? Well, semi-colons at the end of a command lets you run that command without displaying the results. For our purposes, we wanted to assign numbers to m and n, but we didn't really want to see them. Hence the semi-colon. On the other hand, we definitely wanted to be able to read the message "Not square enough?", so we didn't put a semi-colon after that.

2. If the columns of \(A\) add up to \(1\).

This first idea might be to write something like the following:

[m,n]=size(A);
if sum(A)~=ones(1,n) (THIS IS WRONG!)
    'columns need to sum to one!'
end

And where this goes wrong (my mistake - I actually thought that this worked during the Tuesday lab), is that the if-statement then just checks if the first entries of "sum(A)" and "ones(1,n)" are equal. So, it only checks if the first column of \(A\) adds to \(1\).

Here's the "intended" if-statement:

[m,n]=size(A);
T=sum(A);
t=0;
for k=1:n
    if T(k)~=1
        t=t+1;
    end
end
if t>0
    'columns need to sum to 1!'
end

We start by creating a vector \(T\) corresponding to the column-sum of \(A\). Now, we'd like to check if each entry of \(T\) is equal to \(1\), and the above code deals with this by creating a variable \(t\) that increases by \(1\) for every entry \(T(k)\) of \(T\) that isn't equal to \(1\). So, after going through the entries of \(T\) using the for-loop in the third line, either \(t=0\) in which case \(T\) is a row of \(1\)s, or \(t>0\), in which case \(T\) isn't a vector of \(1\)s and hence the columns of \(A\) don't each sum to \(1\). Note that again, nothing happens if the columns of \(A\) each sum to \(1\).

Aaaaaaand, now that you've understood how that worked, let me tell you about alternative ways of doing step 2. To begin with, let's understand how truth values work. You saw in this tute that writing "m==n" lets you check if m is equal to n. But have you tried typing this into Matlab and seeing what you get? Try "3==3" and "3==2" (without the quotation marks). You should have gotten "ans=\(1\)" and "ans=\(0\)" respectively: that's right! Matlab thinks of \(1\) as "true" and \(0\) as "false". Soooo, what happens if I type in something like "[3 2]==[3 3]"? Well...TRY IT! You should get in return a vector "[1 0]", signifying that this is true for the first value, and false for the second value. Sooo....how can we use this to our advantage? Here's a first idea:

[m,n]=size(A);
if sum(sum(A)==ones(1,n))~=n
    'columns need to sum to one!'
end

So, what's going on here? The command "sum(A)==ones(1,n)" checks the column-sum vector of \(A\) against a row of \(1\)s and outputs a vector filled with \(1\)s and \(0\)s signifying whether the corresponding entries of these two row vectors match up. IF every column sums to \(1\), then we should expect "sum(A)==ones(1,n)" to produce a length n vector of \(1\)s - signifying "true" in every entry. If not, then some of the outputs will be \(0\). Now, the sum function not only adds up the columns of a matrix \(A\), it also adds up all the entries of a row vector (if you didn't know this, you could have still taken a transposition of a row vector and then applied the sum function). So, the above code basically checks if "sum(A)==ones(1,n)" is n and displays a message if it's not.

And here's another variant:

[m,n]=size(A);
if sum(abs(sum(A)-ones(1,n)))>0
    'columns need to sum to one!'
end

The absolute value function "abs", when combined with "sum" adds up the difference between sum(\(A\)) and a row of \(1\)s. So, if there is no difference, then this should be \(0\) and if there is a difference, then it'll be strictly above \(0\).

See if you can come up with something-else?

3. If every entry of \(A\) is positive.

To begin with, let's start with something that doesn't work:

[m,n]=sum(A);
if A~=abs(A) (THIS IS WRONG!)
    'slightly too negative =('
end

Again, the problem here is that "A~=abs(A)" only checks to see if the first two entries of these two matrices are equal, and neglects the rest. =/

The "intended" solution is something like the following:

[m,n]=size(A);
u=0;
for j=1:m
    for k=1:n
        if A(j,k)<0
            u=u+1;
        end
    end
end
if u~=0
    'slightly too negative =('
end

Like before, the \(u\) here is a marker for how many entries are negative. The two nested for-loops lets us go through all of the entries of \(A\) and checks if they're (strictly) negative.

And, here's an alternative method - see if you can figure out what's going on:

[m,n]=size(A);
if sum(sum(A==abs(A)))<m*n
    'slightly too negative =('
end

And another variant:

[m,n]=sum(A);
if sum(sum(A-abs(A)))>0
    'slightly too negative =('
end

4. Putting all of this together in just a single for-loop, and in the form of a function, we have:

Method 1:

function B=xx_solve(A)
[m,n]=size(A);
T=sum(A);
t=0;
for k=1:n
    if T(k)~=1
        t=t+1;
    end
end
u=0;
for j=1:m
    for k=1:n
        if A(j,k)<0
            u=u+1;
        end
    end
end
if m~=n
    'Not square enough?'
elseif t>0
    'columns need to sum to 1!'
elseif u>0
    'slightly too negative =('
else
    B=rref(eye(n)-A);
end

This is the most rudimentary, and in some sense, most "universal" version. The ideas that you use here apply to most programming languages.

One thing that you might ask is why there is a semi-colon after "B=rref(eye(n)-A)", as this would withhold the displaying of the matrix \(B\) - the desired output? Well, that has to do with the first line: the fact that it's written "B=xx_solve(A)" means that inputting \(A\) into the function xx_solve will output "B" (provided that everything goes right).

Method 2:

function B=xx_solve(A)
[m,n]=size(A);
if m~=n
    'Not square enough?'
elseif sum(sum(A)==ones(1,n))<n
    'columns need to sum to 1!'
elseif sum(sum(A==abs(A)))<m*n
    'slightly too negative =('
else
    B=rref(eye(n)-A);
end

This should be pretty self-explanatory, right?

Method 3:

function B=xx_solve(A)
[m,n]=size(A);
if m~=n
    'Not square enough?'
elseif sum(abs(sum(A)-ones(1,n)))>0
    'columns need to sum to 1!'
elseif sum(sum(A-abs(A)))>0
    'slightly too negative =('
else
    B=rref(eye(n)-A);
end

And here's a fnal method...it's the intended method in Matlab, but requires knowing a specialised command called "isequal" that basically tests if two matrices are completely equal.

Method 4:

function B=xx_solve(A)
[m,n]=size(A);
if m~=n
    'Not square enough?'
elseif isequal(sum(A),ones(1,n))
    'columns need to sum to 1!'
elseif isequal(A,abs(A))
    'slightly too negative =('
else
    B=rref(eye(n)-A);
end

This is the most efficient method, but it's also pretty Matlab-specific? And to be fair...it's a little bit on the boring side...so...um, totes go with the other methods guys!?!? Totes.


Thursday, 16 April 2015

Maths on Steroids (Accelerated Mathematics 1, 2015): 2

The week before Easter, a friend of mine showed me the following question before my Tuesday morning tute, I solved it and decided that it'd be a good question to give to you guys. =P

Actually, we could do this question using Descartes' circle theorem, but that's probably a bit overkill. Instead, let's tackle it with basic primary school geometry, and a bit of induction and telescoping! Consider the following figure:

Problem: order the radii of all the little yellow circles up from the bottom of the center as a sequence \(\{r_n\}\) and show that \begin{align}r_n=\frac{1}{2n(n+1)}.\end{align} When doing proofs for general results like this, it can often really really help to work out a few baby cases. So, let's start by showing that \(r_1=\frac{1}{4}\).

As you can see from the diagram below, we've got a (vertical) trapezium with two right angles opposite each other and with the parallel sides of lengths \(1\) and \(r_1\). Thus, by chopping off a rectangle at the bottom of this trapezium, we're left with a right-angled triangle with sides of lengths \(1-r_1,1\) and \(1+r_1\).
And so, Pythagoras' theorem tells us that \begin{align} (1-r_1)^2+1^2&=(1+r_1)^2 \\ \Rightarrow 1&=4r_1.\end{align} Oookay, that was fair straight forward. Let's try this again for \(r_2\):
So, we see that by repeat this trapezium trick to calculate \(r_2\) we get: \begin{align} (1-2r_1-r_2)^2+1^2&=(1+r_2)^2\\ \Rightarrow 1&=(1+r_2)^2-(1-2r_1-r_2)^2\\ &=4(r_1+r_2)(1-r_1).\end{align} Substituting in \(r_1=\frac{1}{4}\), we show that \(r_2=\frac{1}{12}\). Now, if we keep going with this trapezium trick (*), we see that to compute \(r_{n+1}\), we get: \begin{align} (1-2(r_1+\ldots+r_n)-r_{n+1})^2+1^2&=(1+r_{n+1})^2\\ \Rightarrow 1&=(1+r_{n+1})^2-(1-2(r_1+\ldots+r_n)-r_{n+1})^2\\ &=4(r_1+\ldots+r_{n+1})(1-r_1-\ldots-r_{n}).\end{align} Thus, \begin{align} r_{n+1}=\frac{1}{4-4(r_1+\ldots+r_n)}-(r_1+\ldots+r_n).\end{align} So, we've now got this recursive expression for \(r_{n+1}\) and recursion should really make us think: induction.

We're going to use a slightly stronger form (**) of mathematical induction than what you're used to seeing. Don't worry - the logic is the same. =) Okay, here goes...

Let's start off with a proposition: let the proposition \(p(n)\) be the statement that \(r_n=\frac{1}{2n(n+1)}\), and we're going to prove these statements for every \(n\in\mathbb{N}\).

Base case: \(n=1\)... well, we've actually already proven this above. We showed that \(r_1=\frac{1}{4}=\frac{1}{2\times1\times 2}\).

(Strong) induction step: now, we're going to do something a little different to showing that "\(p(k)\Rightarrow p(k+1)\)". We're actually going to show that \begin{align}p(1),p(2),\ldots, p(k)\text{ all being true }\Rightarrow p(k+1)\text{ is true.}\end{align} Take a moment to think about that logic, and I hope that you see that it's the same type of logic as you usually use in induction, except that it feels stronger because you're assuming more things for the induction step.

Okay....breathe out.

So, let's assume that \(p(1),\ldots,p(k)\) are all true. Now, we showed before that \begin{align} r_{k+1}=\frac{1}{4-4(r_1+\ldots+r_k)}-(r_1+\ldots+r_k).\end{align} And now, invoking all of our assumptions, we can try to work out what \(r_1+\ldots+r_k\) is equal to, and hence what \(r_{k+1}\) is equal to: \begin{align} r_1+\ldots+r_k&=\frac{1}{2}\left(\frac{1}{1\times 2}+\frac{1}{2\times 3}+\ldots+\frac{1}{k\times (k+1)}\right)\\ &=\frac{1}{2}\left(\frac{1}{1}-\frac{1}{2}+\frac{1}{2}-\frac{1}{3}+\frac{1}{3}-\frac{1}{4}+\ldots-\frac{1}{k}+\frac{1}{k}-\frac{1}{k+1}\right)\\ &=\frac{k}{2(k+1)}.\end{align} W000t! Telescoping! And substituting this in, we get that: \begin{align}r_{k+1}&=\frac{1}{4-\frac{2k}{k+1}}-\frac{k}{2(k+1)}\\ &=\frac{k+1}{2(k+2)}-\frac{k}{2(k+1)}\\&=\frac{(k+1)^2-k(k+2)}{2(k+1)(k+2)}=\frac{1}{2(k+1)(k+2)},\end{align} which is precisely what we want. I.E.: the proposition \(p(k+1)\) is true!

Therefore, by the principle of (strong) mathematical induction, the propositions \(p(n)\) are true for all \(n\in\mathbb{N}\).

=)

*: Bah, I didn't feel like drawing the diagram.
**: strictly speaking, it's not stronger - it's the same strength! It's just that it seems stronger.

Monday, 23 March 2015

Analysis for Realsies (2015): 1

Hey guys! Sooo, last week in Tute A y'all saw this cool fact that one way to check the divisibility of a (natural) number by \(3\) is to add up all of its digits and check to see if the resulting sum is divisible by \(3\).

E.g.: take \(832745812349\), now \(8+3+2+7+4+5+8+1+2+3+4+9=56\) and \(56\) isn't divisible by \(3\). Therefore \(832745812349\) isn't divisible by \(3\).

And in fact, this is also true for \(9\), you can add up the digits of a number and if this sum is divisible by \(9\), then the original number must also be divisible by \(9\) (and vice versa).

I then asked you to try to figure out a similar trick for \(11\), and you can find the rule (and a derivation/proof) here!

Well, I then issued like a super-ninja-hax-challenge version of this where I asked you to derive a similar rule for divisibility by \(101,1001,10001,100001,\ldots\) How did you go with this? I'll write the answer below, but I kinda want you to take a look at the above blog post first.

Here we go:

So, the trick for divisibility with respect to \(11\) of a \(k\)-digit whole number (with digit representation) \(\overline{n_0 n_1 n_2\ldots n_k}\) is to take the following "alternating sum" \begin{align} n_k-n_{k-1}+n_{k-2}-\ldots+(-1)^kn_0,\end{align} and if this sum is divisible by \(11\), then the original number is divisible by \(11\). Note in particular, the order in which we've go - we've taken the last digit, subtracted the second last...etc. And the reason that we've done this is because this presentation generalises more easily to \(101,1001,\ldots\)

So, what about \(101\)? Well, the rule is to take the last two digits, subtract the next pair, then add the next pair, and so forth. So, let's see an example:

the number \(74914071682\) satisfies that \begin{align} 82-16+7-14+49-7=101,\end{align} which is clearly divisible by \(101\). Thus, \(74914071682\) should be divisible by \(101\) and indeed:  \(74914071682=101\times 741723482\).

And the generalisation to \(1001\) involves us taking the last three digits, then subtracting the next triple, and adding the next triple...etc. And I the pattern goes on...

What about the proof!? I hear you ask. Well, it's pretty similar to the proof for our rule regarding divisibility by \(11\). So, I'll let this to you guys as a healthy challenge exercise. =)

Maths on Steroids (Accelerated Mathematics 1, 2015): 1

Alright, alright, alright, alright as promise: I'mma give a more detailed explanation of how to do question 24 from your tutorials using...symmetry. =D (*)

But because we launch into that, some of you might find this blog entry from a previous year useful. Those who are in my tutes will have seen the very first thing in this blog post, but those who're only in my lab might find it interesting. I also go through a line-by-line analysis of the code at the end of last week's lab - if you totes understood everything, then great! If not, this might be a useful reference (plus, I point out a few things along the way - who knows, maybe you missed something?).

Okay, on to symmetry?

Now, we want to prove that \begin{align}\left| \begin{array}{ccc} 1 & 1 & 1 \\a & b & c \\ a^3 & b^3 & c^3\end{array}\right|=(a-b)(b-c)(c-a)(a+b+c).\end{align} And the first thing that I want to do is to make the following observations:

  1. The determinant is going to be a degree 4 polynomial in \(a,b,c\). This is because each (monomial) term in the determinant is a product of matrix entries taken from different rows and different columns (have a gooooood think about how cofactor expansion works).
  2. If any two of the three variables are equivalent, e.g.: \(a=b\), then the matrix has repeated columns and hence will have determinant equal to \(0\) (**). This tells us that \((a-b),(a-c)\) and \((b-c)\) must all be factors of the determinant.
  3. Switch any two of the variables in the matrix has the same effect as switching the two corresponding rows! This means that the determinant changes sign every time you switch two variables
Aaaaand, that should be enough to get us started.

Now, we know that the determinant is some polynomial \(d(a,b,c)\). And observation 2 tells us that \begin{align} d(a,b,c)=(a-b)(b-c)(c-a)\times p(a,b,c),\end{align} where \(p(a,b,c)\) is another polynomial in \(a,b,c\). Add on the fact that observation 1 tells us that every single term in \(d(a,b,c)\) has to be degree 4, this tells us that the polynomial \(p(a,b,c,)\) actually has to be linear: \begin{align} p(a,b,c)=\alpha a+\beta b+\gamma c\text{, for some }\alpha,\beta,\gamma\in\mathbb{R}.\end{align}

Okay, so it's lookin' preeeetty good...we're getting a good handle-hold on what \(d(a,b,c)\) looks like.

Thanks to observation 3, we know that \(d(a,b,c)=-d(b,a,c)\) and so: \begin{align} (a-b)(b-c)(c-a)p(a,b,c)&=-(b-a)(a-c)(c-b)p(b,a,c)\\&=(a-b)(b-c)(c-a)p(a,b,c)\\ \Rightarrow p(a,b,c)&=p(b,a,c)\\ \Rightarrow \alpha a +\beta b+\gamma c &= \alpha b+\beta a+\gamma c.\end{align} Since \(a\) and \(b\) are independent variables, this means that \(\alpha=\beta\). By the same logic applied to \(a\) and \(c\), we get that: \begin{align} \alpha=\beta=\gamma.\end{align} Soooo, we've just shown that the determinant may be written as \begin{align} d(a,b,c)=\alpha (a-b)(b-c)(c-a)(a+b+c),\end{align} and all we need to do now, is to show that \(\alpha=1\). One way to do this is to substitute nice numbers into \(a,b,c\) and to work it out. In fact, if we just set \(a=0\) we see that \begin{align}d(0,b,c)=\left| \begin{array}{ccc} 1 & 1 & 1 \\ 0 & b & c \\ 0 & b^3 & c^3\end{array}\right|=\left|\begin{array}{cc}b & c\\ b^3 & c^3\end{array}\right|=bc(c-b)(b+c).\end{align} Since we know that \begin{align}d(0,b,c)=\alpha bc(c-b)(b+c),\end{align} this gives us the desired conclusion that \(\alpha=1\).

AND WE'RE DONE! Now, this technique can also be used to do the other determinant in this question. It's a little bit trickier though...and you'll need to show, using symmetry arguments, that at some point you can get the determinant \(d(x,y,z)\) into the following form: \begin{align} d(x,y,z)=(x-y)(y-z)(z-x)[\alpha (x^2+y^2+z^2)+\beta (xy+yz+zx)],\end{align} and then show that \(\alpha=0\) and \(\beta=1\). This is a healthy exercise and you should all totes give it a try!


*: Note to self: smileys look vaguely wrong in a serif font... =/
**: if you didn't know this, combine the fact that determinants aren't changed by transposition and the method of computing determinants using row reduction

Tuesday, 25 November 2014

I Refuse to Name This "Complex Analysis...Made Simple": 5 (final)

Well, well well, wellity well well...I have no idea what to write about for this last blog entry. =/

Let's talk about...Riemann spheres!

So, at some point in this complex analysis course, you'll have learned that we really ought to think of the complex plane \(\mathbb{C}\) as lying on the Riemann sphere \(\hat{\mathbb{C}}:=\mathbb{C}\cup\{\infty\}\). Doing so means that meromorphic functions \(f:\mathbb{C}\rightarrow\mathbb{C}\) (i.e.: they have poles) may be thought of as holomorphic functions \(f:\mathbb{C}\rightarrow\hat{\mathbb{C}}\). Moreover, if the behaviour of \(f(z)\) is nice enough at \(z=\infty\) (i.e.: no essential singularities), then \(f\) can be extended to a holomorphic function \(f:\hat{\mathbb{C}}\rightarrow\hat{\mathbb{C}}\).

One class of these holomorphic functions between Riemann spheres that you've encountered in this course are Mobius transformations: \begin{align} z\mapsto\frac{az+b}{cz+d}\text{, where }ad-bc\neq0.\end{align} You've already seen some nice facts about them. You know that they are conformal (definition: angle-preserving) transformations, that they take circles/lines to circles/lines and you know that they're bijections. In fact, they are precisely the collection of all bijective holomorphic maps between Riemann spheres.

Let's prove this!

Consider a bijective holomorphic function \(f:\hat{\mathbb{C}}\rightarrow\hat{\mathbb{C}}\). Since this is bijective, let \(a,b\in\mathbb{C}\) respectively denote the points which map to \(0=f(a)\) and \(\infty=f(b)\). We may assume by precomposing \(f\) with a Mobius transformation that \(b\neq\infty\). Now \(z=a\) must be an order 1 zero, or else there'd be a small neighbourhood around it where two points map to some \(\epsilon\) close to \(0\). Likewise we can argue that \(z=b\) must be an order 1 pole of \(f\) by considering the function \(f(\frac{1}{z})\). Thus, the function \begin{align}g(z)=\frac{(z-b)f(z)}{z-a}\end{align} is a holomorphic function on \(\hat{\mathbb{C}}\) with neither zeros nor poles. In particular, its absolute value function \(|f|\) is a continuous function on a compact domain (because spheres are totes closed and bounded) and hence must be bounded. Thus, by Liouville's theorem, the function \(g(z)\) is equal to some non-zero constant \(c\in\mathbb{C}\): \begin{align}f:z\mapsto\frac{cz-ac}{z-b}.\end{align} Finally, \(-bc+ac\neq0\) since \(c\neq0\) and \(a=b\) would contradict the bijectivity of \(f\). Thus, this is totes a Mobius transformation.

Note that using the same arguments, we can show that any holomorphic map between Riemann spheres takes the form of a rational function: \begin{align} \frac{a_0+a_1z+a_2z^2+\ldots+a_nz^n}{b_0+b_1z+b_2z^2+\ldots+b_mz^m}!\end{align}
In fact, I was going to play around with a few polynomials and count branch points and what not, leading us to the Riemann-Hurwitz formula; but it's getting late, and we really ought to give this semester a rest. =)

Monday, 24 November 2014

Analysis for Realsies: 8 (final)

Okay, as promised - my last words. =P

In my previous post, I promised you guys that I'd show you how to differentiate \(\sin(x)\) from first principles and that I'd also prove a cool geometric fact to do with the lunes of Alhazen.

So, you suddenly wake up in the dead of night with cold beads of sweat on your forehead aperch'd, and there is but one solitary thought plaguing your addled-mind: how the heck do you actually differentiate \(\sin(x)\)? Well, when in doubt...write it out in first principles: \begin{align}\frac{\mathrm{d}\sin(x)}{\mathrm{d}x}=&\lim_{h\to0}\frac{\sin(x+h)-\sin(x)}{h}\\=&\lim_{h\to0}\frac{\sin(x)\cos(h)+\cos(x)\sin(h)-\sin(x)}{h}\\=&\lim_{h\to0}\sin(x)\frac{\cos(h)-1}{h}+\cos(x)\frac{\sin(h)}{h}.\end{align} So, we see that we need to calculate these two limits: \begin{align}\lim_{h\to0}\frac{\sin(h)}{h}\text{ and }\lim_{h\to0}\frac{1-\cos(h)}{h}.\end{align} To calculate the former, consider the following picture:
The height of the smaller triangle is \(\sin(x)\). This is shorter than the circular arc, which is of length \(x=\frac{x}{2\pi}\times2\pi\). Moreover, the area of the circular sector is \(\frac{1}{2}x=\frac{x}{2\pi}\times\pi\times1^2\), which is less than the area of the big triangle: \(\frac{1}{2}\tan(x)\). Putting these two inequalities together, we have: \begin{align}\forall x\in(0,\frac{\pi}{2}), \sin(x)\leq x\leq\tan(x).\end{align} Dividing by \(\sin(x)\) and taking the reciprocal, we see that: \begin{align}\cos(x)\leq\frac{\sin(x)}{x}\leq 1.\end{align} Since \(\lim_{h\to0^+}\cos(h)=0\), the sandwich theorem tells us that: \begin{align}\lim_{h\to0^+}\frac{\sin(h)}{h}=1.\end{align}Since \(\frac{\sin(h)}{h}\) is an even function, the limit from the negative side of \(h=0\) must also approach \(1\). Knowing this first limit allows us to compute the second:\begin{align}\lim_{h\to0}\frac{1-\cos(h)}{h}=&\lim_{h\to0}\frac{1-\cos^2(h)}{h(1+\cos(h))}\\=&\lim_{h\to0}\frac{\sin^2(h)}{h(1+\cos(h))}=\frac{1}{2}\times0=0.\end{align} Shoving this into our first principles computation of the derivative of \(\sin(x)\) and we see that \(\frac{\mathrm{d}\sin(x)}{\mathrm{d}x}=\cos(x)\). W00000t! Having assured yourself that you're perfectly capable of differentiating \(\sin(x)\), you drift back to sleep...

Only to be awoken by an infernal desire to prove that the area of the two dark shaded burgundy "lunes" (the crescent shaped moon things) in the following diagram add up to the area of the white triangle in the middle:

Orrite, let's prove this. First note that the white triangle in the middle is a right-angled triangle (this is true of all triangles circumscribed by a circle whose hypotenuse is the diameter), and we denote its side-lengths by \(a\leq b\leq c\), where \(c\) is the diameter of the big circle. Pythagoras' theorem tells us that \begin{align} a^2+b^2=c^2,\end{align} hence, the area of the yellow semicircle (\(\frac{1}{8}\pi c^2\)) is equal to the total area of the two (duo-toned) smaller red semicircles (\(\frac{1}{8}\pi a^2+\frac{1}{8}\pi b^2\)). Now, the area of the yellow semicircle is the same as the area of white triangle and the two lighter red sections, and therefore:

Area of the white triangle+area of the light red bits=area of the dark red bits+area of the light red bits.

Cancelling the light red bits from both sides then yields the desired result. =)

Well, it's been a good semester guys, I hope that you have an awesome Christmas break!

Sunday, 26 October 2014

Analysis for Realsies: 7

Hey guys! W0000, SWOTVAC! It's time to learn every subject that you've done this semester from scratch within a week! Awwww yisssssss!

A week or two ago, you'll have seen a question in your tute B prac sheets asking you if the following sequence converges: \begin{align}\sum_{k=1}^{\infty}\sin(k+k^{-1}).\end{align} And the answer is no, by the divergence test. That is: the sequence \((\sin(k))\) doesn't converge to \(0\), so the series can't actually converge. But, we didn't really show that this sequence doesn't converge to \(0\), so just said that this is true by obviousness. There are probably a fair few ways that you guys can prove this, but let's just use something that you're all totes guns with now: \(\epsilon-N\) proofs!

And let's do this by proof-by-contradiction: assume that \(\lim_{k\to\infty}\sin(k+k^{-1})=0\). This means that for \(\epsilon=\frac{1}{3}\sin(1)>0\), there exists some \(N\in\mathbb{N}\) such that for every \(n>N\), \begin{align}|\sin(n)-0|<\epsilon=\frac{1}{3}\sin(1).\end{align} Consider an arbitrary integer \(k>N\), then \begin{align} |\sin(k+k^{-1})|<\epsilon\text{ and }|\cos(k+k^{-1})|>\sqrt{1-\epsilon^2}=\sqrt{1-\frac{\sin^2(1)}{3}}>\frac{\sqrt{8}}{3}.\end{align} Now, since \(k+1\) is also larger than \(N\), we see that: \begin{align}\epsilon>&|\sin\left(k+1+\frac{1}{k+1}\right)-0|\\=&|\sin\left(k+\frac{1}{k}-\frac{1}{k(k+1)}\right)|\\ =&\left|\sin\left(1-\frac{1}{k(k+1)}\right)\cos(k+k^{-1})+\sin(k+k^{-1})\cos\left(1-\frac{1}{k(k+1)}\right)\right|\\ =&\left|\sin\left(1-\frac{1}{k(k+1)}\right)\cos(k+k^{-1})--\sin(k+k^{-1})\cos\left(1-\frac{1}{k(k+1)}\right)\right|\\ \geq&\left||\sin\left(1-\frac{1}{k(k+1)}\right)\cos(k+k^{-1})|-|\sin(k+k^{-1})\cos\left(1-\frac{1}{k(k+1)}\right)|\right|,\end{align} where this final line is due to (one of the forms of) the triangle inequality. This in turn means that: \begin{align}\epsilon=\frac{\sin(1)}{3}>&\sin\left(1-\frac{1}{k(k+1)}\right)|\cos(k+k^{-1})|-|\sin(k+k^{-1})|\\ >&\frac{\sqrt{8}}{3}\sin\left(1-\frac{1}{k(k+1)}\right)- \frac{\sin(1)}{3}, \end{align} for all \(k>N\). This is false when \(k\) is large enough (because \(\sqrt{8}-1>1\) and \(\lim_{k\to\infty}\sin(1+(k(k+1))^{-1})=\sin(1)\). Soooooooo, we see that the sequence \((\sin(k))\) can't possibly converge to \(0\), and we're done!

Now, if you were in my tute A classes last week, I would have given you the following two variants of the above problem:

Do the following series converge? \begin{align} \sum_{k=1}^{\infty} \sin\left(\pi k+\frac{1}{\pi k}\right)\text{ and }\sum_{k=1}^{\infty}\sin\left(2\pi k+\frac{1}{2\pi k}\right).\end{align}
Answer: yes (for the left series) and no (for the right).

To see that \(\sum \sin(\pi k+\frac{1}{\pi k})\) converges, observe that \begin{align} \sin\left(\pi k+\frac{1}{\pi k}\right)=(-1)^k\sin(\tfrac{1}{\pi k}).\end{align} The desired convergence follows from invoking the alternating series theorem. =)

To see that \(\sum \sin(2\pi k+\frac{1}{\pi k})\) diverges, observe that \begin{align} \sin\left(2\pi k+\frac{1}{2\pi k}\right)=\sin(\tfrac{1}{2\pi k}).\end{align} Intuitively, when \(k\) is epically huge, \(\frac{1}{2\pi k}\) will be tiny. And for \(x\) really close to \(0\), \(\sin(x)\approx x\). Thus, we expect that for large \(k\), \begin{align}\sin(\tfrac{1}{2\pi k})\approx \tfrac{1}{2\pi k}.\end{align} Hence, the whole series behaves roughly like \(\frac{1}{2\pi}\) times the harmonic series...which totally blows up to infinity!

But...how can we formally set this out? Let's do it using the mean value theorem!

So, basically, the MVT tells us that there exists some \(c_k\in(0,\frac{1}{2\pi k})\) such that \begin{align}\cos(c_k)=\frac{\sin(\tfrac{1}{2\pi k})-\sin(0)}{\tfrac{1}{2\pi k} - 0}\text{, and thus:}\\ \sin(\frac{1}{2\pi k})=\frac{1}{2\pi k}\cos(c_k)\geq\frac{1}{2\pi k}\cos(\tfrac{1}{2\pi}). \end{align} This in turn means that: \begin{align}\sum_{k=0}^{\infty}\sin\left(2\pi k+\frac{1}{\pi k}\right)\geq \cos(\tfrac{1}{2\pi})\sum_{k=0}^{\infty}\frac{1}{2\pi k}.\end{align} Since the right series blows up to infinity, our series \(\sum \sin(2\pi k+\frac{1}{\pi k})\) is divergent! (Note that we're really just applying of the comparison test for series)

Okay...so, this blog post has gotten way longer than I had in mind...and I had hoped to show you guys how to differentiate \(\sin(x)\) from first principles and also a nice little geometric fact that Pat showed me in class...maybe...I'll do another blog post at some point...

Monday, 13 October 2014

Analysis for Realsies: 6

One of the challenge fun exercises that I gave you last week's tute B was to exactly compute the integral of \(\frac{1}{1+x^4}\) rather than to rely on comparison techniques to show that this is integrable. How did you guys go with it? I know that I certainly didn't see the first step of this when I tried to do this integral in first year. =P

My hint was the \(1+x^4\) was factorisable into two real polynomials, and one way to see this is to factorise it into four linear terms involving complex numbers and to pair up linear terms until you got pairings which produced real quadratic polynomials. The other way is to complete the square: \begin{align}1+x^4=&1+2x^4+x^4-2x^2\\=&(1+x^2)^2-(\sqrt{2}x)^2\\=&(1-\sqrt{2}x+x^2)(1+\sqrt{2}x+x^2).\end{align} Now, if you're comfortable with partial fractions, you should immediately notice that: \begin{align}\frac{1}{1-\sqrt{2}x+x^2}-\frac{1}{1+\sqrt{2}x+x^2}&=\frac{2\sqrt{2}x}{1+x^4}\text{, and}\\ \frac{1}{1-\sqrt{2}x+x^2}+\frac{1}{1+\sqrt{2}x+x^2}&=\frac{2+2x^2}{1+x^4}.\end{align} Since \(1=\frac{1}{2}(2+2x^2)-\frac{x}{2\sqrt{2}}2\sqrt{2}x\), we see that: \begin{align}\frac{1}{1+x^4}=&\frac{1}{2}\left(\frac{1}{1-\sqrt{2}x+x^2}+\frac{1}{1+\sqrt{2}x+x^2}\right)\\&-\frac{x}{2\sqrt{2}}\left(\frac{1}{1-\sqrt{2}x+x^2}-\frac{1}{1+\sqrt{2}x+x^2}\right)\\=&\frac{\frac{1}{2}-\frac{x}{2\sqrt{2}}}{1-\sqrt{2}x+x^2}+\frac{\frac{1}{2}+\frac{x}{2\sqrt{2}}}{1+\sqrt{2}x+x^2}\\=& \frac{1+\sqrt{2}x}{4(1+\sqrt{2}x+x^2)}+\frac{1-\sqrt{2}x}{4(1+\sqrt{2}x+x^2)}\\&+\frac{1}{4(1+\sqrt{2}x+x^2)}+\frac{1}{4(1-\sqrt{2}x+x^2)}.\end{align} Finally, integrating the two upper-line terms into a logarithm and integrating the two lower-line terms into an inverse tan function, we get: \begin{align} \int \frac{\mathrm{d}x}{1+x^4}=&\frac{1}{4\sqrt{2}}\log|1+\sqrt{2}x+x^2|-\frac{1}{4\sqrt{2}}\log|1-\sqrt{2}x+x^2|\\&+\frac{1}{2\sqrt{2}}\mathrm{arctan}(\sqrt{2}x+1)+\frac{1}{2\sqrt{2}}\mathrm{arctan}(\sqrt{2}x-1).\end{align}Aaaaaaand here's another fun exercise: differentiate \(\sin(x)\) from first principles! And here's a hint (it's written in white, so highlight it):

You'll probably need to show at some point that \(\lim_{x\to 0}\frac{\sin(x)}{x}=1\)...and this can totes be done by proving the following inequality \(\sin(x)<x<\tan(x)\) for \(x\in(0,\frac{\pi}{2})\). And...this can be done...geometrically.

=P

Thursday, 2 October 2014

I Refuse to Name This "Complex Analysis...Made Simple": 4

Hey guys! Having fun with your complex analysis assignment? =P

I've just got a few random comments that I wanted to make, and it's a bit random, but I think that you'll find it useful.

Comment 1: Taylor series/Laurent series expansions are AMAZEBALLS.

Most of the functions that you've encountered up until this point in life are super-super nice functions like \(\sin(x),\cos(x),\exp(x),\log(x),\frac{1}{1+x^n}\) which all have nice Taylor series expansions and what have you. And so when you see this absolutely incredible fact that "complex differentiability of a function in a neighbourhood" implies "(local) Taylor expansions", you mightn't have an appreciation for how "phwoar" this is. In particular, you mightn't have realised that a smooth (infinitely differentiable) real function mightn't have Taylor expansions! In fact, "most" (*) real functions don't have Taylor expansions. The annoying thing is actually writing down one of these smooth real functions. Soo, here's one that I prepared earlier: \begin{align} f:\mathbb{R}\rightarrow\mathbb{R},\, f(x)=\left\{\right. \begin{array}{cc} \exp(\frac{-1}{x^2}) & \text{ if }x>0, \\ 0 & \text{ if }x\leq 0. \end{array}\end{align} Now, I'm going to leave it as an exercise for you guys to check that this function is actually smooth everywhere along the real line (**). 

Now, assume for a second that this function had a Taylor expansion around \(x=0\). Well, the fact that \(f(x)\) is constant on the negative real line tells us that this Taylor expansion must just be \(0\), but then the fact that \(f(x)\) is non-zero on the positive real line contradicts this expansion. So, we see that this function has no Taylor expansion around \(x=0\).

So, at this point you might think that well, that was an okay example, but \(f(x)\) still has Taylor expansions at all the other points in its domain. Then, here's a function that's smooth but doesn't have a Taylor expansion ANYWHERE. (insert spooky music)

And so, you see, the fact that complex differentiability (and unlike the real case, you only need to check the first derivative) implies Taylor series expansions is TOTES AMAZEBALLS.


Comment 2: Question 20 of Practice Sheet 6 vs Question 24 of Practice sheet 8.

If you compare these two questions and the answers that you get for them (SPOILERS: YOU GET THE SAME ANSWER), you see that in fact: \begin{align} \int_0^{2\pi}\frac{\sin(t)}{(2+ \cos(t))^2}\mathrm{d}t=0.\end{align} This is annoyingly obvious in retrospect - you could have totally just solved this real integral explicitly to get \(0\) instead of spending 30~40 minutes labouring over Question 24. But in fact, the fact that this integral is \(0\) can be generalised somewhat to the following fact: \begin{align} \int_0^{2\pi} \sin(t) f(\cos(t))\mathrm{d}t=0.\end{align} Let's prove this: \begin{align} &\int_0^{2\pi} \sin(t) f(\cos(t))\mathrm{d}t\\ =&\int_0^{\pi} \sin(t) f(\cos(t))\mathrm{d}t+\int_\pi^{2\pi} \sin(t) f(\cos(t))\mathrm{d}t\\ =&\int_0^{\pi} \sin(t) f(\cos(t))\mathrm{d}t+\int_{\pi}^{0} \sin(2\pi-\tau) f(\cos(2\pi-\tau))\mathrm{d}(2\pi-\tau),\\ &\text{ with the substitution }\tau=2\pi-t,\\ =&\int_0^{\pi} \sin(t) f(\cos(t))\mathrm{d}t+\int_\pi^{0} \sin(\tau) f(\cos(\tau))\mathrm{d}\tau=0.\end{align} In fact, this really shouldn't be a surprise to anyone who's played around with Fourier series, but it's still a cute fact. =)

Also, here's something-else nice about Question 20 that Andre Ratiu (the other tutor for this subject) pointed out to me: \begin{align} \int_0^{2\pi} \frac{1}{(2+\cos(t))^2}\mathrm{d}t=\int_0^{2\pi} \frac{1}{(2+\sin(t))^2}\mathrm{d}t \end{align} And here're two ways to see this (without doing the actual computation):

Method 1 (real analysis): the function \(\frac{1}{(2+\cos(t))^2}\) is periodic, and \(\frac{1}{(2+\sin(t))^2}\) is just a \(\frac{\pi}{2}\) shift of this. And you should be able to prove that for periodic function \(g(t)\) with period \(p\) that \begin{align}\int_0^p g(t)\mathrm{d}t=\int_b^{p+b} g(t) \mathrm{d}t\text{, for any }b\in\mathbb{R}.\end{align}

Method 2 (complex analysis): transform the two integrals into contour integrals around the unit disk on the complex plane and observe that the functions are rotations of each other by \(\frac{\pi}{2}\). It's the same idea, as the periodicity thingy above, but phrased complex analytically. =)

Orrite, that's...been a fruitful morning of procrastination for me...time to get back to doing...other stuff. =P

*: the space of functions with Taylor expansions around a certain point \(x_0\in\mathbb{R}\) is countably infinite dimensional, whereas the space of smooth real functions is uncountably infinite dimensional.

**: This is obvious everywhere except at \(x=0\). One hint that I could give you is to first show that all of the derivatives of \(\exp(-x^{-2})\) are in the form of \(P(x^{-1})\exp(-x^{-2})\), where \(P\) is a polynomial.

Analysis for Realsies: 5

Hey guys! I hope that you've been having a good semester break. I...had a picnic on campus today? Totes the right weather for picnics, right? =P

I think that a few weeks ago, we had a look at question about Fibonacci numbers in our tute, and the solution sheet doesn't provide an actual solution for it. Soooooooo...here we go!

First, the question:

"You have seen the Fibonacci sequence, defined by \(f_{n+2}=f_{n+1}+f_n\) with \(f_1=f_2=1\). Now define a new sequence as follows: \begin{align}g_n=\frac{f_{n+1}}{f_n}.\end{align} Find the limit of this sequence (you should try to prove that the limit exists first). Do you recognise the limit? Is there something special about it?"

Okay, so I can see at least two ways to do this problem. The usual first-year-accelerated-maths-1 approach would be to use solve for the Fibonacci sequence as a second-order difference equation. Doing this, you get: \begin{align} f_n=\frac{1}{\sqrt{5}}(\phi^n-(-\phi)^{-n}),\text{ where }\phi=\frac{1+\sqrt{5}}{2}\text{ is the golden ratio.} \end{align} And it's pretty straightforward to work out that the limit \begin{align}\lim_{n\rightarrow\infty} g_n=\lim_{n\to\infty}\frac{\phi^{(n+1)}-(-\phi)^{-(n+1)}}{\phi^n-(-\phi)^{-n}}=\phi.\end{align}

Happily, in this course, you guys don't learn about difference equations, so we totes get to do it in a different way! So, first thing's first, let's use the monotone convergence theorem to show that this sequence converges. Observe that \begin{align} g_n=\frac{f_{n+1}}{f_n}=\frac{f_{n-1}+f_n}{f_n}=\frac{1+\left(\frac{f_n}{f_{n-1}}\right)}{\left(\frac{f_n}{f_{n-1}}\right)}=\frac{1+g_{n-1}}{g_{n-1}}.\end{align} Taking this one step further by replacing \(g_{n-1}\) with \(\frac{1+g_{n-2}}{g_{n-2}}\), we obtain that: \begin{align} g_n=\frac{1+2g_{n-2}}{1+g_{n-2}}=1+\frac{g_{n-2}}{1+g_{n-2}}=2-\frac{1}{1+g_{n-2}}.\end{align} Since \(f_n\) is always positive, \(g_n\) (as a fraction of two positive numbers) is always positive. And for positive numbers, \(\frac{1}{1+x}>0\), so the above equation tells us that the sequence \(\{g_n\}\) is bounded between \(1\) and \(2\) (although you do need to check \(g_1\) and \(g_2\) separately, because they don't necessarily satisfy the above recursion). Now, we'd love to apply the monotone convergence theorem, but the actual sequence isn't monotonic. Thankfully, the odd indexed terms are increasing, and the even indexed terms are decreasing, which means that we can still apply the theorem to these odd and even index subsequences.

As an example, let's prove (by induction) that the odd terms are increasing.

Consider the statements \(P(n): g_{2n+1}>g_{2n-1}\). For \(n=1\), this is true \(g_3=\frac{3}{2}>1=g_1\). So, we've checked the "base case" of our induction proof. Let's check the "induction step". Assume that \(P(k)\) is true. This means that: \begin{align}g_{2k+1}&>g_{2k-1}\\ \Rightarrow 1+g_{2k+1}&>1+g_{2k-1}\\ \Rightarrow \frac{1}{1+g_{2k+1}}&<\frac{1}{1+g_{2k-1}}\\ \Rightarrow 2-\frac{1}{1+g_{2k+1}}&>2-\frac{1}{1+g_{2k-1}}\\ \Rightarrow g_{2k+3}&>g_{2k+1}. \end{align} And so we see that \(P(k)\Rightarrow P(k+1)\), and so by the principle of mathematical induction, \(P(n)\) is true for all natural numbers \(n\). That is: the odd indexed terms are increasing.

Similarly, YOU can show that the even terms are decreasing. =)

So, the subsequence \(\{g_{2n-1}\}\) converges to some \(g\). Specifically, \begin{align} g=\lim_{n\to\infty}g_n=\lim_{n\to\infty}2-\frac{1}{1+g_{n-2}}=2-\frac{1}{1+g}.\end{align} Solving for \(g\), we get: \begin{align} g=\frac{1\pm\sqrt{5}}{2}=\frac{1+\sqrt{5}}{2}.\end{align} We take the positive square root as \(g\) needs to be greater than or equal to \(1\). Similarly, the subsequence \(\{g_{2n}\}\) converges to the same \(g\), which of course, is the golden ratio \(\phi\).

Finally, we need to show that the fact that these two subsequences both converge to \(g=\phi\), means that the whole sequence \(g_n\) converges to \(\phi\). And...let's do this the fun way: \(\epsilon-N\). Huzzah! Okay, so, the fact that \(\{g_{2n-1}\}\) converges to \(\phi\) means that: for every \(\epsilon>0\), there exists some \(N_{odd}\in\mathbb{N}\) such that \(\forall n>N_{odd}\), \(|g_{2n-1}-\phi|<\epsilon\). Similarly, the fact that \(\{g_{2n}\}\) converges to \(\phi\) means that: for every \(\epsilon>0\), there exists some \(N_{even}\in\mathbb{N}\) such that \(\forall n>N_{even}\), \(|g_{2n}-\phi|<\epsilon\). Thus, for every \(\epsilon>0\), there exists a natural number \(N=\max\{2N_{odd}-1,2N_{even}\}\) such that \(\forall n>N\), \begin{align} |g_n-\phi|=\left\{\right. \begin{array}{c c} |g_{2n_1-1}-\phi| <\epsilon, & \text{ if the index }n=2n_1-1\text{ is odd, and} \\ |g_{2n_2}-\phi|<\epsilon, & \text{ if the index }n=2n_2\text{ is even.}\end{array}\end{align} This is precisely the \(\epsilon-N\) definition of convergence, and we're done.

HURRAY!

So easy, right? =P

Friday, 12 September 2014

Analysis for Realsies: 4

As promised, here're a few alternative solutions to questions 2 and 3 from your second assignment!

Question 2: Carefully prove that if \(p\) is a prime number, then \(\sqrt{p}\) is irrational.

 We'll prove this by contradiction. Assume that \(p\) is a prime number and that \(\sqrt{p}\) is rational (premise). This means that there are coprime integers \(a\in\mathbb{Z},b\in\mathbb{N}\) such that  \(\sqrt{p}=\frac{a}{b}\). Hence, \(p=\frac{a^2}{b^2}\), which in turn means that \(a^2=pb^2\). By definition, this means that \(p\) is a factor of \(a^2\). At this point, the proof can take one of two directions...

Proof 1 (the direct approach):
Invoking the unique-prime-factorisation theorem (better known as the fundamental theorem of arithmetic), we see that \(a\) and \(b\) may be respectively uniquely expressed as a product of prime factors: \begin{align} a=p_1\times p_2\times\ldots\times p_n\text{ and }b=q_1\times q_2\times\ldots\times q_n\end{align}. Thus, the equation \(a^2=pb^2\) becomes: \begin{align} p_1\times\ldots\times p_m\times p_1\times\ldots\times p_m=p\times q_1\times\ldots\times q_n\times q_1\times\ldots\times q_n.\end{align} Since \(a^2=pb^2\) is an integer - \(\mathbb{Z}\) is, after all, closed under multiplication - the above expressions must both be the unique (up to reordering of factors) prime factorisation of \(a^2\). However, the left-hand-side has \(2n\) terms, whilst the right-hand-side has \(2m+1\) terms\(\Rightarrow\)CONTRADICTION!

Comments: this is a very elegant approach - and to be honest, I've never thought of it before. Probably because I've always just gone to this second method:

Proof 2 (the standard approach):
Similarly invoking the unique-prime-factorisation theorem, we express the equation \(a^2=pb^2\) as: \begin{align} p_1\times\ldots\times p_n\times p_1\times\ldots\times p_n=p\times q_1\times\ldots\times q_m\times q_1\times\ldots\times q_m.\end{align} This means that \(p\) must be equal to one of the \(p_i\). Thus, \(p=p_i\) is a divisor of \(a\), that is: there exists \(k\in\mathbb{Z}\) such that \(a=pk\). This in turn implies that \(p^2k^2=pb^2\), and hence \(pk^2=b^2\). By the same argument as above, this means that \(p\) is also a divisor of \(b\). But this then means that \(a\) and \(b\) both have \(p\) as a factor, thus contradicting the fact that \(a\) and \(b\) are coprime...and we're done.

Comments: this more-or-less follows the approach you guys took for proving that \(\sqrt{2}\) is irrational.

Note that the rough ideas of these proof should work more generally. And you should be able to use this to show that the square roots of "square-free" integers are irrational!

And now, it's time for...

Question 3: Carefully prove that if \(A\) and \(B\) are nonempty [bounded] sets such that for each \(a\in A, \exists b\in B\) with \(a<b\) and for each \(b\in B,\exists a\in A\) with \(a<b\) then \begin{align} \inf A\leq\inf B\text{ and }\sup A\leq \sup B.\end{align} Well, the thing about this question is that it really should have been split into two questions. Instead of showing that: \begin{align} (\forall a\in A, \exists b\in B, a<b)&\wedge (\forall b\in B, \exists a\in A, a<b)\\ \Rightarrow (\inf A\leq \inf B)&\wedge (\sup A\leq \sup B), \end{align} I would have liked you guys to try to prove the following two facts: \begin{align}(\forall a\in A, \exists b\in B, a<b)&\Rightarrow (\sup A\leq \sup B)\text{ and}\\ (\forall b\in B, \exists a\in A, a<b)&\Rightarrow (\inf A\leq \inf B). \end{align} These are really disparate facts, and it might be a bit more illuminating to consider them separately. In fact, I'm just going to prove the first of these two facts - I'll leave it as an exercise for you to repeat the proof and derive the second.

Method 1 (by definition):

This first method utilises one of the defining properties of the supremum of a set - that is is the smallest upper bound. So, if we can show that \(\sup B\) is also an upper bound for the set \(A\), then by definition, the smallest upper bound \(\sup A\) of \(A\) must be less than or equal to \(\sup B\). In order to show that \(\sup B\) is an upper bound of \(A\), consider an arbitrary element \(a\in A\). Unpacking our premise that \begin{align}\forall a\in A, \exists b\in B, a<b \end{align} we see that there is some \(b\in B\) such that \(a<b\). But then, by the definitional fact that the supremum \(\sup B\) of \(B\) must be greater than or equal to anything in \(B\), we conclude that: \begin{align} \text{given an arbitrary }a\in A, \exists b\in B, a<b<\sup B.\end{align} This of course tells us that \(\sup B\) is an upper bound for \(A\), and we're done.

Comment: this is a particular elegant/clean method, and as such might be difficult to see the first few times that you approach questions of this nature. But with more practice, you'll be able to see this no probs!

Method 2 (by another definition):

Our second method is based on the slightly more geometric/intuitionistic characterisation of the supremum \(\sup A\) of a set \(A\) satisfying the properties that:
  1. an upper bound of \(A\), and
  2. for any \(\epsilon>0\), \(\sup A-\epsilon\) is less than some element \(a\in A\).
 Combining this second statement and our premise, we see that for every \(\epsilon>0\), there exists some \(a(\epsilon)\in A\) and some \(b(\epsilon)\in B\) (I put in the \(\epsilon\)s to remind us that these two numbers depend on which \(\epsilon\) we choose) such that \begin{align}\sup A-\epsilon <a<b\leq\sup B.\end{align}. So, we see that \(\forall \epsilon>0, \sup A-\epsilon<\sup B\). Now, at this point, most of us are probably happy to conclude from this (and from taking \(\epsilon\) to be aribitrarily small) that \(\sup A\leq\sup B\). But let's prove this properly by contradiction:

Let's assume that \(\sup A>\sup B\), then choose \(\epsilon=\sup A-\sup B>0\) and we know that \(\sup A-\epsilon<\sup B\), hence: \begin{align}\sup B=\sup A-(\sup A - \sup B)=\sup A-\epsilon>\sup B.\end{align} Which, is a contradiction, because a number cannot be strictly greater than itself. This then gives us the desired conclusion that \(\sup A\leq\sup B\). =)

Now, I also promised to write up solutions to Question 6 from your tutorial because that was kinda tricky (and the official solutions don't have it). And I will...at some point during the week? For now, I just want to really encourage you guys to try those "Do this for homework" exercises - they're pretty involved, but they're questions that you can learn a HUGE deal from.

Huzzah?!??

=)

Thursday, 11 September 2014

I Refuse to Name This "Complex Analysis...Made Simple": 3

Hey guys! Let us begin somewhat worryingly: with an apology.

...in the dark corridoors of my decrepit heart, a solitary ray of light lingers on. It shines upon my macabre soulscape, and whispers forth a faint, but grave exhortation: "...the truth! By God they deserve the truth!..."

That's right - you've been lied to! AND I AM SO SORRY. Specifically, you've been taught that a complex function \(f: U\rightarrow\mathbb{C}\) is a called analytic on \(U\) if it's complex-differentiable at every point on \(U\). BUT THIS IS A LIE! This is in fact the definition for holomorphicity. So, then, what the heck is an analytic function? Well, a function \(f:U\rightarrow\mathbb{C}\) is analytic if it can be locally written expressed as a convergent power series at every point in \(U\). So why the mixed up in nomenclature? To be honest, I have no idea - but I will say this: it turns out that the two criteria are equivalent - a function is holomorphic if and only if it's analytic!

*Phew* glad I got THAT off my chest. =P

There're a few cool consequences of this equivalence between holomorphic and analytic functions. Firstly, power series are infinitely complex-differentiable, so holomorphic functions are infinitely differentiable! This is kinda freaky, coz the definition of holomorphic only requires that \(f\) be complex-differentiable - it doesn't even say that the derivative should be continuous...and yet...we are, basking in its smug infinite differentiability.

Secondly, power series are basically just like beefed up polynomials, right? And we should know from highschool algebra that any two order \(n\) polynomials which agree on \(n+1\) points have to agree everywhere. Well, that observation also beefs up for analytic functions: any two analytic/holomorphic functions which agree on a countable collection of points with an accumulation (limit) point agree everywhere!

We can also use this characterisation to help us get a better feel for some of the results or phenomena that we see in complex analysis. You've seen from your tute questions that it is possible to have a vanishing contour integral of a function \(f\) around some \(\Gamma\) bounding a simply connected domain \(U\) so that \(f\) has a pole inside of \(U\). Take for example the following integral: \begin{align}\oint_{|z|=1}\frac{\mathrm{d}z}{z^2}=\int_0^{2\pi}\frac{i\exp(i\theta)}{\exp(2i\theta)}\mathrm{d}\theta=\int_0^{2\pi}i\exp(-i\theta)\mathrm{d}\theta=0.\end{align} So, is there a nice criterion for when such integrals will vanish? Well, let's assume (to make things easy) that the pole for \(f\) is positioned at \(0\) and that the pole is of order \(n\). This means that \(z^n f(z)\) is holomorphic at \(0\) and hence has a power series expansion at this point: \begin{align} z^nf(z)&=a_0+a_1z+a_2z^2+\ldots+a_{n-1}z^{n-1}+a_nz^n+\ldots\\ f(z)&=a_0z^{-n}+a_1z^{1-n}+a_2z^{2-n}+\ldots+a_{n-1}z^{-1}+a_n+\ldots\end{align} Now, doing a contour integral around the unit circle \(|z|=1\), we expect everything to vanish except possibly \(\oint_{|z|=1}a_{n-1}z^{-1}\mathrm{d}z\). This term contributes \(2\pi i a_{n-1}\) to the integral, and so a contour integral around a pole of a function vanishes precisely when the "power-series" has no \(z^{-1}\) term. In fact, the coefficient of the \(z^{-1}\) term is so important that we've given it a name: it's called the residue.

Soooooooooo...complex analysis...so simple, right? =)

Monday, 1 September 2014

Analysis for Realsies: 3

I love Community. You love Community. Who doesn't love Community?

Now, if you love Community (premise), then you love Magnitude (inference). And if love Magnitude, then surely you love POP! POP! quizzes (conclusion/pun-ch line), right?

Question 1 (it's the only question): which of these four numbers do we know for certain is irrational?
A) \(\pi+e\).
B) \(e\pi\).
C) \(e^\pi\).
D) All of the above.

Strangely enough, the answer is C: we have no idea if \(\pi+e\) or \( e\pi\) are actually irrational (even though we strongly suspect that they are). Having said that, we do know that at least one of those two numbers is irrational. Assume not, then there exist integers \(p,q\in\mathbb{N}\) such that \(\pi+e=\frac{p}{q}\) and \(m,n\in\mathbb{N}\) such that \(e\pi=\frac{m}{n}\). Then, \begin{align}\frac{p}{q}\pi=\pi^2+e\pi=\pi^2+\frac{m}{n}\Rightarrow 0=\pi^2-\frac{p}{q}\pi+\frac{m}{n}.\end{align} Which is a contradiction, because \(\pi\) is transcendental and (hence) cannot be the solution to some quadratic equation with rational coefficients.

To show that \(e^\pi\) is irrational, we invoke the Gelfond-Schneider theorem. Which says that if \(a,b\) are algebraic numbers with \(a\neq0,1\) and \(b\) irrational, then \(a^b\) is transcendental (and hence necessarily irrational). The fact that \(e^\pi\) is irrational then follows from using the (kinda awesome) fact that \(e^\pi=(-1)^{-\sqrt{-1}}\).

I HAVE NO IDEA HOW THE GELFOND-SCHNEIDER THEOREM WORKS.

Number theory, she is a...how you say...a...bi-........................................-iiiutiful. =)

Wednesday, 20 August 2014

I Refuse to Name This "Complex Analysis...Made Simple": 2

Complex differentiability, what's up with that, ammirite?

So, it turns out that if a complex function \(f: U\rightarrow \mathbb{C}\) is complex differentiable for an open plane region \(U\subset\mathbb{C}\), then \(f\) can be written as a power series around each point in \(U\). What is UP with that, ammirite??

Plus, once a function is complex differentiable ONCE, it's complex differentiable INFINITELY MANY TIMES. WHAT IS UP WITH THAT, AMMIRITE???

Wow...tough crowd, *awkward turtle time*. =P

Now, in order to show that a function is complex differentiable, you just need to write down its derivative (via first principles) and show that the limit exists. And here's where the complex case really differentiates itself from the real case. *insert smug smile for that pun*

Well, for one thing, we know that differentiability implies continuity. So, let's backtrack for a second and look at the continuity of a function. In the real case, to check continuity of a function \(g:\mathbb{R}\rightarrow\mathbb{R}\) at a point \(x_0\in\mathbb{R}\), we just need to check that the limit of \(g\) as we approach \(x_0\) from the left hand side of \(x_0\) agrees with what we get as we approach from the right hand side of \(x_0\). For complex functions from a planar domain, it's trickier. We've obviously got to check that the limit agrees in every which way, and there are uncountably infinitely many directions in which you can approach some point \(z_0=x_0+iy_0\in U=\mathrm{Dom}(f)\). And in fact, it's not even enough to just check the "linear directions"...as can be seen from the following example: \begin{align}f(x+yi)=\frac{x^2y}{x^4+y^2}.\end{align} Taking the limit as we approach \(0\) from any linear direction \(\alpha\in\mathbb{C}-\{0\}\), we get \(0\). Concretely written out: \begin{align}\lim_{t\to 0^+} f(t\alpha)=0.\end{align} However, taking the limit along a non-linear curve, we see that \begin{align}\lim_{t\to 0^+} f(t+t^2i)=\frac{1}{2}.\end{align} Thus, we see that this particular function \(f\) is not continuous at \(0\).

In order to check continuity in general, we really have to check every direction. This is done by going through an \(\epsilon-\delta\) convergence proof.

Um...ookay, maybe I'll talk more about complex differentiability next time. Or possibly when you guys start to look at them sweet sweet power series results!

Monday, 18 August 2014

Analysis for Realsies: 2

Hey guys! This post is based on a little variant of question 5c. on last week's Tute A sheet. In particular, you were told that a three-digit number is divisible by \(3\) if and only if the sum of its digits add up to a multiple of \(3\). If you were in my tute, I should have pointed out to you that your proof works also for divisibility by \(9\), and that this fact is true for any integer - not just three-digit ones. Now, instead of playing around with divisibility by 3, we're going to have a play around with divisibility by 11. =P

I think that it's a little odd that (ever since your first kindergarten lesson on factorising quadratics) we're so adept at factorising algebraic objects like: \begin{align} x^2-y^2=(x-y)(x+y), \end{align} and yet most of us never think to use the above completing-the-square formula on actual numbers...to simplify computations. For example: \begin{align} 6.79^2-3.21^2=(6.79-3.21)(6.79+3.21)=3.58\times 10=35.8 \end{align}

And along the same vein of thought, some of you know that if you expand \((x+y)^n\), you get something of the form: \begin{align} x^n+nx^{n-1}y+{n\choose 2}x^{n-2}y+\ldots+y^n.\end{align} But maybe you've never thought to apply it to actual numbers to get something like: \begin{align} 10^k=(11-1)^k=11^k+k\cdot11^{k-1}\cdot(-1)+{k\choose2}\cdot11^{k-2}\cdot(-1)^2+\ldots+(-1)^k.\end{align} So, one consequence of this is that any power \(10^k\) of \(10\) can be written as \begin{align}11\times\text{something}+(-1)^\text{k}.\end{align}
So, now let's take a \(n\)-digit number like \(\overline{a_na_{n-1}\ldots a_1}\), then we know that this number can be written as the following sum:\begin{align}a_n10^n+a_{n-1}10^{n-1}+\ldots+a_1.\end{align} Now, invoking our earlier observation about powers of \(10\), this sum can be written as: \begin{align} 11\times\text{some big nasty sum of integers}+a_n(-1)^n+a_{n-1}(-1)^{n-1}+\ldots+a_1(-1)^0.\end{align} Since \begin{align} a_n(-1)^n+a_{n-1}(-1)^{n-1}+\ldots+a_1(-1)^0 \end{align} is just \begin{align} a_0-a_1+a_2-a_3+\ldots+(-1)^na_n,\end{align} so to figure out if a number is divisible by \(11\), you can just take its last digit, minus the second last, add the third last, minus the fourth last...etc., and if the number that you wind up with is divisible by \(11\), then the entire thing is.

Let's try this out on an actual number! Let's take \(80586\). Well, \(6-8+5-0+8=11\) is totes divisible by \(11\). Sooo, \(80586\) should also be divisible. And it totes is: \(80586=11\times 7326.\)

The algebra in the previous paragraph might have been a tad on the messy side, but I think that you should all be fine with it! =)

Wednesday, 13 August 2014

Analysis for Realsies: 1

If you were in one of my B-tutorials last week, you might recall this little "wrong" proof:

Claim: Every natural number can be unambiguously described in fourteen words or fewer.

Proof: (let's break this up into steps) We're going to attempt a proof by contradiction.
1) Assume that there exists a natural number \(n\in\mathbb{N}\) that cannot be unambiguously described in fourteen words or fewer.
2) Then (by the well-ordering principle), there is a smallest number \(n_0\in\mathbb{N}\) that cannot be unambiguously described in fourteen words or fewer.
3) Then, \(n_0\) is "the smallest natural number that cannot be unambiguously described in fourteen words or fewer".
4) But this is an unambiguous description of \(n_0\), thus contradicting our initial claim that there exists a natural number that cannot be unambiguously described in fourteen words or fewer.

...Q.E.D.???

Now, there's something that feels pretty darn wrong about this "result" - after all, if I write down an epically epically HUGE number, I shouldn't expect to be able to unambiguously express it in fewer than fifteen words. I mean, this English language is finite, and the number of sentences that you can build with fourteen words is finite, but the number of natural numbers is infinite. So, the claim is totes wrong.

But where does it go wrong?

And the answer is kinda subtle...the problem at the heart of this proof is the following description:

(*): "the smallest natural number that cannot be unambiguously described in fourteen words or fewer",

whilst it certainly intuitively makes sense to us as a description, it is self-referential, and you've already seen from class what can happen if you allow for self-referential statements: Russell's Paradox! In particular, in our case, assigning this description to a number contradicts the very description: it's totes logically inconsistent.

So, we see that in step 4), we can't actually conclude that we've contradicted our initial assumption; all we've done is shown that (*) is a sucky sucky description.

Logic, fo'shizzle and stuff.

=)

Monday, 11 August 2014

I Refuse to Name This "Complex Analysis...Made Simple": 1

It's been AGES since I've blogged anything *flails limbs about, cracks knuckles*, let's start off with something nice and easy. Let's do some complex analysis! Caveat: this post is actually just recap of something that I said during the Tuesday tute (*) and something that I said to a few students who asked me about some big-picturification stuff after the Thursday tute.

So, if you're in either of my MAST30021 tutorials, you might recall question 1)c) from last week's tute:

"Find all solutions of \(e^z=-1\) with \(z\in\mathbb{C}\). How many solutions are there? Is the expected solution \(z=\log(-1)\) single-valued? How can we make the logarithm function single-valued?"

Now, you all saw that \(z=(2k+1)\pi i, k\in\mathbb{Z}\) is the solutions to \(z=\log(-1)\). And so, \(\log:\mathbb{C}-\{0\}\rightarrow\mathbb{C}\) is totes a multi-valued function. Now, we tend to like our functions single-valued, so how do we fix this? Well, we see that the problem is with the fact that \(e^{2\pi i}=1\), so when trying to solve for logarithms \(w=\log(z)\), given a solution \(w_0\), we can always just add or subtract \(2\pi i\) and get a new answer (and lather and repeat). The most straight-forward way to fix this is to force our logarithms to only spit out principal arguments. Let's motivate our eventual answer a little. We know that the usual real logarithm has the following algebraic property: \(\log(ab)=log(a)+log(b)\). Hence, by putting an arbitrary non-zero complex number \(z\) in polar form \(re^{i\theta}\), we expect that: \begin{align}\log(z)=\log(re^{i\theta})=\log(r)+\log(e^{i\theta})=\log(|z|)+arg(z).\end{align} And taking the principal argument, we define a function \begin{align}Log:\mathbb{C}-\{0\}&\rightarrow\{x+yi\in\mathbb{C}\mid y\in(-\pi,\pi]\}\subset\mathbb{C}\\ z&\mapsto \log|z|+Arg(z).\end{align}
Here's an attempt at illustrating what happens with this map:

I hope that the colours help you visualise what's happening in this map. Roughly, we're "cutting" \(\mathbb{C}-\{0\}\) along the negative real axis, and then stretching it out so that the region close to \(0\) stretches out and the region close to \(\infty\) pull in to form a horizontal strip.

Now, this is a perfectly reasonable fix to make a multi-valued function \(\log\) into a single-valued function. But it isn't...perfect, for the simple reason that this map isn't continuous along the negative real axis (this is an exercise, try it!). To restore continuity (in this course), we can remove the negative real axis from the domain - this is the branch cut stuff that you've seen in your slides.

Of course, there's something dissatisfying about this "fix" - it's not canonical. What I mean is that this fix isn't unique. See, instead of defining our principal arguments as \((-\pi,\pi]\), if we had taken \((0,2\pi]\) as our principal arguments, then our \(Arg\) and \(Log\) functions would be slightly different, and the branch cut that we needed to take (to get continuity of \(Log\)) would need to be the positive real line instead. Maybe you should try to take the principal arguments as \((\epsilon,2\pi+\epsilon]\) and see what branch cut you'd have to take?

So, there's totes a canonical fix for this. And the idea is to take that horizontal strip constituting the image of \(Log\) and to glue the top to the bottom. This makes for an infinitely long cylindrical pipe, which...doesn't quite fit on the complex plane, but at least makes \(Log\) a nice and continuous map without needing to take any branch cuts and stuff. This infinitely long cylinder is an example of what (some) mathematicians call Riemann surfaces, and they are at the heart of modern complex analysis.

Sooo...complex analysis, so simple right?  =P

*: Coz I sorta glossed over it, and I hope that this is expositionally clearer.

Sunday, 16 June 2013

Maths on Steroids: final?

Sorry guys: I tried, but I just couldn't think of a non-trite-sounding first sentence to this post, so I wrote a con-trite-sounding one instead. Okay, maybe I'm not that contrite...in fact, I'm pretty happy with how that sentence turned out. =P

There is perhaps, in the West, a slight cultural inclination towards the belief that teachers are somehow less. After all, it's often said that those who can, do. And those who can't, teach.

I can't be bothered refuting this claim, someone-else has already done it for me. But it does strike me as odd that even in a major segment of the teaching profession: tertiary education, this view is espoused. I took us about two hundred years after the adoption of the printing press in the West for scientific journals to happen (compare with erotic novels, which pretty much happened overnight).

There is no denying that this gadget has been instrumental (*) in the spreading of scientific ideas among academics. But one of the side-effects of the scientific journal has been a shift in the focus of academia. Traditionally, a professor's primary role is to profess that they know nothing about their field of expertise and then hammer you with all the details of how poorly they understand their material over the next few months. But some where along the line, academia started to focus less on teaching and more on the number of and quality of one's publications.

While I agree that there's probably a strong correlation between the two, I feel that it's tragic that some how research is touted as the primary objective of academia, and the noble act of teaching is...disdained.

...hmm...

I dunno, that was a bit of a random start to things. And...and I guess that I have been thinking a bit about teaching. Both of my parents were teachers in China, and they have a very pragmatic approach to teaching: make sure that the kids get good marks on their exams. On the other hand, I can't really name anyone at uni who would explicitly claim that this is the right way to do this; there is a hope that we can steer students far from the perils of an "exam-oriented" approach to study. And I feel... I feel like this is a reflection of an overly simplistic and naive view of human motivation. But...yea, I should go to sleep soon. I'mma fly off to China in a few hours and this is probably just some sort of procrastination.

Orritey! It's tiiime fooooor...

General Exam tips:
  1. Get full marks.
  2. Aim to get 120/100. When you fail to achieve your goals, you'll still have full marks.
  3. Keep your hands warm. My personal preference is to bring a trashcan full of charcoal - this way, you can roast chestnuts while you get full marks! Failing that, I guess you could go buy one of those Japanese hand-warmer packs from Daiso?
  4. Do the questions in order. I know that one of the standard pieces of advice that we're supposed to tell peeps is that you DON'T NEED TO do the questions in order. But, it's much harder for BOTH you and your exam marker to miss one of the questions this way. I think that the only reason that we're supposed to tell you that you don't need to do stuff in order is because sometimes people get stuck on one question and waste waaaaay too much time on it. So...
  5. Don't waste waaaay too much time on one question. 
  6. Do not leave an exam 2 hours early because you finished it and you and your friends "agreed" beforehand that you were all going to finish waay early and go out and party and stuff and then they end up not leaving 2 hours early and you get sunburnt/frostbite standing outside the exam hall and you realise much later that you forgot to do one of the questions because it was hella annoying and you were gonna leave it till the end sad face.
  7. Write in English where necessary.
And hints to the questions that I gave you guys in the last post:
  1. Duh. It's all Greek to me.
  2. Just do some computations with monomials.
  3. *Cough* the eigenvectors should be all the monomials...just make sure that you do some sample computations and define the right generalisation of \(T\).
  4. I think that it's probably important to have two variables? Maybe???
  5. The trick is to group things into sequences of two (non-overlapping) days.
  6. *Cough* ...just...*cough*.
  7. Diagonalise it!

Orrite. Own those exams guys! Own them like you paid fees to attend uni. =P

*: you can't really deny it because gadgets are pretty much instruments, right?

Thursday, 30 May 2013

Maths on Steroids: 10 + 11

"This cosmic dance of bursting decadence and withheld permissions twists all our arms collectively, but if sweetness can win, and it can, then I'll still be here tomorrow to high-five you yesterday, my friend. Peace."

-Royal Tart Toter (Adventure Time).

Hey guys...and so it came to pass that the semester drew to an end, but not so your edification. I hope that you all had a fun semester doing some maths. I know that I had fun tutoring you guys. And I guess that I just wanna point out and remind you that ultimately, you kinda learnt everything by yourselves. All I did was facilitate some discussion and thoughts every so often, and this is meant to be one of the take-home messages of university education: there won't always be teachers, and you guys can and will have to teach yourselves. Which is good, because it turns out that most of the time you're better at teaching yourselves than we (teachers) are.

Having said that, during this week's tute, I got a request for some harder eigen-stuff questions. I couldn't really find any hard ones of the net, so I just made some up. I'll only provide the answer for the first one (for now). If you wanna know if you got something right, ask one of your friends to try the problem independently and see if your answers match up? Oh, and I should warn you that I haven't ordered the questions in order of difficulty =P

  1. What do you call an eigen-sheep? (Ans: a lamb, duh).
  2. Consider the (infinite dimensional) vector space \(\mathcal{P}\) of real polynomials in \(x\). Show that the following function is a linear transformation, and find its eigenvalues and eigenvectors: \begin{align}T:\mathcal{P}&\rightarrow\mathcal{P}\\ p(x)&\mapsto x\cdot\frac{\mathrm{d}p}{\mathrm{d}x}.\end{align}
  3. Generalise the above setup/result/calculations to vector spaces of real polynomials in more than two variable.
  4. Once you've figured out the right generalisation in 3 to the linear transformation \(T\) defined in question 2, notice that it works on smooth functions in general. So then try to find non-polynomial eigenvectors in the vector space of smooth functions with eigenvalue \(2\).
  5. The weather in the Ice Kingdom in the land of Ooo sucks hard. If it snows today, then the probability that it will snow tomorrow is \(\frac{3}{4}\). And if it doesn't snow today, then the chance that it will snow tomorrow is \(\frac{1}{5}\). Given that there is no climate change in the Ice Kingdom, in the long term, for what proportion of the days in the Ice Kingdom will it snow?
  6. Most of the time we've dealt with matrices that can be diagonalised. Can you find a \(2\times 2\) matrice that can't be diagonalised? And how might you generalise to a \(k\times k\) matrix?
  7. Consider the following matrix of transformation on \(\mathbb{R}^3\): \begin{align}A=\left[\begin{array}{ccc}0 & -\frac{\sqrt{3}}{4} & -\frac{1}{4} \\ \frac{1}{\sqrt{3}} & \frac{1}{2} & -\frac{\sqrt{3}}{2} \\ \frac{1}{3} & -\frac{\sqrt{3}}{2} & \frac{3}{2} \end{array}\right],\end{align} and also consider the following set in \(\mathbb{R}^3\): \begin{align}S=\left\{\left[\begin{array}{c} u \\ \frac{v\sqrt{3}}{2}-\frac{1}{2} \\ \frac{v}{2}+\frac{\sqrt{3}}{2} \end{array}\right]: 0\leq u, v, \leq 1\right\}.\end{align} First show that \(S\) is a unit square, then figure out what \(A\cdot S\) and \(A^2\cdot S\) and so forth look like. In particular, calculate the area of \(A^n\cdot S\), hence find the total area of all the \(A^n\cdot S\)s as you vary \(n\) over all the non-negative integers and figure out what the union of all of these shapes geometrically looks like (*).
Methinks that's enough for now. Plus, if you can do those, you really should be set for any eigenvalue stuff you're likely to see in first year maths. =)

*: you might need to be slightly more subtle in your approach to eigenvectors and eigenvalues for this problem. It can be tricksy...

Wednesday, 22 May 2013

Maths on Steroids: 9

Hey guys! To begin with, distractions: MUMS AGM this week - free pizza + run for a position as a first year rep? Also, there's a MUMS Trivia night next week - I stress: no maths required, despite this being for a maths society.

Orrite, let's just get down to business - these are some answers (not solutions, just answers) to last week's (tute 9) lab sheets:

2 A Linear Transformation in \(\mathcal{P}_3\)
1)a)\begin{align}T(1)=&12\cdot1\\ T(x)=&10\cdot x\\ T(x^2)=&2\cdot 1+6\cdot x^2 \\ T(x^3)=&6\cdot x^2.\end{align}
1)b)\begin{align}\left[\begin{array}{c}12 \\ 0 \\ 0 \\ 0 \end{array}\right],\left[\begin{array}{c}0 \\ 10 \\ 0 \\ 0 \end{array}\right],\left[\begin{array}{c} 2 \\ 0 \\ 6 \\ 0 \end{array}\right],\left[\begin{array}{c}0 \\ 6 \\ 0 \\ 0 \end{array}\right]. \end{align}
1)c)\begin{align}\left[\begin{array}{cccc}12 & 0 & 2 & 0 \\ 0 & 10 & 0 & 0 \\ 0 & 0 & 6 & 0 \\ 0 & 0 & 0 & 0 \end{array}\right].\end{align}
2)
A basis for the kernel of \(T\) is given by: \(\{3x-5x^3\}\).

A basis for the image of \(T\) is given by: \(\{1,x,x^2\}\).

3)a)
Everything in the kernel.

3)b)
No, there is no solution to blah blah blah\(=x^3\).

Yes, anything of the form \(\frac{5}{6}+\alpha(3x-5x^3)\) will be a solution to blah blah blah\(=10\).

Note: it is crucial that the answer is given in polynomial form, since the column vectors are merely representatives of these polynomials and hence not appropriate answers to 1)a), 3)a) and 3)b).

3 Change of Basis
4)a)
I...personally think that this is a slightly silly question. I suppose that an answer might be something like: "Coordinate changes are linear transformations, and transition matrices are their corresponding matrix of transformations.".

4)b)\begin{align}P_{B\rightarrow S}=\left[\begin{array}{cccc}1 & 1 & 0 & 0 \\ 1 & -1 & 0 & 0 \\ 0 & 0 & 1 & 1 \\ 0 & 0 & 1 & -1 \end{array}\right],\,P_{S\rightarrow B}=\frac{1}{2}\left[\begin{array}{cccc}1 & 1 & 0 & 0 \\ 1 & -1 & 0 & 0 \\ 0 & 0 & 1 & 1 \\ 0 & 0 & 1 & -1 \end{array}\right].\end{align} 4)c)\begin{align}P_{C\rightarrow B}=\left[\begin{array}{cccc}\frac{1}{2} & 1 & \frac{1}{2} & 0 \\ \frac{1}{2} & 0 & \frac{-1}{2} & 0 \\ 0 & 0 & \frac{1}{2} & 1 \\ 0 & 0 & \frac{1}{2} & 0\end{array}\right].\end{align}
4)d)\begin{align}[3+x-10x^2+x^3]_S=\left[\begin{array}{c} 3 \\ 1 \\ -10 \\ 1 \end{array}\right],\,[3+x-10x^2+x^3]_B=\left[\begin{array}{c} 2 \\ 1 \\ \frac{-9}{2} \\ \frac{-11}{2} \end{array}\right].\end{align}

4 Linear Transformations and Eigenthings
5)a)\begin{align}A=\left[\begin{array}{cc}5 & -3 \\ 6 & -4 \end{array}\right].\end{align}
5)b)\begin{align}T(2,2)=(4,4),\, T(1,2)=(-1,-2).\end{align}
5)c)\begin{align}T(2,0)&=T((4,4)+(-2,-4))=T(2(2,2)-2(1,2)) \\ &=2T(2,2)-2T(1,2)=(8,8)+(2,4)=(10,12).\end{align}
5)d)
Ewww...so gross. There's no way I'mma answer this one at all. I mean, you might need to do three pictures just to show what's going on...bleh.

5)e)
The (*) eigenvectors of \(A\) are \(\{\left[\begin{array}{c}2 \\ 2\end{array}\right],\,\left[\begin{array}{c}1 \\ 2\end{array}\right]\}\) with respective eigenvalues \(\lambda=2,-1\).

5)f)\begin{align}P_{B\rightarrow S}=\left[\begin{array}{cc} 2 & 1 \\ 2 & 2 \end{array}\right] \Rightarrow P_{S\rightarrow B}=\frac{1}{2}\left[\begin{array}{cc} 2 & -1 \\ -2 & 2 \end{array}\right].\end{align}
5)g)\begin{align}[T]_B=P_{S\rightarrow B}[T]_S P_{B\rightarrow S}=\left[\begin{array}{cc} 2 & 0 \\ 0 & -1 \end{array}\right]. \end{align}
5)h)
I've noticed that my answer to (g) is a diagonal matrix whose diagonal values correspond to the eigenvalues I obtained in part (e) (**).

5)i) The basis \(B\) tells me that the linear transformation \(T\) acts on a vector in \(\mathbb{R}^2\) by doubling the \((2,2)\) "component" of this vector and flipping the \((1,2)\) "component" of this same vector. I use the term "component" somewhat loosely here - I just mean that any vector in \(\mathbb{R}^2\) may be written uniquely as a linear combination of \((2,2)\) and \((1,2)\), and not something to do with vector-resolutes.

Note: just as with the polynomials, it's important to put in row vectors instead of column vectors in 5)b) and 5)c) - but not 5)e) as it asks for eigenvectors to \(A\), not \(T\).

Additional note: these eigenstuff calculations are generally pretty start forward, although a lot of people will screw up part (g) just because they have the matrices in the wrong order. I personally avoid memorising what you have to put down, and just think through the matrix multiplications - making sure that I remember that when you apply a matrix to a column vector, you start from the RIGHT HAND SIDE!

*: This doesn't mean that the eigenvectors of \(A\) are unique, we're simply writing down representatives (up to linear combinations of eigenvectors with the same eigenvalue).
**: In particular, the position of these diagonal values line up with which eigenvector I've set as the columns of the matrix \(P_{B\rightarrow S}\) I formed in part (f).