Showing posts with label Mathematics. Show all posts
Showing posts with label Mathematics. Show all posts

Saturday, August 15, 2009

I Take Back All The Freakouts

Yea ok, I take back all my worries about the calculus final. It was trivial.

There is one problem I'm worried about - somehow I managed to show that the flux of the Coulombic vector field (r/r^3, where r = ||r||) over a unit sphere is always 4pi if the sphere is centered on the x-axis (not just the origin). Intuitively, this doesn't make sense, but we'll see what happens when marks come out. Other than that, stupid final.

As an example, here's a toy problem for you: prove the generalized integration by parts formula

\iiint_D f(\nabla\cdot\mathbf{G}) dV = \iint_C (f\mathbf{G}) \cdot \hat{n} dS - \iiint_D \mathbf{G} \cdot \nabla f \, dV
where the boundary of D (open in R^3) is C (a single, orientable closed surface), n-hat points outward, and we have the usual "nice" conditions (i.e. f, G are C1 over D and C; f is a scalar field and G is a vector field).

(If you want I can give you the slightly harder problem that follows this one, but that one's actually pretty easy too, just longer.)

Of course, an easy final is a wonderful thing, given that I ran more calculations instead of studied for the 6 hours before the final. Naturally, my calculations decide to fly in the face of known facts. I will need to consult my supervisor and The PI on Monday. Again. Sigh.

There's the work report too. I really don't know what to say - the data will be (kind of) all there soon, but conclusion? what conclusion? ("More work needs to be done...")

On an unrelated note - shoutout to roommates who are leaving: aww, y'all are leaving...thanks for being awesome all term!


Continue...

Tuesday, July 14, 2009

Tidbit on Uniform Convergence

Something from first-year calculus: if a sequence of continuous functions fn converges uniformly to limit function f (on interval I), then f is also continuous (over the same interval).

My Calculus 4* professor said that it's too hard to prove. I call bullshit. Here's the proof, courtesy of Calculus 2.

(As usual, fingers are crossed for the LaTeX to show up properly. I'm too spoiled by LyX to learn LaTeX seriously.)

First, a refresher. The sup-norm of a function f defined on a (real) interval I (mapping to the set of reals) is

 ||f ||_\infty = \displaystyle{\sup_{x\in I}}|f(x)|
Note that the supremum is precisely the maximum of the function if the maximum exists (on the interval); in particular, if interval is closed and the function is continuous, by the Extreme Value Theorem
||f||_\infty = \displaystyle{\max_{x\in I}}|f(x)|
Also, the norm depends on the interval.

I'm going to leave it as an exercise for the reader to show that this is indeed a norm.

Given a norm**, we can talk about sequences. That is, {fn} converges uniformly to f on interval I if, for all &epsilon > 0, there exists a K > 0 such that, for all n >= K,
||f_n - f||_\infty < \varepsilon
Now we can prove the proposition.
Take p in I, &epsilon > 0. We seek a &delta > 0 such that |f(x) - f(p)| < &epsilon when |x - p| < &delta .

Since fn converges to f uniformly on I, pick some n such that
||f_n - f||_\infty < \displaystyle{\frac{\varepsilon}{3}}
For any x in I, by the triangle inequality we get

|f(x)-f(p)| \le |f(x)-f_{n}(x)|+|f_{n}(x)-f_{n}(p)|+|f_{n}(p)-f(p)|\\
\le ||f_{n}-f||+|f_{n}(x)-f_{n}(p)|+||f_{n}-f||\\
< \displaystyle{\frac{\varepsilon}{3}+|f_{n}(x)-f_{n}(p)|+\frac{\varepsilon}{3}}
Since fn is continuous for all n, there exists &delta > 0 such that
|f_{n}(x)-f_{n}(p)|<{\displaystyle \frac{\varepsilon}{3}}
when |x - p| < &delta. So

|f(x)-f(p)| < \frac{2\varepsilon}{3}+\frac{\varepsilon}{3}=\varepsilon
when |x - p| < &delta.

As they say, QED.

[Edited to note]
My eqnarray won't work; extra dollar signs don't work too well either. Hence uglier formatting than usual. Oddly enough, neither \Vert or \| works but || gives the desired double-bars. Sigh.

*One of the reasons I really don't like this course is its lack of rigour. In particular, it has been mangling uniform convergence for the last few days. Seriously, convergence without epsilon-delta is but a toy - it loses alot of its power.
**To be pedantic, obviously a metric doesn't have to be a norm, but having a norm is certainly sufficient for us to define sequences and their convergence.


Continue...

Sunday, June 28, 2009

Random Question During Cookie-Baking

Is it interesting to study the topology of fractal objects like the Sierpinski carpet? Given that they tend to be "mostly holes" rather than a nice* "surface" per se.

I actually don't know any topology, unfortunately, so my question might be a really dumb one. Oh well.

Anyway, I thought about this because I was making Sierpinski cookies (3 iterations, where a plain square is the 0th iteration) and they turned out kind of deformed. Ok, really deformed. However, I can probably say that the cookies (before I bake them) can be continuously un-deformed into the (3rd iteration) Sierpinski carpet. Idly wondering whether I'd actually be correct in saying that led to the actual question posed at the beginning of this post.

*"Nice" means alot of things in my lexicon. I usually use it with functions, where it means definitely at least continuous, probably C1 (or even smooth, maybe analytic, though I don't use these conditions much yet), possibly with nonzero derivative everywhere if the function's C1. For a surface I'll parametrize it (if possible) then apply my definition of "nice" for functions (if there exists more than one parametrization I guess I'll pick the "canonical" one if it exists, or just "the nicest one I know for my current purposes" if there's no obvious choice). For a subset in a metric space I guess I want it to be compact and connected (it's been awhile since real analysis).


Continue...

Sunday, May 10, 2009

Mathie Crisis

I forgot all my math. Help!

The unfortunate side effect of taking lots of chemistry courses and working in chemistry is that I start to forget math. Not calculus/linear algebra 1, but general problem solving, proofs, and the like. I can appreciate existing proofs, but it's as though I can't think them up any more!

I'm staring helplessly at my first (i.e. should be easy) assignment. If you give this to me in one year ago, I can probably solve the problems without looking at any notes whatsoever (as can everyone else in my class). Now, my mind is blank - I don't know what to do!

Help! What to do, what to do?

I don't think this is an age thing - it's more of a cultural problem. Maintaining mathie skills require doing math, thinking math, hanging out with fellow mathies, constantly. I've been most remiss in this regard, but *now* what can I do?

Paradoxically, I also don't know what things from previous courses can I assume in my assignments! (My previous courses are heavily proof-based. Most other students in my current classes would've taken the *cough less rigorous cough* "normal" or "engineering/physics" versions, and they cover things very differently.)

By the way, dropping my math major is not an option. It's not just being stubborn - there are lots of math courses I want to take and I can't do that with just a chemistry major.


Continue...

Saturday, March 14, 2009

Day of Pi

Almost forgot to post about this - Happy Pi Day!

Alas, I have no pie, so I can't celebrate this festive occasion properly. Maybe I'll get pie tomorrow and celebrate this belatedly. Or not, as the case may be, depending on whether there's good pie around...

(Pi, of course, is always good - it's a constant!)


Continue...

Saturday, February 14, 2009

Pólya-Burnside Enumeration, Part 2

So, previously I have set up all the mathematical machinery needed to do the actual counting. So here's an example. It's not the most interesting example, but it has the advantage of being relatively short.

Let's say we want to count how many linear molecules are there of length n, given t choices for atoms (these choices must be dictated by chemistry, because mathematicians don't care). Different kinds of bonds aren't distinguished; what matters are the atoms themselves. For simplicity, let's just do this in two dimensions*.

In two dimensions, there are only two operations on a linear molecule that can possibly leave the molecule invariant: "do nothing", and rotation by π radians. So the group of interest is has two elements: G = {e, g}.

Let the set of elements we are interested in be all strings of t elements, of length n, regardless of whether they are invariant under the elements in G. (Or, if you like, consider the set of t-ary strings of length n, where by t-ary I mean a generalization of things like binary strings, ternary strings, etc., with t elements instead of 2 and 3 for binary and ternary, respectively). We want to count the number of orbits in X because otherwise we'll overcount; for example the "molecule" a-b-c is the same as c-b-a but not c-a-b.

It is pretty clear to see that
F(1) = tn

For F(g), we need to think about what kind of strings are invariant under rotation by π radians. Well, essentially the molecule needs to be "palindromic", and read the same forwards and backwards. So for example
a-b-c-c-b-a
or
a-b-c-b-a
are invariant under g. In other words, molecules invariant under g can anything in the first half of the molecule, but the second half is determined by the first half. So, if n is even, there are tn/2 possibilities in X, and if n is odd, there are t(n+1)/2 possibilities in X.

Applying our theorem gives the number of orbits to be

[X/S] = \frac{1}{2}(t^n + t^{\frac{n}{2}})}
[X/S] = \frac{1}{2}(t^n + t^{\frac{n+1}{2}})}

for even and odd n, respectively.

Let's do a reality check. For a triatomic molecule with two choices of atoms (e.g. {N, O}), 6 molecules are possible. They are:

N-N-N
N-N-O
N-O-N
O-N-O
N-O-O
O-O-O

which is, happily, six molecules. Rather obviously, from a chemical viewpoint, they molecules might not actually exist in the geometry of interest, but it's a start.

Admittedly, most people don't care about linear molecules**. But any geometry will do. Apparently even crystal structures will do. It's much faster than counting in the naive way, that's for sure! (Pólya apparently did a great many number of examples in his paper; I really ought to track that English translation down...)

*Question for the day, of which I don't know the answer: Why can't we use point groups for the Pólya-Burnside enumerations? Or, why are mirror planes and inversions not acceptable when considering symmetry operations on a molecule? (For linear molecules, we can argue that there are an infinite number of mirrors and rotations about the z-axis, and the enumeration doesn't work for infinite sets, but most symmetries have finite mirror planes.)
**Ok, most people don't care about counting molecules like this, either, but hey, it's kind of cool!


Continue...

Pólya-Burnside Enumeration

My previous post regarding the need to study notwithstanding, I want to talk about Pólya-Burnside enumeration*. It's a way to count the number of orbits of elements subject to a group action. This sounds all technical and uninteresting, until one realizes that molecules, under the set of "rigid" operations that leave the molecule invariant, is such a set of elements, with the operations themselves being the group action. (By "rigid", it pretty much means rotations only. In particular, no mirrors. However, I don't see why this theorem won't work with point groups - after all, point groups are groups!)

To make things more formal and rigorous, I need to talk about groups and group actions for a bit.

Well. First things first. A group G is a nonempty set S with a binary operation, *, satisfying four things:

  • S is closed under the operation. In particular if a, b are in G, then a*b is in G
  • * is associative. That is, if a, b, c are in S then
    a*(b*c) = (a*b)*c
  • There exists an identity element: that is, there exists an e in S such that for all a in S, e*a = a*e = a
  • Every element has an inverse: for all a in S, there exists a b in S such that a*b = b*a = e, where e is defined as in the previous point

Alot of things are groups: examples include the set of rationals under addition and the set of bijections under composition. It is easy to show that e and the inverse of a (which I'll start to call a-1) are unique.

Second thing up: group action. Given a group G and a set X (X doesn't have to be a group), a group action is a function
\Psi: G \times X \to X
satisfying two things:
  • Ψ (e, x) = x for all x in X
  • Ψ (g, Ψ (h, x)) = Ψ (gh, x) for all g and h in G, x in X

If G has a group action with X, we say that G acts on X.

This definition is actually pretty natural. If our group happens to be the set of rotations, one of which is g, and x happens to be a molecule, a group action is the act of performing a rotation g on the molecule x.

The set of g in G such that Ψ (g, x) = x is called the stabilizer of x, written as SG(x).

We can define a binary operation ~ on X, by saying x ~ y if there exists a g in G such that Ψ (g, x) = y. We can show things like this binary operation is an equivalence relation, that the stabilizer is a subgroup of G (i.e. a subset in G that is a group), and more interestingly, that if G and X are finite, then
|[a]| = \displaystyle{\frac{|G|}{|S_G(a)|}}
where [a] is the equivalence class of a, also called the orbit of a.
(I won't prove the last point although it's relevant to our discussion, because then I'll have to talk about Lagrange's Theorem and cosets and stuff and that'll make this blog post too long).

Theorem (this theorem has waaaaay too many names, like Cauchy-Frobenius Lemma and Burnside's Theorem)

Suppose that the finite group G acts on a finite set X. Then the number of orbits [X/G] is given by
[X/G]=\frac{1}{G}\sum_{g \in G}F(g)
where F(g) is the number of elements in X that's fixed by g (i.e. the set of x's such that g is in the stabilizer of x).

The proof is short and sweet. Fix x in X. Consider
\sum_{g \in G}F(g)
The element x is counted in the sum once, every single time g is in SG(x). So x is counted |SG(x)| times.

But we are counting orbits not elements. Every element in a particular orbit is counted |SG(x)| times, and there's
\displaystyle{\frac{|G|}{|S_G(x)|}}
elements in an orbit, so in total an orbit is counted
S_G(x)\cdot\displaystyle{\frac{|G|}{|S_G(x)|}}=|G|
times. In other words,
\sum_{g \in G}F(g) = [X/G]\cdot|G|

Ok, what's this good for? I'll give one example in the next post.

Apparently Pólya's original paper is awesome, but I can't read it because it's in German. There's an English translation in my school's library, but someone borrowed it!

(Random tangent: hey, the featured article of the day is the aldol reaction! Cool!)

*My group theory professor spent a lecture on this, so that's why I know about it.


Continue...

Tuesday, December 30, 2008

Whee!

(Sorry I am a bit excitable right now.)

Look! Look! Course outline for my Inorganic 2 Course!

Content:
This course provides a detailed examination of the structure and bonding in main group and solid state compounds, including valence bond and molecular orbital theory for describing electronic structures, Hückel and Extended Hückel approximations. Structures of simple solids, including close packing of spheres and derived ionic lattice types; aspects of chemical crystallography, Bravais lattices, point groups, space groups, crystal planes, and X-ray diffraction; ionic interactions in gases and solution; descriptive chemistry and characterization of main group element compounds.

The first set of course notes is also out online, and the professor makes good his promise - sphere packing, ionic lattices, and basics of crystallography. *Squeals excitedly*

Well ok, some of the stuff is review (e.g. close-packings are taught in first-year), but as my first inorganic course has pointed out, "review" does not mean "easy".

Incidentally, has anyone heard of the Kepler Conjecture? Basically, it says that the maximum average sphere-packing density for monodisperse spheres is the same as that of cubic/hexagonal close-packings. Very cool, because it's not obvious*!

*Proceeds to wander off to read about monodisperse sphere packings, including random ones*

(Ok, I realize that googling the posted course outline can partly wreck my anonymity; I trust you readers with your judgement).

*Not obvious to me, that is. If you happen to be a physicist or an engineer**, however...
**Kind of like this.


Continue...

Monday, December 1, 2008

Inverting Functions

Inverting functions is probably something we've all learnt in high school. Unfortunately, high-school techniques don't always work. (If only they do...)

From high school/first-year calculus: a (nice, simple, single-variable) function from (say) A to R, A a subset of R, y = f(x), is invertible iff it is one-to-one. Thus it's usually easy to tell whether a function is invertible or not - just find out whether it's one-to-one. Even visual inspection works, sometimes.

A blunt way to find inverses is to take the equation y = f(x), and solve for x. Another way to go is by using integrals and the inverse function theorem (roughly speaking*: dx/dy = 1/(dy/dx)), but integrating to give a closed form is, in general, not easy. Related to using integrals is to use differential equations, which is probably even harder than just using integrals directly.

Well, so now I have a function. It's a composite function, actually, so y = g(f(x)). Given y and a strictly-decreasing g(x), I want to find f(x). (I even have the values for x.)

Obviously, invert g.

But I can't invert g! It just won't invert! Argh!

Well. If I feel inclined to be all about approximations, I suppose I can use power series, assuming that g plays nice (I think it does, actually, but the number-crunching will be brutal).

All this is actually just a roundabout way for me to slack off so I can put off writing more reports - I need the function for one of the lower-priority projects, you see. Stupid reports. (I've missed my first deadline already. Sigh. Second deadline: everything by end of this week *fingers crossed*.)

(Incidentally: all those Wikipedia links are there because I've been doing chemistry for so long, I need reminders. It's a terrible thing, to be so math-deprived...)

*The multivariable versions of these things are bloody complicated and I've forgotten all about them (ahh, the joys of multivariable calculus**...). In truth, for many functions (multivariable or not) it's impossible to find a closed form for the inverse. I was hoping that this isn't the case for my function. Sigh.
**Actually, multivariable calculus was fun, partly because my class pretty much always proved and used theorems in full generality - no sordid number crunching!


Continue...

Thursday, July 31, 2008

Another Notational Rant

This time, the physicists have nothing to do with it: real analysis has nobody else to blame.

Given a nonempty set X, and f1, f2, ..., fn functions from X to , we define two functions and respectively , also from X to .

It is pretty obvious, just by looking at them, that the two functions are somehow related to each other (using terms very loosely here). Now if I tell you that one of the functions, applied to some x in X, gives


and the other one gives

is it obvious which one is which?

I am not sure how established the notation is, but I suspect it is not an uncommon thing. Admittedly, it is often difficult to think up clear notation, but when one can interchange the two without any obvious problems...that's not good.

What this is for: proving the Stone-Weierstrass Theorem. A very powerful theorem, by the way.

In contrast, as an example, the notation for upper and lower (Darboux) sums in discussing the definition of integrals is very, very clear. L(f,P) for the lower sum (of f with respect to a partition P), U(f,P) for the upper sum. What more do you want?

(Oh. I guess I should mention this. Apparently, the means "sup" or "join" and the means "inf" or "meet". Imagine that.)

As a reader may surmise, I am studying for the final exam. While the schedule this term actually is fairly decent (e.g. no two exams are on the same day), I am pretty much toast anyway. Not good to have the three most challenging exams in the same week. Not good at all.


Continue...

Thursday, July 24, 2008

An Equation for Gibbs Free Energy

One very useful equation in second-year thermodynamics class is


where ΔG is the Gibbs free energy for the process, ΔGo is the standard Gibbs free energy for the process, Q is the reaction quotient. The process takes place under isothermal and isobaric conditions.

Over at Matter Waves is a request for the proof. So here it is. Feel free to point out the mistakes.

For a k-component system of ideal gases, the total differential for G can be written as

where the cut off part is *dni, nj is the number of moles of component j, is shorthand for , and is shorthand for ( being a singleton). Because we are too lazy to write too many times, define the chemical potential of species i, , as

Under isothermal and isobaric conditions, we get


Let us go to a diversion and consider just a one-component system (say the ith one) for now. If we write as the molar Gibbs free energy of this ith component (as a function of P,T
only since this is a one-component system), we have

Using the Gibb's Equation dG = SdT - VdP under isothermal conditions, (and dropping the subscript i meaning "i-th component" for laziness' sake)

where I wrote P instead of because I don't know what will be for a particular situation (the cut-off part just says "since dT = 0). For convenience, set (which, because I am abusing notation, means initial pressure, by the way) to some standard pressure. The Powers that Be who defined "standard state" says 1 bar sounds good, so we'll go with that. Let . Thus

where is the chemical potential when the single component is at standard state.

Let us come back to our k-component system. If we have the chemical reaction

(or, sligtly less abstractly, something like
) we can write the equation in a really weird way:

(or cC + dD - aA - bB = 0, so to speak). To simplify notation, define

so that the weird chemical equation becomes

Notice that (for a reactant), (for a product). Coming back to the expression , and noting that the "final pressure" of component i is , the partial pressure of component i at equilibrium:

The product is defined as the reaction quotient of the reaction. And now we have what we desire:

Some might say that is supposed to be some ratio of partial pressures, not that weird product thing. Well. Read the left side of the definition of really carefully. The fraction ,
because , is basically without the unit "bar''. Also, is positive for a product, and negative for a reactant. So if our reaction is the simpler

we get

Ah, there we go. That looks better.

It's pretty straightforward to convert to other reaction quotients (e.g. in terms of mole fractions , or concentrations , instead of ), assuming ideality. We can also complain
that in real life gases aren't ideal, and fix this with an experimental "fudge factor", γ :

We call the fugacity of component i.

For liquids and solids, the argument is usually that the activity of a liquid or solid is always 1, so they don't show up in the reaction quotient. Now if you ask me why can we adapt this equation for Q when we have solutions, well, I don't know. My guess would be a really handwavy explanation that molecules in (dilute) solutions behave much like ideal gas particles (i.e. satisfying the postulates of the kinetic molecular model). Or we can use that , but that's missing the RT part.


Continue...