Feeds:
Posts
Comments

Archive for December 27th, 2011

Hey everyone,

Let me introduce you to a couple of projects that I began working on over the last week – a memory bank written in LaTeX and a Linux server hosting RStudio for my predictive modeling projects. I started working on these tasks in order to give myself challenges that would develop my skills, because I had noticed that after I graduated college, the sudden scarcity of drilling, testing, and intellectually stimulating tasks other than actuarial exams or projects at work led to what I felt was a lack of cognitive development, creative activity, and perhaps even a decline in my working memory. This doesn’t mean that I hadn’t done anything in the meantime, however. Over the past year I’ve continued my studies at a pace of around 14-20 hours per week reading things that I found interesting. For instance, I’ve been reading a book on European History because I never got the chance to take a course on it in high school or college. I think over the past year I may have studied more hours than I had in any year of my life. During exam time, I studied a year’s worth of material on Life Contingencies in a span of 3 months. However, I’ve realized that studying can only get you so far. I’ve heard countless times that you have to put down the books if you want to get good at something – you cannot, for instance, learn to ride a bike by reading a book on riding a bike – you actually have to get yourself on a bicycle, ride, fall down, learn from your mistakes, and try again. Thus, I decided to begin a series of projects in order to actively learn by creating. In this way, I hope to keep myself sharp, motivated, and most importantly, intellectually fulfilled.

Project 1: Eternal Memory Bank

I haven’t forgotten about \LaTeX, the markup language that I set about learning around this time last year, though I have forgotten much of the syntax I need to typeset mathematical notation. Unfortunately, using LaTeX via WordPress, as I had done last year, presents some significant drawbacks due to syntactical differences and the fact that I can’t develop my typesetting skills further if I only use LaTeX within my blog. Thus, I’ve decided to construct a memory bank as a complete LaTeX document that you can print out as a book. I first had to start out by learning all the things I forgot over the last year by reading Kopka and Daly’s Guide to LaTeX, at an extremely slow pace – sometimes as slow as 5 pages per minute – though fortunately, it does has some very good exercises. For instance, the following table took me more than an hour to produce:

An excercise in constructing arrays and adjusting formulas

By means of the following input:

\documentclass{article}
\newcommand{\D}{\displaystyle}
\newcommand{\bm}{\boldmath}
\newcommand{\ba}{\begin{array}}
\newcommand{\ea}{\end{array}}
\begin{document}
\[ \ba{|c|c|c|} \hline
\multicolumn{3}{|c|}{\rule[-2mm]{0mm}{6mm}\mbox{Equations for the tangential plane and surface normal}} \\ \hline
\mbox{Equation} & & \\
\mbox{for the} & \mbox{ Tangential plane} & \mbox{Surface normal} \\
\mbox{surface} & & \\ \hline
F(x,y,z)=0 &\ba[t]{r@{{}+{}}l}
\D{\frac{\partial F}{\partial x}}(X-x) & \rule[0mm]{0mm}{8mm} \D{\frac{\partial F}{\partial y}}(Y-y) \\[4mm]
& \D{\frac{\partial F}{\partial z}}(Z-z)=0
\ea & \ba[t]{r@{{}={}}c@{{}={}}l}
\D{\frac{X-x}{\D{\frac{\partial F}{\partial x}}}} & \D{\frac{Y-y}{\D{\frac{\partial F}{\partial y}}}} & \D{\frac{Z-z}{\D{\frac{\partial F}{\partial z}}}}
\ea \\[13mm]
z=f(x,y) & Z-z =p(X-x)+q(Y-y) &\D{\frac{X-x}{p}=\frac{Y-y}{q} = \frac{Z-z}{-1}} \\[4mm]
\ba{c}
x=x(u,v)\\
y=y(u,v)\\
z=z(u,v)\\ \ea &
\left|\ba{ccc}
X-x & Y-y & Z-z\\
\D{\frac{\partial x}{\partial u}} & \D{\frac{\partial y}{\partial u}} & \D{\frac{\partial z}{\partial u}}\\[3mm]
\D{\frac{\partial x}{\partial v}} & \D{\frac{\partial y}{\partial v}} & \D{\frac{\partial z}{\partial v}}\\ \ea \right| = 0 &
\ba{r@{{}={}}l}
\D{\frac{X-x}{\left|\ba{cc}
\frac{\partial y}{\partial z} & \frac{\partial z}{\partial u}\\[1mm]
\frac{\partial y}{\partial v} & \frac{\partial z}{\partial v} \ea \right|}} &
\D{\frac{Y-y}{\left|\ba{cc}
\frac{\partial z}{\partial u} & \frac{\partial x}{\partial u}\\[1mm]
\frac{\partial z}{\partial v} & \frac{\partial x}{\partial v} \ea \right|}}\\[10mm]
& \D{\frac{Z-z}{\left|\ba{cc}
\frac{\partial x}{\partial u} & \frac{\partial y}{\partial u}\\[1mm]
\frac{\partial x}{\partial v} & \frac{\partial y}{\partial v} \\ \ea \right|}} \ea \\[15mm]
\rule[-5mm]{0mm}{0mm}\mbox{\boldmath{$r=r$}}(u,v) & \ba{r@{{}={}}l}
\mbox{\boldmath{$(R-r)(r_1\times r_2)$}} & 0\\
\mbox{or} \hfill \mbox{\boldmath{$(R-r)N$}} & 0\\ \ea & \ba{r@{{}+{}}l}
\mbox{\boldmath{$R=r$}} & \mbox{\boldmath{$\lambda(r_1\times r_2)$}} \\
\mbox{or \boldmath{$R=r$}} & \mbox{\boldmath{$\lambda N$}}\ea \\ \hline
\multicolumn{3}{|c|}{\rule[0mm]{0mm}{10mm}\parbox{116mm}{In this table, $x,y,z$ and $\mathbf{r}$ are the coordinates and the radius vector of a fixed point $M$ on the curve; $X,Y,Z,$ and $\mathbf{R}$ are the coordinates and radius vector of a point on the tangential plane or surface normal with reference to $M$; furthermore, $p =\frac{\partial z}{\partial x}, q=\frac{\partial z}{\partial y}$ and $\mathbf{r_1}=\mathbf{\frac{\partial r}{\partial \mathnormal{u}}, r_2=\frac{\partial r}{\partial \mathnormal{v}}}$.}}\\ \hline
\ea \]
\end{document}

As you can see, the code does not look pretty. Fortunately, on another go I believe I can reproduce the above table in about 15 minutes, and perhaps even faster on the third try.

Anyway, I began putting the pieces of my Eternal Memory Bank a couple weeks ago and spent the last couple of weeks putting what little I had together for this post. If you’ve taken a look at my Projects page, you can see that I’ve been learning College Algebra over the last few months – not because I don’t know algebra but because I felt that I needed to fill in a few gaps left behind by my inadequate high school education, and because I’ve forgotten a lot since then and I thought perhaps that I could get some new insight by revisiting an old subject. I decided to extract a few pieces of information that I really ought not to forget – and put them into this memory bank to commit to memory, forever. You can download the pdf from my SkyDrive here and the TeX file here.

An excerpt from the Preface:

“Hey everyone,

I’ve decided to construct an eternal memory bank, within which I’ve placed
select pieces of information that I’ve deemed important enough to commit to
memory, forever. This document serves as a visual representation of these
pieces in written form. I’ve undertaken this seemingly somewhat tedious and
arbitrary project to keep my memory in shape and because I’m sick and tired
of forgetting the formula to (a+b)^3 and having to either work out the expan-
sion every time it shows up (usally once in a blue moon for me) or look it up (I
usually work out the expansion out of pride, or just use the bionomial theorem).
In other words, these things take up precious time and I would much rather be
able to pull them immediately from memory than to rely on something that
may be in another book in some distant library or buried underneath mounds
of links in a website like Wikipedia.

Let me stress that I am not relying on memory for all of my tasks – that would
be ridiculously insane. You cannot solve complex problems on rote memory
alone becuase they require creativity and higher-level analytical skills. On the
other hand, there are some things you absolutely must memorize – for instance
as I write I am pulling out every single word on this page by memory. You can
gure out some words with context clues and associations, but if you have to
do that with every word during a conversation that is also absolutely, insanely
ridiculous.

So, welcome to my Eternal Memory Bank. Everything you see here, including
the fonts, document structure, Table of Contents – I guarantee you I’ve memo-
rized it. So, take a look, give me feedback if you wish, and enjoy.”

Project 2: RStudio via Linux Server

My second project began as a side project to my real job when my boss recommended that I check out Kaggle and sign up for their predictive modeling competitions. For those of you who don’t know, the website Kaggle hosts a series of predictive modelling competitions and awards cash prizes to the winners. The competitors include PhD-level academics, statisticians, mathematicians, hobbyists, and actuaries like me. I think of this as an excellent opportunity to see how the experts operate – the cash prize merely serves as icing on the cake, and I don’t really have the ambition to go for the top prize as of now.

To set up a base for myself and the rest of my team members, I decided to construct a Linux server out of an old computer I had laying around – it has some new components though, like an Athlon II x4 processor and plenty of RAM – 8GB. The server currently operates on ubuntu 11.10 “Oneric Ocelot,”  though I may change my mind and set up an ssh server using Ubuntu Server instead. In addition to the Ubuntu, I set up my Windows machine in a way that lets me control the Ubuntu Server remotely – including shutting down, turning on, logging in etc.

Logging into the server remotely with Tight VNC

After installing the server I downloaded RStudio server, a GUI developed by a group of volunteer programmers that allows people to connect to R remotely through their own Windows machines. In this manner I hope that my teammates and I can collaborate on our projects. I first asked some of my friends to try logging in but they couldn’t do it – so I asked my more technically savvy friends what to do and they suggested that I set up a static IP and forward port 8787 on my router. After doing so, they successfully logged in! Now I, or anyone on my team can access the server anywhere with an internet connection – hotels, coffee shops, etc.

Connecting to the RStudio GUI though Firefox on my Windows machine

Well that’s pretty much it, I have to say I’m happy that I posted this week as promised. I used to have trouble with these things as a kid but I feel that I’ve stayed on task much better as an adult. One study claims that it’s because kids have too much grey matter. My dad once said that “smart people just explain things away” when I tried giving him excuse one time as to why I forgot to replace the window stickers inside my car last year. I had trouble understanding what he meant but I think he meant that when scientists come up with explanations for these phenomena (in this case, why kids can’t stay on task), people use these explanations as excuses for their bad behavior. Thanks, Dad. Stay tuned for next week’s posting!

Read Full Post »