I don't post every day, so the best way to not miss anything is to subscribe by email

Understanding the physics of a pendulum


You've probably seen a pendulum swing, but have you ever thought about why it is that a pendulum swings at all? Further, why is it that a pendulum only swings for some period of time becoming motionless? It turns out, a simple pendulum is a great means through which we can develop intuition about the conservation of energy and the relationship between gravitational potential energy and kinetic energy -- not to mention oscillations.

Consider a pendulum of mass $m$, attached to a point of rotation by a massless string of length $L$. Physicists call this a simple pendulum because we are making a simplification by ignoring the mass of the string.

The pendulum begins in an initial state:






And at some point, for the sake of this analysis, it reaches a state mid-swing, which we'll call the final state:




Do not be confused by the use of the word "final" here. This is not the final state of the pendulum's swinging motion. It's true final state is zero motion. Rather by final state, we mean the state of the pendulum after some time has elapsed from the initial state. We are free to choose any initial and final state we want. However, as you'll see, I've chosen these states for a very specific reason -- it will make our analysis easier, and in fact, give us more meaningful information. I encourage you to try this by defining different initial and final conditions, however.

From the conservation of energy, we know it must be true that:
$$E_i = E_f $$
Where, $E_i$ is the initial total energy of the pendulum and $E_f$ is its final total energy.

We can describe $E_i$  and $E_f$ more specifically, in terms of  kinetic energy $K$ and potential energy $U$. Therefore, we can write:

$$E_i = K_i + U_i $$
$$E_f = K_f + U_f $$

Consider the definitions of $U$ and $K$.

$$U = mgh $$
Where $m$ is mass, $g$ is the gravitational acceleration with value $9.8 \frac{m}{s^2}$, and $h$ is height.
$$K = \frac{1}{2}mv^2$$
Where $v$ is velocity.

Now, here's the trick. When using the conservation of energy to analyze a phenomenon, it can be in our best interest to choose our initial and final conditions such that they make the math simpler. If we look carefully at the initial and final conditions, we'll see that $K_i =0$ because the initial velocity has been chosen such that it is at a point in time when the pendulum has zero velocity. We don't know the exact time when this is true, but we know from watching a real pendulum that it will swing up to some max height, at which point it will begin to swing back down. For some instantaneous time, its velocity must be zero. Meanwhile, we also know that $U_f=0$ because we've defined the final condition at a point in time when the pendulum has zero height. As a result, the conservation of energy says:

$$U_i = K_f$$
$$mgh = \frac{1}{2}mv^2$$

The next problem that must be solved is determining the height $h$ of the pendulum.





From this diagram, we know that $L = h + z$ and that $z = Lcos\theta$. We can write the height $h$ as:

$$h = L(1-cos\theta)$$

Referring back to our conservation of energy statement, it follows that:

$$gL(1-cos\theta) = \frac{1}{2}v^2$$

Consider the velocity $v$. This is a special type of velocity because of the semicircular motion the pendulum traces out as it swings.



Indeed, this velocity is a tangential velocity $v_t$. And we know that $v_t = \omega R$, where $R$ is the radius of the circle and $\omega$ is the angular velocity. In this case, $R = L$.

We can re-write our equation as:

$$gL(1-cos\theta) = \frac{1}{2}\omega^2L^2$$

Solve for $\omega$:

$$\omega = \sqrt{\frac{2g}{L}(1-cos\theta)}$$

If we remember that $\omega = 2\pi f$, then we can develop some intuition for what this equation means. It tells us that the motion of the pendulum has a frequency $f$ associated with it. This knowledge combined with our understanding of the relationship between kinetic energy and potential energy suggests that its motion has an oscillation-like nature. Remember: the total energy of a particle consists of kinetic and potential energy. When one increases, the other decreases, and vice versa.

The pendulum swings back and forth, with each swing its gravitational potential energy converted to kinetic energy. In a perfect vacuum, this swinging motion would continue forever. However, on earth -- and in any room with air -- some of the kinetic energy is lost to the surrounding air, as the pendulum collides with air molecules and transfers some of its energy to those molecules. This explains why the pendulum gradually loses height after each period of swinging.

Imagine our pendulum swinging back and forth. At the beginning of each fall, the pendulum has some amount of potential energy; it is converted entirely to kinetic energy and moves downward. But not all of that kinetic energy is returned to potential energy because it is transferred in those collisions with air molecules. As a result, at the end of its upswing, the pendulum reaches a lower height. Some of the motion of the pendulum has been given to the air molecules, so the pendulum is less energetic overall.  This leaking of energy to the surrounding air continues with each period of swinging. Given enough time, the pendulum runs out of energy and becomes motionless.

Without considering the surrounding air, it looks like the energy has disappeared and the conservation of energy has been violated. But it is not so: the energy has been conserved -- it has been transferred outside of the system of the swinging pendulum.

Perhaps a question has entered your mind: how does the height  that the pendulum is dropped from relate to its speed and kinetic energy?

Using just the first two terms of  the Taylor series expansion, we can approximate $cos\theta$ as:

$$ cos\theta = 1 - \frac{\theta^2}{2} $$

Remember, this is an approximation, as we are removing many of the terms from the Taylor series expansion. However, if we use this value and plug it into our equation, we find that:

$$\omega = \theta \sqrt{\frac{g}{L}}$$

The angle $\theta$ is directly related to the height $h$. The greater its value, the higher the pendulum starts its swinging at. This means the greater height from which we drop the pendulum, the greater its frequency of swinging. Further, because the angular velocity $v_t = \omega R$, the initial kinetic energy of the pendulum is greater since it depends on velocity.

As you can see, the pendulum is a fantastic model for understanding the conservation of energy, the relationship between gravitational potential energy and kinetic energy, and oscillation behavior.

Image courtesy Shareef Jackson

How high up is outer space?




The Kármán line is the altitude of the boundary between earth’s atmosphere and outer space. This $100$  km or $328, 084$ ft. The value comes from Fédération Aéronautique Internationale, and it’s the same value that NASA uses to define the boundary between our planet’s atmosphere and outer space. 

If you’re like me, the highest you've ever been from sea level is around $30,000$ ft to $40,000$ ft, which is the range of altitudes at which most commercial airliners cruise at. 

For some context, the tallest mountain on earth is Mt. Everest, with a peak at $29,029$ ft, measured with respect to sea level.

The boundary between earth and outer space, at $328,084$ ft, is roughly 11 times higher than Mt. Everest, as well as the highest up you’ve probably ever been. Try to picture that for a  moment.




If this picture doesn’t give you some sense of awe, perhaps another way of thinking about it will. Let's think about how much kinetic energy is gained due to the force of gravity at this altitude. After all, if you were to jump from such a height, the gravitational field of earth would impart onto you energy in the form of motion. Gravity would accelerate you to some speed. So, a natural question that arises is, if you were to fall back to earth from the Karman line, how fast would you be moving when you hit the ground? We'll calculate an upper bound on this speed. That is, what is the fastest you would be moving when you hit the ground if you experienced zero air resistance. 

The acceleration of gravity on earth is $g = 9.8 \frac{meters}{seconds^2}$ or $ 21.9\frac{miles}{hour^2}$.

Using one of the kinematic equations, its possible to determine the speed at which you will hit the ground.

$$d = vt + \frac{1}{2}at^2$$

In case you want to work it out yourself, $d$ is distance, $t$ time, $a$ acceleration (in this case $g$).

First, you must solve for the time it takes to fall a distance of $328,084$ ft. It would take you $143$ seconds or about $2.5$ minutes. For each hour, youd accelerate by $21.9\frac{miles}{hour}$ because of gravity.

By the time you hit the ground, youd be moving at a speed of $3,131 \frac{miles}{hour}$.

Again, keep in mind this back-of-the-envelope calculation ignores the effect of drag -- air resistance -- experienced by a falling person. So, you will actually be moving much slower than this, but this gives you some sense of the amount of energy gained from gravity at this altitude. 

So, how high up is outer space? High enough up that if you jumped from there, and didn't experience  air resistance, youd reach a speed of $3,131 \frac{miles}{hour}$. Thats faster than the speed of sound ($767 \frac{miles}{hour}$). If you kept moving at that speed, you could travel from Los Angeles to New York in less than an hour. 

Of course, once you factor in air resistance, you'll find that you reach a terminal velocity. This is a calculation best left for another essay, but it's around half the speed predicted by the model of no air resistance. For some context, competitive skydiver Felix Baumgartner holds the record for terminal velocity reached via skydiving. He reached a velocity of $834 \frac{miles}{hour}$ by jumping from 128,100 ft, about 40% of the altitude of the Karman line.

Human Beings and the Next Revolution: Automation



“Can you believe people actually used to work?”

Some day in the not-too-distance future, people will say words like these.

There is a moment in humanity’s future that is approaching. And in this moment in time, people will no longer have careers or work full-time jobs.

A common thread of argument is that “there will always be work for people to do.” To some degree, this may be true. But such optimism seems misguided if one can envision the potential for intelligent computers to surpass the abilities of mankind in all but few domains. Sure, a niche of humanity will work. But make no mistake, the majority will be unemployed, replaced by machines more efficient than they could ever be.

The problem is that it’s hard to predict what will happen with artificial intelligence, and thus hard to predict how long this moment will last. There are at least two extreme outcomes to consider, and an infinite number of possibilities in between.

We do not know how rapidly artificial intelligence will progress. On one hand, there’s a chance that the time between the creation of the first machine with human-level general intelligence and the singularity will be infinitesimally small. That is, is the rate of advancement in artificial intelligence will be so great that shortly after developing such an AI, that very same AI will begin to make its own advancements with impeccable speed and success. Such an AI might modify itself, leading to a superintelligent being that wrestles control from and enslaves mankind. Clearly, such an outcome is more concerning than the unemployment rate.

Or perhaps we just merge with machines and live happily ever after.

But another real possibility is that we don’t reach such a level in artificial intelligence or biotechnology for a long time. And during that lengthy period of time, we continue to improve current methods of machine learning, computer vision, robotics, and computer reasoning to a point where computers and robots are a cheaper and superior option for most work-related tasks. In some ways, although this scenario is less horror film-esque than the one described above, it’s just as disconcerting because it raises a question: what value will human beings have in such a world?

Simply put, we will need to radically change the way we perceive human value, or we could find ourselves living in a very dystopian reality.

Part of this is dealing with the social challenges that await us. The most paramount of these will be establishing systems that can provide resources to the masses who can no longer reasonably be expected to support themselves. Fortunately, companies like YC are experimenting with approaches to basic income. There is a lot of fear about communism and socialism, but devout capitalists should try to understand that mass poverty and homelessness are the likely alternative. Fortunately, advances in technology also make it more likely that we can provide food, housing, energy, and transportation to people. It is unlikely that technology will be the bottleneck. Rather, poorly designed policies and electing the wrong types of people to positions of power will cause the most friction here.

This coming era can be a high point for humanity. There is a real opportunity to reduce human suffering and free people from something they’ve been chained to: work. Freed from the slavery of having to earn an income, we’d be living in a truly new age — potentially a utopian one. The results of such a thing seem impossible to predict completely, but I look forward to seeing what people can do without such a burden.

I just hope we remain aware of the path we are taking. Now is not the time to misstep.

What's the difference between simple and elementary regions?


Simple regions are a topic that comes up in vector calculus.

First, let's understand the difference between x-simple and y-simple regions. Visually, the Type 1 region seen here is an example of a y-simple region and the Type 2 region is an example of an x-simple region. See any textbook on vector calculus for a formal definition.

But intuitively, a y-simple region is any region of space that can be bounded between two functions y=g1(x) and y=g2(x). If the region requires more than two such functions to bound it, then it’s not y-simple. The same idea applies to x-simple regions, but the two functions are x=g1(y) and x=g2(y).

The idea, really, is a region is simple if you only need two functions to define its boundary.
Now, here's the easy part.

A region is said to be “simple” if it is both y-simple and x-simple.

A region is said to be “elementary” if it is y-simple or x-simple.

Bonus idea: Do you see why this is useful for integration? Integration is defined from point A to point B. If a region is simple it means you can write limits of integration easily; the functions g1 and g2 are the limits of integration.

Source of image used

Complex numbers: the relationship between rectangular form, exponential form, angular notation

Learning complex analysis can be a bit daunting. Not only is this topic filled with abstract ideas, there are a number of equivalent ways of talking about the same idea. For example, there are at least three different forms one can use to represent a complex number. In this video, I explain these different forms, the relationships, and when to use each.