Tuesday, November 8, 2011

Induced Evolution

I had an idea briefly about evolution and curing diseases.

Let's say we want to cure HIV.  You could take some bacteria, or something that can get infected by HIV, and grow many cultures.  Then, you could infect that culture with the disease.  Artificially determine and kill off any bacteria which get infected.  Repeat until all you have left are HIV-resistant bacteria.  From these remaining, you could see what caused them to be resistant, or somehow develop a drug mimicking these properties.

We can artificially induce natural selection by (somehow) manually killing off cells which are infected.  The bacteria would adapt to this environment, and essentially "learn" HIV resistance.

This assumes the following:

  1. We can actually kill off only the infected cells without letting them reproduce.
  2. We can use the resistant cells to create a drug or some sort of cure.
  3. The organism you use can possibly, through some mutation, become resistant to the disease.  Since evolution can take a long time, perhaps something like radiation can be used to speed up the rate of mutation, and further the process along a bit.

Wednesday, October 26, 2011

Obama's Student Loan Plan: The Numbers

Obama recently touted his new student loan consolidation plan.  This is an issue which hits very close to home since I will have a lot of student loan debt when I graduate.

The gist is if you consolidate your government loans, then you save 0.5% on the consolidated rate.

Great!  But consolidating your loans means that you lose one very important thing: the ability to pay off the highest interest loans first.

So let's see how the numbers pan out.  We will assume that a person has 4 $12,000 loans (total of $48,000), with interest rates ranging from 5% to 8% will put $1,000 per month into the loans.

So I compared paying off the highest interest loans first, to Obama's consolidation plan.

The results: you end up paying almost the same amount at the end, and actually save $200 by not consolidating under Obama's plan.  Note that at the end of year 4, only 1 loan remained, I just had the person pay a constant amount per month for 12 months.  In actuality, the person would most likely put that $1,000 per month into the last loan, paying it off faster,and making the difference more pronounced.

Also note that when consolidating your loans, the first few years actually leave you with less remaining balance, since you aren't paying off high interest loans those first few years.  However, once you hit around the halfway mark (year 3) paying off the high interest loans actually pans out ahead.

Tuesday, September 13, 2011

Ph.D. - 90% Hard Work, 10% Intelligence

As I continue towards completing my Ph.D., there is one truth I've learned about a doctoral program.  That truth is that completing a Ph.D. is 90% hard work, and 10% intelligence.  When most people hear that somebody has completed his or her Ph.D., their first thought is, "wow, that person must be smart."  I want to dispel that myth right now.

Not that almost all Ph.D.'s I've met aren't very smart men and women, but that is not their defining trait.  Their defining trait is the ability, willfulness, desire, and dedication to work hard.  I'm sure this is also true in other professions and degrees, but it is not uncommon to work 7-day 80-90 hour+ weeks.  And that work includes difficult, as well as menial, work, with looming deadlines.

I strongly believe that if the (average?) American got accepted into a Ph.D. program, and put in the requisite time to read and implement everything they could regarding their chosen field for several years running, that person would undoubtedly be able to complete a doctoral program.  Intelligence and creativity are tools to help make completing a Ph.D. easier, but they aren't the main tools at one's disposal.  Given, one must have some baseline intelligence to understand everything one learns about his or her field, but that baseline intelligence is something almost everybody has.

So when I meet somebody and I found out they have a Ph.D., my first thought isn't, "wow, you must be smart", but rather, "wow, you sure know how to work hard."

Monday, August 1, 2011

Traditional vs. Roth IRA's - The Numbers

Let's say you have Investment amount of money (gross, pre-tax) to invest, and the government limits you to contributing Limit per year (currently $5,000), where Investment >> Limit. Your tax rate now is Tax_Now, and your tax rate when you withdraw the money is Tax_Withdraw. You will receive a Return per year on your investment (such as 9%) and hold it for some number of Years before withdrawal. Finally, we assume we will be investing up to the maximum Limit per year.

Roth IRA's are post-tax investments, and tax-free withdrawals, while Traditional IRA's (and 401k's) are pre-tax investments, and taxable withdrawals. We want to know how much money will be withdrawn (denoted as Withdrawal) with each type of investment vehicle.

Roth:
We are able to invest

Investment * (1 - Tax_Now).

Limit goes into a Roth IRA, and

Investment * (1 - Tax_Now) - Limit

goes into a taxable account. So we have a tax-free withdrawal of

Limit * (1 + Return)^Years.

We also have a taxable withdrawal of

(Investment * (1 - Tax_Now) - Limit) * (1 + Return)^Years at a rate of Tax_Withdraw,

which results in a withdrawal of

(Investment * (1 - Tax_Now) - Limit) * (((1 + Return)^Years - 1) * (1 - Tax_Withdraw) + 1).

The -1 and +1 are because you are only taxed on your earnings, not on the principal, when you withdraw.

Add this all together we have:

Withdrawal_Roth = Limit * (1 + Return)^Years + (Investment * (1 - Tax_Now) - Limit) * (((1 + Return)^Years - 1) * (1 - Tax_Withdraw) + 1)


Traditional IRA:
The traditional IRA is only taxed on withdrawal. So we are able to invest Limit into an IRA, and

(Investment - Limit) * (1 - Tax_Now)

into a taxable account. The IRA results in

Limit * (1 + Return)^Years,

which, after taxes, equals

Limit * (1 + Return)^Years * (1 - Tax_Withdraw).

The taxable account contains

(Investment - Limit) * (1 - Tax_Now)

dollars invested, resulting in

(Investment - Limit) * (1 - Tax_Now) * (((1 + Return)^Years - 1) * (1 - Tax_Withdraw) + 1)

So our total withdrawal from a traditional IRA is:

Withdrawal_Traditional = Limit * (1 + Return)^Years * (1 - Tax_Withdraw) + (Investment - Limit) * (1 - Tax_Now) * (((1 + Return)^Years - 1) * (1 - Tax_Withdraw) + 1).

Example:
We'll go with $10,000 gross to be invested with a $5,000 limit for 8 years, at 9% return (so that our investments roughly double). The tax rates will both be 30%.

Withdrawal_Roth = Limit * (1 + Return)^Years + (Investment * (1 - Tax_Now) - Limit) * (((1 + Return)^Years - 1) * (1 - Tax_Withdraw) + 1)
= $5,000 * 1.09 ^ 8 + ($10,000 * 0.70 - $5,000) * ((1.09^8 - 1) * 0.70 + 1)
= $13,352.41

Withdrawal_Traditional = Limit * (1 + Return)^Years * (1 - Tax_Withdraw) + (Investment - Limit) * (1 - Tax_Now) * (((1 + Return)^Years - 1) * (1 - Tax_Withdraw) + 1)
= $5,000 * 1.09 ^ 8 * 0.70 + ($10,000 - $5,000) * 0.70 * ((1.09^8 - 1) * 0.70 + 1))
= $12,905.77

Combination:
We can combine some like terms if we define several common variables:

IRA_Return = Limit * (1 + Return)^Years
Other_Fraction = ((1 + Return)^Years - 1) * (1 - Tax_Withdraw) + 1

Now, we can write them as:

Withdrawal_Roth = IRA_Return + (Investment * (1 - Tax_Now) - Limit) * Other_Fraction

Withdrawal_Traditional = IRA_Return * (1 - Tax_Withdraw) + (Investment - Limit) * (1 - Tax_Now) * Other_Fraction

subtracting, we get

Difference = Withdrawal_Roth - Withdrawal_Traditional
= IRA_Return * (1 - 1 + Tax_Withdraw) + Other_Fraction * (Investment * (1 - Tax_Now) - Limit - (Investment - Limit) * (1 - Tax_Now))
= IRA_Return * Tax_Withdraw + Other_Fraction * (-Limit * Tax_Now)

= IRA_Return * Tax_Withdraw - Other_Fraction * Limit * Tax_Now

So in our example, we have
IRA_Return = $5,000 * 1.09^8 = $9,962.81
Other_Fraction = (1.09^8 - 1) * (1 - 0.30) + 1 = 1.6948
Difference = $9,962.81 * 0.30 - 1.6948* $5,000 * 0.30
= $446.64

Just to check, we have:
$13,352.41 - $12,905.77 = $445.64. Good.

So Difference is how much you gain by using a Roth IRA over a traditional IRA.

Friday, April 29, 2011

FreeBSD

I’ve been playing around with FreeBSD lately, and I really enjoy the portage system. I like the idea of compiling things optimized for your own computer, and only compiling what you want. Also it helps to learn the intricacies of how computer software works internally.

But I am starting to feel like FreeBSD doesn’t offer the same things Linux does. For example, it uses the old gcc 4.2, which is fine I suppose but the fact that the new gcc 4.6 isn’t used because the FreeBSD team doesn’t like the license kind of irks me. I was able to compile some software with the new gcc in FreeBSD, but if I compiled a library with 4.2 and tried to link a program using 4.6, it wouldn’t compile. So using >4.2 caused more problems than solutions.

Also, there are several applications which are only available for Linux right now, such as Dropbox and Flash. I was able to get Flash running through the Linux emulator, and I was able to compile Dropbox through the source, but nautilus never seemed to pick up the dropbox extension, essentially rendering it useless.

So what to do if I enjoy the portage system but also like the structure of Linux? Well, after some research it seems Gentoo is a good solution. I will be trying out Gentoo in the upcoming days and seeing if I like it.

Oh and FreeBSD didn’t have nvidia 270 yet, which was simple enough to import into /usr/ports myself, but was required for me because of this bug.