Tuesday, December 24, 2019

The limits of computing

There is a lot of talk nowadays about the Singularity, the scary rate of development of intelligent machines, and the future of artificial intelligence. I'd like to discuss these concepts from a physics perspective. Some of the interesting questions to me are: how close to the fundamental limit of computation are modern computers? How close is the human brain? If we extrapolate a "Moore's Law" type curve based on energy efficiency arguments, when does it intersect human capabilities?

It is well known that the fundamental thermodynamic limit for how much energy a single bit requires in an information processing system is kBT ln 2. This is known as the Landauer limit. Actually, I lied. Some theorists argue that the Landauer limit can be exceeded, for example by using quantum spin instead of energy as a store of information, or reversible computing. Nonetheless, let's assume that the Landauer limit holds true, and see what this means for the future of computation. As we'll see, theoretical arguments about exceeding it are analogous to discussing what we're going to do with all the excess clean energy. Spoiler alert: we are nowhere near an excess of clean energy and we are nowhere near the Landauer limit.

So first of all: how close are modern computers to the Landauer limit? In other words, how many watts does one bit erasure require, and how close is this to the Landauer limit? Well, the FLOPS (Floating Point Operations per Second) per watt (Joules per second) = 6x10^9 FLOPS/W. Taking the reciprocal, that's 1.7x10^-10 Joules per FLOP. Let's assume that since a floating point number has 32 bits, that we get 5.2x10^-12 Joules per bit in a modern computer. By comparison, the Landauer limit at room temperature (293 K) is: 2.8*10^-21 Joules per bit. In other words, modern computers are using 5.2x10^-12/2.8*10^-21= 1.8 billion times more energy than the Landauer limit. There's a lot of room at the bottom!!! Even the most energy efficient modern computer is horribly inefficient at doing math. An energy analogy would be like if driving 100 kilometers in a car required the entire world's energy supply.

Redoing the above calculation in terms of FLOPS/Watt for the Landauer limit, we get 2.8*10^-21 J/bit*(32FLOP/bit)*/(1W/1J/s)=9*10^20W/FLOPS, or 10^19FLOPS/W

OK so computers are pretty inefficient. What about the human brain? Well, first of all: how many operations does an average brain do? Well, from what I have been able to find, somewhere between 10^12 and 10^28 FLOPS. Yes, you read that right! https://aiimpacts.org/brain-performance-in-flops/ The estimates for how many computations the human brain can do vary more 16 orders of magnitude. That's insane. 16 orders of magnitude uncertainty is the greatest uncertainty I have ever seen. I'm not even going to try to make an analogy for that one because it's too much uncertainty to even comprehend. I think this brings up an interesting point for scientists around the world: come up with a better way to measure human brain performance!

Despite the craziness above, we can put some upper bounds on performance: the Landauer limit! And we know that the brain uses around 20W. So the upper bound for the number of computational cycles of human brain performance (assuming no reversible computing or other fanciness), is 20W/2.8*10^-21 Joules per bit=7.1*10^21 bits/s. Assuming 32 bits/FLOP, that's 2.2x10^20 FLOPS. Breaking news: scientists discover that the human brain has exceeded the Landauer limit! Just kidding. A more likely explanation is that whoever estimated 10^28 FLOPS made some bad assumptions that got them 8 orders of magnitude above the Landauer limit! Or maybe the human brain inherently does reversible computing or something. My guess is that no, it doesn't. So the human brain is somewhere between 8 orders of magnitude less efficient than the Landauer limit, or 8 orders of magnitude more efficient than the Landauer limit. lolz.

OK back to computers. Koomey's Law suggests that the amount of energy per computing cycle doubles every 2.6 years. If that's true, and given that modern computers are at 1.8 billion times the Landauer limit, we'll hit the Landauer limit in t=2.6 * ln(1.8x10^9)/ln(2) = 79 years.

The energy singularity (when computers can do more work per joule than the human brain) will happen around 2045 if the human brain is 8 orders of magnitude less efficient than the Landauer limit, or 2100 if it's at the Landauer limit, assuming that computers continue to double in energy efficiency every 2.6 years. I predict that they won't. I think that the traditional silicon computer will not continue to double every 2.6 years and we'll need a dramatically improved computer architecture. This type of dramatic redesign will slow down scaling to doubling every 8 years or so, which will push the singularity way back in time.

I represented this on a graph:



The biggest sources of uncertainty are: how many equivalent computational cycles does the human brain perform? and how quickly will FLOPS/W scale as the limits of traditional silicon are reached?

A common criticism of this type of thinking is: "but the human brain doesn't work like a computer! it uses neurons and is good at parallel computing and doesn't use 1's and 0's." Response: actually, the brain is like a computer! A biochemical system, like "is ion channel open?" can be thought of like a bit of information. Similarly, a relevant protein expression level or horomone level can be quantized. All the brain chemistry put together can be thought of as a computing machine, and it can be quantified in terms of FLOPS! Just because computers today do very different things than the brain does today, does not mean they obey different physics, just that their hardware architecture is different!

This is a first draft to please let me know what you think, any feedback, any typos, etc, and I'll update it!

Wednesday, August 7, 2019

Tugfest physics


I received a message from a local news TV anchor:

"Hello, I'm with KWQC TV6 in Davenport, Iowa and am working on a story about a popular annual tug of war across the Mississippi River here in our area.  The tug of war involves a rope that is strung across the Mississippi River between one team in LeClaire, Iowa and the other in Port Byron, Illinois. 
I am wondering if you would be willing to provide some of your expertise regarding the impact that the elevation difference between the two locations has on the outcome of the event.  In other words, if one team is at a lower elevation than the other, does that team have an advantage or disadvantage as a result?  If we take the elevation of 587 feet for LeClaire and 604 feet for Port Byron, can you calculate or in some way scientifically express the impact this could possibly have on the outcome of the tug of war?  Thank you."

This message tickled the curious part of my brain. So here's my attempt to answer it:



1) In physics, we often draw a "free body diagram" of all the relevant forces on a system. I'm assuming that the rope does not touch the water. In this case, the forces acting on the rope look like this:




As far as I can tell, there is the force of the pullers in Le Claire (F_LC), the force of the pullers in Port Byron (F_PB) and the force of gravity acting on the rope (F_g). In the game (sport?) of tug of war, the team that moves the rope wins. So the idea is to exert a larger force than the other side. on level ground, gravity effects the rope in such a way that both sides have the same effect. However, in this scenario, the rope will be hanging in such a way that one side will experience a different force than the other.

2) It is a well-known problem in physics that a suspended rope makes a catenary curve: http://www2.mae.ufl.edu/~uhk/HANGING-ROPE.pdf

3) There is a well-known saying in engineering that "you can't push on a rope" and so we can assume it is under tension at all points, and that it doesn't apply much bending force because it's long and skinny and floppy.

4) We can approximate the system as being in static equilibrium. Although technically a tug-of-war cannot be performed without movement (one side has to pull further than the other), we assume that ignoring inertia is OK since the static forces are more important than the dynamics for a tug-of-war.

5) We can imagine a ghost pulling on the rope at a position symmetric to the pullers at Le Claire.





From the ghost drawing, it's clear that the pullers at Port Byron have to overcome some extra forces due to the weight of the rope between the ghost and the Port Byron location. Because gravity pulls vertically, the only difference will be in the vertical component. This is the tiny green arrow in the drawing below:

In other words, the horizontal forces will be identical, but the Port Byron pullers will have to pull slightly harder, because they have an upward component of force also.

Now you are probably wondering: how much more force will the pullers at Port Byron have to apply? Let's guess that the rope angle is ~10 degrees at Port Byron and let's assume they use Manilla tug of war rope. Here (https://www.ironcompany.com/manila-tug-of-war-rope) I found a tug of war rope that claims to be "1 lb per foot", or as the modern world would say "1.5 kilogram per meter". Now at 10 degrees (made up guess for angle), we can calculate the amount of extra rope between the ghost and the Port Byron pullers using trigonometry (ignoring the bending of the rope for this section for now):

sin(10 degrees) = 5m/L_r, where 5m was the difference in elevation between the two locations and L_r is the lenght of excess rope. Solving for L_r we get: L_r=5m/sin(10 degrees) = 28.8m. To get weight of the rope, we multiply: 1.5kg/m * 28.8m = 43.2kg.

So by my estimations, the Port Byron pullers will have to overcome an additional 43.2kg of vertical force, or technically 423N of excess vertical force. That seems like a lot. However, if we consider that the angle differences are pretty small between the two sides, and all that matters is the absolute magnitude of the force. Let's assume that they are each applying 5000N of horizontal force (I just made up a number because I have no idea how many people are expected at the event). Now the Port Byron pullers will have an extra ~430N of vertical force). Their net force vector will be slightly downwards (due to excess gravity on the rope), which when we ignore the 10 degrees and assume the rope is horizontal before applying the gravity correction, we get a magnitude of ~sqrt(5000^2+430^2)= 5018N, or an extra 18N in the direction of pulling. That's less than one percent difference. I think we can safely ignore the difference in physiology between pulling at 10 degrees from horizontal vs pulling at 11 degrees from horizontal. The human body should be able to do each equally well.

With a better estimate of # of pullers, their physical condition, and type of rope, the estimates could be refined.

OK, I just did some research about the event and found something interesting: there is a pulley used!!!



A pulley is a mechanical device that can change the direction that a rope is pulling in. It is still true that Port Byron will have to overcome more weight of rope and thus all things being equal, Le Claire has an advantage. However, the pulley position is incredibly important. An average tug of war participant is limited by their friction on their feet and their ability to grip the rope. If they can grip the rope sufficiently, and pulleys are allowed, and since a pulley redirects forces, it would be advantageous to put the pulley low to the ground so that they are pulling more upwards than downwards. I'm assuming that pullers can theoretically pull some larger than one multiple of their body weight. Ideally, a trench would be dug for the rope and pulley to sit in, so that pullers are pulling at a downward angle, maximizing friction on their feet and overcoming that limitation. If the pulley could be placed at the bottom of a staircase-slope (e.g. cut some steps into dirt), that could be ideal for maximizing friction with the ground for a given pulley system. That, or make a ladder like structure in the ground. I have illustrated this point with two hypotheticals, one where the pulley is placed high up (e.g. on a tree) - the stupid pulley, and one where the pulley is placed near the ground (the smart pulley):



I'm assuming that the weights of the two teams are equal. In that case, to maximize friction, put the pulley close to the ground. If you can choose your team, choose the heaviest people you can. Also, don't put sand in your pulling pit, that will make it impossible to apply large forces. Use a high-friction material. Ideally something like a metal ladder. 

I have one question that could invalidate my analysis: does the rope fully leave the water? If there is any part of the rope touching the water, then water currents will have a big effect on the forces. I assumed that the rope leaves the water surface after it is taught. If the rope stays in the water, then river currents will determine the winner. OK I looked it up: the rope stays in the water: https://www.wsj.com/articles/iowa-cant-beat-illinois-at-cross-river-tug-of-war-no-matter-what-they-pull-1473187822
So forces of drag from the river currents need to be taken into account. First of all, let's see if either of the locations looks upstream with respect to the other. Well, from a google map search I think it looks like Le Claire is down-river from Port Byron.




So in my assessment, Le Claire has the theoretical advantage in every respect: they have a lower elevation pulling platform, and most importantly, they are downriver.

OK I just found out something ridiculous. The winner is determined by who pulls more slack out of the water?!?! https://qctimes.com/community/bettendorf/port-byron-pulls-out-another-win-at-tug-fest/article_2311b1cd-990a-5d8b-8228-73a60b16ff44.html
So this is not really a tug of war at all. It's a competition to see who can leave their rope with more slack in it before they start pulling. Probably the team with the higher platform will win if all you are measuring is who can pull more slack out of the rope, when river currents is working to pull it back down. So I think that the winning streak of Port Byron could be due to their elevated platform, which allows them to pull more slack out of the rope in a river. It has nothing to do with pulling harder than the other team. Is Port Byron really 5 meters higher? From the images I saw online it doesn't look like that much... On that subject, I'm not sure where the host got the elevation numbers. Maybe from some random point in the towns? Also, what is the elevation of the pulling platforms with respect to river level?

In conclusion: Le Claire has a theoretical advantage in a true tug of war. However, because Tugfest is a "who can pull more slack out of the water" contest and not a true tug of war, Port Byron has an advantage because an elevated platform will have more slack between loose and taught rope conditions. This analysis is based on the numbers provided to me that Port Byron has a 5m taller platform. I'm not sure that's accurate!!!

If you have additional ideas to improve the estimates please leave them below!