Sunday, September 25, 2011

How To Predict The Future

A while ago, I noticed a trend when people made predictions for the future.  Short term predictions tended to be too short, while long term predictions tended to be too long.  For example, some new technology that you think will be around in 10 years will probably be closer to 20 years.  On the other hand, if you think a technology will take 500 years it'll probably be something like 250.

I think there's relatively simple explanation for this.  People tend to focus on big changes and overlook small ones.  If we take a technology like solar power, there are plenty of predictions about it being cheap enough for large scale use in 10 years.  However, these predictions likely overlook the various small problems with implementation.  Perhaps we will have solved the largest problem keeping costs high in 10 years, but there will be a number of other problems that we haven't solved, many of which we aren't even aware of yet.

It is even clearer in long term predictions.  Look at a sci-fi story from a few decades ago, and you will see lots of technology that is inferior to today's tech.  A well know example of this is the original Star Trek series from the 60s.  They use big clunky controls, and the portable devices are already inferior to a tablet computer.  Keep in mind it is set over 200 years in the future, so there is little doubt that we will be massively more advanced than them by the same time.  The exceptions to this would be single big inventions that may well be impossible (eg faster than light travel, matter transport).

When someone is writing a story based in the future they need to come up with each invention.  It's easy to come up with major inventions (particularly if they are needed for the plot), but most inventions aren't major.  Most inventions are small and evolutionary.  In the last 50 years there have been a few major inventions (and there is no hard line, so it's futile to try to decide exactly what has been major vs minor), but there have been millions and million of small innovations.  Most of the change in our daily lives is from these small innovations vs the major revolutionary inventions.  On top of this, most of these innovations have been incremental, ie, they relied upon the previous innovations to exist first.  Without coming up with the long chain of innovations, it would be impossible to predict the one at the end.

Getting back to my main point, short term predictions need to be lengthened, while long term predictions need to be shortened.  When I come up with a prediction I just double it if it's < 50 years, or half it if it's > 200 years.  This is ok, but I figured there had to be a better way to make the adjustments.  I wanted to come up with some formula that would tend to move predictions towards a certain time frame (eg 100 years).  I had some requirements.  First, it should tend to about double short term predictions, and half long term ones.  Second, as the year gets closer to 100 the adjustment should become relatively less, with the adjusted year never being moved past 100 years.  Last, I wanted one formula for < 100 and > 100 years, not a piecewise function. 

I came up with a formula to do this a few years ago, but didn't save it.  My recent reading of Manna made me think about this again.  So, I started a spreadsheet and set out to come up with a new formula that fit my requirements.  After some tinkering I came up with this:$$$\cdot$$$ $$$\frac{}{}$$$
Where: N is the new outputted year, I is the inputted year, and log is the base 10 log.  And if it's not clear, the sqrt is an exponent of I.

This worked out pretty well.  It's a bit too high for input years < 5 years, and an input of 1 year causes a divide by 0.  10 years gives 26, 25 gives 47, 50 gives 70, 150 gives 122.  Looking at the adjusted values though, I think the turning point is too far out.  More thought convinced me that something like 70 years was probably better.  Changing this was rather easy.  I used 2 because log10(100) = 2.  So it followed I could just replace 2 with log10(t).  This had the additional benefit of making the base of the log not matter (as long as you use the same base on the top and bottom)
Where: N is the new outputted year, I is the inputted year, t is the year where the turn from adding years to subtracting years happens, and log is any base log.

Looking at the formula I noticed something interesting.  If you're unaware, calculators commonly perform base 10 or base e logs.  If you want to perform a different base log you need to use the following formula:
$$\log_b{x} = \frac{\log{x}}{\log{b}}$$
Where: logb(x) is the base b log of x, and log is any arbitrary base log.

In other words, if you want to find the base 7 log of some number, but can only compute the base 10 log then you have to find the base 10 log of whatever number you want to find the base 7 log of, and then divide by the base 10 log of 7.

With this knowledge, it should be clear that the above formula is really:

Where: N is the new outputted year, I is the inputted year, t is the year where the turn from adding years to subtracting years happens, and logI is base I log.

I attempted to get the variables out of the exponent using more logs.  I failed, but managed to get it in a different, and I feel interesting, form:
$$N = I^{\sqrt{\log_I{t}}} = b^{\sqrt{\log_b{t} \cdot \log_b{I}}}$$
Where: N is the new outputted year, I is the inputted year, t is the year where the turn from adding years to subtracting years happens, and logb is the base b log.

If we use a base of 10 for the logs, and a turning year of 100 this becomes:
$$N = 10^{\sqrt{2 \cdot \log{I}}} = 10^{\sqrt{\log{(I^2)}}}$$
Where: N is the new outputted year, and I is the inputted year.

This formula is about as simple as I can make it. More importantly than that though, it reveals some interesting things. First, note how there are two functions, log and sqrt, and then their inverses, 10^x and x^2. They are nestled inside each other in an alternating fashion. Second, note that the conversion is now simply a power of 10. This means you can just focus on the exponent part to get a feel for how it will behave.

Anyway, I made two graphs showing how the function translates years. First is specifically the input years < 100. The second ranges 0-10,000.

In the second graph it's clear that it's similar to a simple log graph.  I was worried that something as simple as log(I) could produce an adequate curve.  A simple log(I) hugged the x axis too much, but multiplying by 100 steepened the curve.  Then, subtracting 100 shifted it down so that the graph went through the point (100, 100).  This looked ok for the low values, however, it flattened out too quickly for the higher values.  I played around with the values some more, but couldn't find any way to get the curve right.

So, I'm pretty happy with my formula.  Maybe I'll think about it some more and try to figure out if there is a simpler way to get that curve.  After all, I always need ways to avoid studying the math that I'm actually going to be tested on.

If you want some more interesting info on the formula, Wolfram|Alpha never ceases to amaze:^sqrt%28lg%28x^2%29%29

Tuesday, September 20, 2011

Obama unveils plans to cut US deficit

I generally don't bother posting about super obvious news like this.  However, after reading the proposal I was rather surprised.  As always, I recommend you simply read the source documents first hand:

It's very readable, and broken up into four sections (jobs, savings, health, tax).  Each section is filled with a few dozen ideas to accomplish that goal.  Each of those with a paragraph or two giving more detail.  In other words, it lends itself to skimming.  A word of caution: the pdf bookmarks seem to have been created by some sort of 'cat playing with laser pointer dot on keyboard' system, so steer clear of them.

Since you won't read it, I'll go over some of my favorite parts.  First, it mentions some of my biggest pet peeves, farm and oil subsidies.  Second, it mentions selling off the vast property holdings of the US.  I'd be amazed if either of these ever come to fruition.  

On the taxes side it deals with two of the loopholes I'm aware of that allow the top 1% to pay so little taxes.  First, is the capital gains tax.  If you aren't aware interest from investments isn't taxed as income.  Rather it is all taxed at the same flat rate, which I think is currently 15%.  It is common for the very rich to get most of their income as interest on investments, so they end up paying only 15%.  Second, is depreciation of assets.  That allows the rich to deduct the loss of value of things from their income.  However, it oddly only addresses depreciation with respect to airplanes, and then only says the schedule should be increased from 5 years to 7.  Frankly, I have no idea if what actual effect that would have, and I don't know why it's not being more generally applied.  Although I think the capital gains tax is more important.

Two major savings items that don't seem to be mentioned are reducing the size of the military, and increasing age of eligibility for social security.

While it's not perfect, it's far better than anything I would have expected to see proposed by a traditional politician.  In my opinion one of the following must be true:
  • It is only being proposed because the president knows it has no chance to pass, and it will garner him some general goodwill (see I tried).
  • There are even deeper loopholes that the rich actually use to protect their income from taxes.
  • Will end up passing, but stripped down to the point that it represents the worst of both worlds (see health care bill).
  • My view of US politics is overly cynical.

Monday, September 19, 2011

Manna by Marshall Brain

Rather interesting short story about a possible outcome of robots being able to perform more and more jobs.  The ideas were interesting, although I found it slightly long winded and preachy at times.  However, I suspect that could be a result of my distaste for fiction in general.

Sunday, September 18, 2011

Comparison of Four Major Scripting Languages

A detailed comparison of PHP, Perl, Python, and Ruby.

Saturday, September 17, 2011

Scientists Discover 'Hidden' Code in DNA Evolves More Rapidly Than Genetic Code
The researchers discovered that as many as a few thousand methylation sites on the plants' DNA were altered each generation. Although this represents a small proportion of the potentially six million methylation sites estimated to exist on Arabidopsis DNA, it dwarfs the rate of spontaneous change seen at the DNA sequence level by about five orders of magnitude.
This suggests that the epigenetic code of plants -- and other organisms, by extension -- is far more fluid than their genetic code.

Saturday, September 10, 2011

Brownian ratchet
The device consists of a gear known as a ratchet that rotates freely in one direction but is prevented from rotating in the opposite direction by a pawl. The ratchet is connected by an axle to a paddle wheel that is immersed in a fluid of molecules at temperature T1. The molecules constitute a heat bath in that they undergo random Brownian motion with a mean kinetic energy that is determined by the temperature. The device is imagined as being small enough that the impulse from a single molecular collision can turn the paddle. Although such collisions would tend to turn the rod in either direction with equal probability, the pawl allows the ratchet to rotate in one direction only. The net effect of many such random collisions should be for the ratchet to rotate continuously in that direction. The ratchet's motion then can be used to do work on other systems, for example lifting a weight against gravity. The energy necessary to do this work apparently would come from the heat bath, without any heat gradient. Were such a machine to work successfully, its operation would violate the second law of thermodynamics, one form of which states: "It is impossible for any device that operates on a cycle to receive heat from a single reservoir and produce a net amount of work."

Wednesday, September 7, 2011

Did the CIA Do Enough to Protect Bin Laden's Hunter?
But it was the story's intro--not the analyst's bio--that caught the eye of the group Cryptome, which specializes in data leaks. The AP mentioned that John was standing "just outside the frame" in the iconic photograph, below, of President Obama's national security team in the Situation Room during the raid that killed bin Laden. Cryptome homed in on the yellow patterned tie of a man just off camera (see red arrow) and then identified a tall man, face in full view and wearing the same or similar tie in another photo of the national security team from the White House Flickr stream. They also spotted the same man in a photo of CIA Chief Leon Panetta attending a private briefing on Capitol Hill that the AP says John also attended. Cryptome speculated that the man wearing the tie in question was John.

Sunday, September 4, 2011

How To Solve Basic Science Formulas

While taking intro science classes I've notice a lot of people who don't have any system for solving basic science formulas. Once one develops a system for solving these equations they become very easy. Indeed, it is a criticism of many science classes that simply solving these equations blindly doesn't teach one anything about science. I'll leave that debate for somewhere else, and instead go over the process of solving these types of problems.

I'd also like to note that solving simple physics formulas isn't only useful for those in science classes.  Over on the Physics Forums I see many people asking questions that they could solve themselves by simply Googling the formulas and then plug and chug away.

Before we begin, you should be able to manipulate algebraic formulas to solve for different variables. Given:
you should be able to solve for a, b, c, or d. For example, $$$d = \frac{c}{a+b}$$$.  If you're unsure about how to do this Khan Academy is a great site covering tons of math and science at all levels.

Second, it would behoove you to familiarize yourself with the common variables used in whatever area you are working. Usually, these are pretty obvious (e.g. m for mass, v for velocity), but sometimes the obvious choice is already taken and something else must be used.

For the first example here are some formulas involving energy:
E = mhg
E = 1/2 m v2
E is energy, m is mass, h is height, g is gravitation acceleration = 9.8 m/s, and v is velocity.

Q: What is the velocity of an object with a mass of 500 kg and a kinetic energy of 100,000 J?

Begin by identifying the variables given, as well as the one asked for.  We identify m = 500 kg, E = 100,000 J, and v = ? (we are looking for it).  Now we must find a formula that has these variables.  The second formula (E = 1/2 m v2) has all these variables.  However, we need to solve for v.  We can either solve for v before (while it is only variables) or after (while is is all numbers) we substitute numbers for variables.  Which is easier will depend on the problem and person.  Solving first has the advantage of avoiding some messy arithmetic, particularly on tests where the numbers are likely to cancel out nicely.  It also only has to be done once for a given variable.  So, if you have several problems all asking for the same variable it will make sense to solve for that variable once.

Getting back to this problem, I would solve for v first:
$$E = \frac{1}{2} m v^2$$
$$\frac{2 \cdot E}{m} = v^2$$
$$\sqrt{\frac{2 \cdot E}{m}}=v$$ (Ignoring the negative root)
Now we replace the variables with the known values:
$$\sqrt{\frac{2 \cdot 100,000\,\mathrm{J}}{500\,\mathrm{kg}}}=v$$
And now we solve the arithmetic:
$$v = 20\,\mathrm{\frac{m}{s}}$$

I'd like to mention something about units.  You could simply recognize that meters per second is the expected units for velocity and assume that is what your result is.  However, you can also solve units in the same way as you solve numbers.  In this case we need to know that J = $$$\mathrm{\frac{kg \cdot m^2}{s^2}}$$$.  Dividing J by kg is the same thing as multiplying it by 1/kg.  Hence, the above formula with numbers removed gives:
$$\sqrt{\mathrm{\frac{kg \cdot m^2}{kg \cdot s^2}}}=\mathrm{v}$$
kg/kg cancels out giving:

And taking the square root gives the expected m/s.

For a second example I'll be using an electricity question. Here are several formulas in this area:
$$F=\frac{k \cdot q_1 \cdot q_2}{r^2}$$
$$R=\frac{\rho \cdot L}{A}$$
$$E=\frac{k \cdot q}{r^2}$$
$$A=π \cdot r^2$$

F is force from the charge.
k is Coulomb's constant = 9 x 109 $$$\mathrm{\frac{N \cdot m^2}{C^2}}$$$
qn is the charge of particle n.
r is the radius, or distance between the two charges.
V is voltage aka electrical potential difference
I is electrical current, measured in amps
R is resistance
ρ (greek letter rho) is resistivity of a material
L is length
A is cross sectional area
E is electrical field strength (volts/meter)
w is work

Here is a list of ρ (rho) values for common materials:
Material ρ [Ω·m] at 20 °C
Aluminium 2.82×10-8
Calcium 3.36×10-8
Copper 1.68×10-8
Gold 2.44×10-8
Iron 1.0×10-7
Lithium 9.28×10-8
Nickel 6.99×10-8
Silver 1.59×10-8
Tungsten 5.60×10-8
Zinc 5.90×10-8

Q: A copper wire is 40 cm long and 1 cm in diameter. What is the resistance of the wire?

Begin by identifying all the variables given, as well as the one being asked for.  Since all the formulas use standard units (meters, kilograms) I find it best to just immediately convert these into the standard units.
L = .4 m
d = .01 m
ρ = 1.68×10-8 Ω·m (value for copper taken from above chart)
R = ? (this is what the question is looking for)

Now we look at our available formulas and find the one which uses those variables.  In this case, none only have those variables.  However, $$$R=\frac{\rho \cdot L}{A}$$$ is only missing one, A (cross sectional area).  Thus, we must solve a sub problem first.  We see there is a formula for cross sectional area provided: $$$A=π \cdot r^2$$$, this only requires radius, which we know is half of diameter (if you wish, you can pretend d = 2r was provided and do a second sub problem to find r).  Using the area formula we find that:
A = 7.85 x 10-5 m2

With the above list of variables, we can now solve for the original unknown (R).
First rewrite the original formula:
$$R=\frac{\rho \cdot L}{A}$$
Then substitute in the known variables:
$$R=\frac{1.68×10^{-8} \Omega\,\mathrm{m} \cdot 0.4\,\mathrm{m}}{7.85 × 10^{-5}\,\mathrm{m}^{2}}$$
Then solve the numbers and units separately:
$$R= 8.56×10^{-5} \frac{\Omega\,\mathrm{m}^2}{\mathrm{m}^2}$$
Units cancel the same way numbers do.  Thus, m2/m2 cancels out and we are left with just Ω as our units, which is what we expect.  It is easier to just drop all the units and then assume the final units are what they are supposed to be.  However, actually solving the units provides an important check.  If you are unsure if you are correctly remembering a formula simply solving with only units can tell you if its wrong.  In addition, solving the units while doing the math will help show simple errors.

I could continue giving examples, however I think the basic process is pretty easy to follow (also laziness).  Just identify the variables.  Find a formula with the correct variables in it.  Plug in the numbers and solve.  I suggest you simply think of things to calculate then Google to find the formulas.

Friday, September 2, 2011

How the full unredacted Wikileaks cables were leaked,1518,783778,00.html

Just in case you haven't heard, the entire set of cables that Wikileaks has and was gradually publishing has now been leaked.  The important fact here is that Wikileaks had been redacting the names and other specific low level info.  Well now a 350 MB 7z file is available on The Pirate Bay.
The password being: