Friday, July 28, 2017

Learning Fortran is a waste of your time

Suppose you are an advanced student of physics, and you're just beginning your first research experience with a new professor.  You're excited about the opportunities this means for your future, fascinated by the implications of the research, and anxious to please.  Your professor tells you you need to run a computer simulation, and this is also exciting; you've never used a computer as a computer before -- usually just as an internet browser.  To get you started, he points you to a reference text with some sample code, or sends you one he has on his hard drive somewhere.

This code will be written in Fortran.  They all are.  All legacy codes are Fortran.

So what is Fortran?  Fortran is a high-level programming language designed back in the 50's.  Here "high-level" means that it is not assembly language, and the programmer does not directly interact with machine elements like bits, bytes, or memory addresses, though Fortran is much "lower-level" than most modern languages like Java or Python, meaning it is only just a step or two above machine code.  The name "Fortran" is short for "Formula Translation," as the language was intended to more directly translate a mathematical formula into computer code; Fortran allowed, for instance, an entire mathematical expression to be written out as a single line of code, as opposed to assembly, which would require multiple lines of register swapping and simple operations to acheive the same result.

You'll get the sample code and look at it, and it will be completely incomprehensible.  They all are.  All Fortran codes are incomprehensible.

Why is this?  There are a lot of things that contribute to the issue.

Saturday, June 10, 2017

The Ukrainians From ZRus Who 'Read' My Blog

If you are a fellow user of Blogger or a similar platform, then you have probably noticed that you get a significant amount of traffic from websites in Ukraine or Russia, many with the specific domain name  You're probably curious about who these Ukrainians linking to your blog might be.  You may even be a little bit flattered that your tiny blog is getting international recognition.

Don't get excited, and whatever you do, do NOT click any link to these websites.  This is a well-known scourge on the blogger community, and clicking the links could infect your computer with malware.

These sites are a malicious scam.  Let me explain how this scam works.

Thursday, May 18, 2017

Why does so much time pass in Interstellar?

While on a quest to save the human race, astronauts in the film Interstellar travel to a foreign planet orbiting closely around a supermassive black hole.  Due to the strong gravity, time on the planet is distorted, being artificially compressed.  Seven entire years here on Earth are squeezed down to just one hour of time on the planet.

This is one of the many bizarre effects of Einstein's general theory of relativity, referred to as gravitational time dilation.  I had some students from my physics class recently ask me to explain this phenomenon.  So I prepared what I think is a fairly straightforward explanation of the phenomenon, assuming only a knowledge of 1st semester physics and some simple calculus.

Wednesday, May 17, 2017

The Past Two Years of My Life

I was looking just now, and realized it's been two years since my last update.

This blog is kind of a weird thing. It started as a way for me to vent my thoughts on fantasy and science fiction books, then got kind of science-y. At one point I had a spike on my post about the vampire movie Let Me In.  Then I had that viral Berenst#in Bears post that got passed around the web a lot, inspiring lots of kookiness. I was getting lots of traffic for a while -- until Vice basically rewrote my same idea but on their own website with their names attached.

Since then my traffic has slowly dwindled down to numbers that actually make sense for what my blog is.

Really, what gets me isn't that another site gets my traffic, but that in all the traffic that I got, almost none of them read what I think are some of my coolest posts -- the stuff about using Gauss' Law to calculate the width of Narnia, or using volume contracting spacetimes to travel to other dimensions, or why everything cool in physics is impossible, or how time travel is understood to work within physics.

I haven't posted much (anything) since things sort of died down. I still check in frequently, but never find the impetus to start to writing. Maybe it's the weight of former glory intimidating me.

Wednesday, August 5, 2015

Effective Mandela Theory

There are at least hundreds of thousands (or even millions) of people around the world who were shocked to hear that Nelson Mandela died recently.  Their shock wasn't that a world-famous civil rights advocate had passed away.  They were shocked because they thought
the man had died thirty years ago!

According to an impressively large number of people, Nelson Mandela originally died back in the 80s when he was in prison.  They remember seeing it on the news and hearing about riots that broke out all across South Africa.  It's a very specific memory, and a lot of people share it.  It didn't happen (apparently, anyway), but thousands and thousands of people insist on remembering Mandela's death in prison and the resultant riots, and their accounts are fairly uniform (as uniform as memories ever are, anyway).

Now, people misremember things all the time.  And usually, people can be pretty stubborn about what they remember, especially when it's two memories against each other.  But when presented with something like every single newspaper ever printed that contradicts their claims, most people relent and admit that they're wrong.  With Nelson Mandela's death, the people who swear he died earlier believe this memory so strongly that they will not let go of it, despite being contradicted by every relevant fact in existence.  It isn't because they're just that stubborn, or that stupid.  The memory has a certain quality to it.  For whatever reason, their brain refuses to discard it.

This sort of phenomenon has become known (for better or worse) as the Mandela Effect.  It is when a large number of people share and insist on a fairly cohesive counterfactual memory.

Saturday, July 18, 2015

The fallacy of 'billions of billions', or: Why popular arguments that aliens must exist are bogus.

The universe is an awfully big place.  Granted, most of it is empty space.  But within that empty space, there are trillions of stars.  Maybe more.  At least some of those stars have planets around them, and some of those planets are the kind that could give rise to life.  That's still hundreds of billions (at least) of planets that can support life out there.  And so, the popular argument goes, even if the odds of life arising on another planet are very small, there are so many planets that it is bound to happen.  Thus, there almost certainly exist extraterrestrial life forms.  It isn't a matter of if, but of when we find them.

Here's a video of Dr. Carl Sagan presenting a more sophisticated version of this (with actual numbers) to estimate the number of inhabited planets in our galaxy.  Or try this worksheet on the Drake Equation on the BBC website.

It's a common argument.  And it sounds pretty convincing.  If you keep trying over and over, even though something is unlikely, eventually you will succeed.

It's common and convincing, but it's also fallacious.  Here's the problem: How many times do we have to try before we're guaranteed to succeed?

The mathematical answer is infinitely many times.

But that's to guarantee we succeed, with 100% probability.  So a better question might be: what happens to the probability of success as we keep trying?

Let the probability of a success be very low, set to $10^{-X}$, where $X$ is some large number.  This makes $10^{-X}$ a very small number.  Then let the number trials be $10^{Y}$, where $Y$ is some large number.  This makes $10^{Y}$ a very large number.  Now we define a quantity $P_0$, which is the probability of never succeeding, even after $10^Y$ trials.  (If you can't see my math, check your browser's plugin settings)

Assuming whether we succeed or not on a given trial is a simple coin flip with probability $10^{-X}$ of success, then the probability of failure in a single trial is $(1-10^{-X})$.  The probability of never succeeding after $10^{Y}$ trials is just the product
$$P_0 = \left(1-\frac{1}{10^{X}}\right)^{10^Y}.$$

We have said that $X$ is large.  Maybe you remember from algebra learning the formula for continuously compounded interest, where you ended up with an exponential, like so:
$$e^{x} = \lim_{n\rightarrow \infty} \left(1 + \frac{x}{n}\right)^n.$$

Well, in our case, if $X$ is large, then $10^{X}$  is really large, and
$$\left(1 + \frac{-1}{10^{X}}\right)^{10^X} \approx e^{-1} \approx 0.36788$$

If we re-write our expression for $P_0$, then, we find
$$P_0 = \left(1-\frac{1}{10^{X}}\right)^{10^{X + Y-X}} = \left[\left(1+\frac{-1}{10^{X}} \right)^{10^X}\right]^{10^{Y-X}} \approx = \left[e^{-1}\right]^{10^{Y-X}} = e^{-10^{Y-X}}.$$

Now, $e^{-1} \approx 0.36788$ is less than one, so squaring it or tripling it will make it even smaller.  However, taking the square root of it will make it larger.  The resolution comes down to: how does $X$ compare to $Y$?

Consider a simple case, where $X=Y$.  Then $10^{Y-X} = 10^0 = 1.$  So $P_0=e^{-1} = 0.36788.$  That is, there is only about a 37% chance of there being no successes, or in other words, there is a 63% chance of a success happening at some point.  It's not a guarantee, but it's more likely than not.

Now suppose that $Y = X+1$.  This means that we do ten times as many trials as our inverse probability; if the probability is a 1/10, do 100 trials, if the probability is 1/2, do 20 trials, etc.  Then $10^{Y-X} = 10^{1}= 10$, so $P = e^{-10} = 0.0000454$.  That is, the probability of success is 99.995%.  As we increase $Y$, this probability gets even closer to 100%.  Success is all-but guaranteed.

However, now suppose that $Y = X-1$.  This means that we only do a tenth as many as the inverse probability; if the probability is 1/10, do 1 trial.  If the probability is 1/20, do 2 trials, etc.  Then $10^{Y-X} = 10^{-1} = 0.1$, so $P_0 = e^{-0.1} = 0.9048.$  That is, the probability of success is down to a measly 9.516%.  As we increase $X$, this number gets even closer to 0%.

As we can see, our confidence of success depends drastically on the value of $Y-X$.  Even slight differences here can mean huge changes in the probability of success, $P_{\geq1} = 1-P_0$.

Simple graph showing the steep rise from 0 to 1 in the probability of success.

What this comes down to is whether $X$ is greater than or less than $Y$.  Put differently, does the probability of a single success compare to the number of trials?  Or put in terms of aliens, is the number of planets out there that can give rise to life close to the inverse of the probability of life actually arising?

And the answer is: no one knows!

We do not know how many planets there are.  If we estimate this as $N_p = 10^Y$, then $Y$ might be off by 2 or 3 in either direction.  There might be a thousand times as many as we think now, or there might be only a hundredth of our current guess.  As we just saw, for a fixed $X$, changing $Y$ even by 1 can drastically affect our confidence of extraterrestrial life existing.

Way more crucially, we have no idea how likely it is for life to occur on a planet that can give rise to life.  Think about this.  We have only ever observed life arising on a planet once.  This means that we don't have a very good definition of a planet where life can arise (see above), but it also means that we have a single data point upon which to base a probability.  If I were a pollster, and I went out on the street and asked a single person who they were voting for, and from that concluded that 54\% of voters supported the candidate, you would rightly question my methodology.  If we estimate this probability of life arising on a planet as $p_L = 10^{-X}$, then we don't even know what $X$ is.

Since we do not know what $X$ is, then we don't know what $P_{\geq 1}$ is.  This is a simple model, but it makes its point: Even small differences between $Y$ and $X$ can lead to very different predictions.

Consider again what it would mean for $Y=X-1$.  Take $10^Y$ to be the total number of planets what ever exist or will exist in our universe's lifetime.  Take $10^{-X}$ to be the probability of life ever arising on any given planet in our universe other than our own.  Then if $Y = X-1$, as above, we have $P_{\geq1} \approx$ 10% as the probability of extraterrestrial life ever arising in this universe.  This means that we'd need roughly 10 other universes just like our own before we can be back at roughly 63% probability of life arising again.

The popular statement that the universe is so big that there must be life in it somewhere is a false one.  The universe is quite big, but the probability of life arising can also be so small as to negate this bigness, and we have no way to know if this is the case or not.

The universe can still be as big as it is, and yet still not be big enough for life to arise anywhere else within it.

Saturday, March 21, 2015

Faeries in Phase Space

A few weeks ago, Professor Ben Zuckerman spoke at my school. He is one of the editors of the popular book "Extraterrestrials: Where Are They?" which explores in part the Fermi paradox: Why haven't extra-terrestrials tried to contact us yet? While he gave two lectures, I only attended one, where he went over many of the ideas in his book, explaining the rarity of technological life and the improbability of us ever making "contact".

I went to the colloquium talk rather interested. In honesty, I kind of misunderstood the intention of the talk (I thought he was going to be arguing against the existence of extraterrestrial life), but I was not disappointed. There were a lot of interesting ideas brought up about how to make contact or about what sorts of development projects we should pursue. And while I think some of them were really bad, they were thought-provoking. (Dr. Zuckerman of course recognizes the flaws of these, saying they are just stage 1 prototype designs).

The talk was very well done and I won't touch on it too much. What I really wanted to address was an audience question asked by one of the professors at my university. First let me provide some background.