Are wheels optimal for locomotion?

Given the large number of wheeled robots coming out of modern factories it’s natural to ask whether wheels are near-optimal for terrestrial locomotion. I believe this question may be partially addressed from a physicists’ perspective although the general problem of finding near-optimal robot models appears to be intractable.


A reasonable scientific approach to this problem would involve a laboratory setting of some sort. The scientist may setup an inclined ramp and analyse the rolling motion of different compact shapes with the same mass and volume. In particular it’s natural to ask: Of all the possible shapes having the same material, mass and volume which shape reaches the bottom of the ramp first when released from the top of the ramp?

If we may neglect dissipative forces, we may determine the time for a disk to reach the bottom of the ramp as follows:

  1. By the parallel axis theorem, we have:

    \begin{aligned} \dot{w} = \frac{\tau}{I}=\frac{mgrsin\theta}{0.5 m r^2} \end{aligned}

    where \theta is the ramp’s angle of inclination, m is the mass of the disk and r is the radius of the disk.

  2. As a result, the linear acceleration of the disk is constant:

    \begin{aligned} \ddot{x}= 2gsin\theta \end{aligned}

  3. From this we deduce that given a ramp with length l , the total time to reach the bottom of the ramp is given by:

    \begin{aligned} T = 2\sqrt{\frac{l}{gsin\theta}} \end{aligned}

This analysis, although useful, is difficult to replicate for other shapes as the moment of inertia will actually depend on the axis chosen. Further, beyond the special case of certain symmetric bodies the total time taken to reach the bottom of the ramp can no longer be determined in an analytic manner. Barring a mathematical method I’m unaware of, we would need to simulate the motion of each body rolling/bouncing down the incline with high numerical precision and then perform an infinite number of comparisons.


At this point it may seem that our task is impossible but perhaps we can make progress by asking a different question…Of all the possible shapes that move down the incline, which have the most predictable and hence controllable motion? The answer to this is of course the spherical bodies(ex. the wheel) and it’s for this reason that engineers build cars with wheels to roll on roads. A different shape that reached the bottom of the incline sooner than the wheel would be useless for locomotion if we couldn’t determine where it would land. For these reasons, our mathematical conundrum may be safely ignored.

In contrast, as natural terrain tends to be highly irregular, animal limbs must be highly versatile. I have yet to come across wheels that simultaneously allow grasping, climbing, swimming and jumping. Furthermore, even if there were a large region of land that was suitable for wheeled locomotion, these animals would inevitably be confined to this region and this situation would be highly detrimental to their ability to explore new terrain.

Given these arguments, it’s clear that wheeled robots aren’t well suited for terrestrial locomotion. Having said this, can we build robots that are near-optimal for terrestrial locomotion? What would we mean by optimal?


I have thought more broadly about the possibility of using computers to design near-optimal robots for terrestrial locomotion but the problem appears to be quite hard. Given that the cost function isn’t well-defined the search space will be very large. It would make sense to place a prior on our cost function and try to use a method similar to Bayesian Optimisation. However, the task entails a method much more sophisticated than the Bayesian Optimisation methods that are used in industry today.

I’ll probably revisit this challenge in the future but I think it would make sense to first solve an intermediate challenge in Bayesian Optimisation applied to robotics.


The case for compulsory public service

It occurred to me recently that as citizens we seldom discuss the requirements of a healthy social fabric which is essential for a democracy. We somehow expect miracles from our governments while the most we expect from ourselves as citizens is to vote every four years and pay our taxes.The working assumption is that improving a democracy is either impossible or the job of politicians. Everybody else can just chill back and watch Netflix videos. I’m not sure this can continue.

Perhaps it’s unfair to use the term ‘everybody’. After all a significant fraction of the US and UK population volunteer in some form at least once month. However, this fraction is still smaller than 30% in both the UK and USA. What if less than 30% of the population paid taxes?

At this point, you might wonder what difference can volunteering make? I’ll get to that point but first allow me to share an observation I’ve made while visiting many small towns around Britain.

In each town I would talk to people of all ages including elderly British people who would invariably complain about how the internet has changed their community. A particularly pernicious consequence of the internet culture is that it has allowed society to become transactional to the detriment of important social bonds. Where in the pre-internet era there might have been lively conversations between shopkeepers and customers, today people might get whatever they need on Amazon or have their supermarket goods home-delivered.

This results in social fragmentation which makes the notion of ‘shared values’ farcical. As a result, the populations of Europe and the USA are not only socially stratified in the present, but their future expectations of society are that socioeconomic divisions will deepen. Now, I believe that community service can offer an important partial solution to this problem. In particular, I believe that weekly community service should be a precondition for citizenship.

Personally, I’ve been helping kids learn programming for free at Prewired on a weekly basis but that’s just one way of building a sense of community that isn’t socially stratified in its outlook. I think a lot more needs to be done and the only way for a sense of community to be restored within cities is if every citizen acknowledged the importance of volunteering once a week within their community.

I understand that a lot of people will try to resist this idea. Many will complain that they are too busy. People will try to find all sorts of excuses and argue that there are bigger issues. It’s my fear that people will look for excuses until Western democracies become polarised beyond repair.

Note: I have a lot of respect for the DiEM25 movement led by Yanis Varoufakis and it’s my belief that community service is a necessary complement for this ambitious agenda.

Democracy 2.0

September 11 was a global disaster by any measure. While it cost Al Qaeda half a million dollars to plan and execute this mission, the combined response of the US military and Homeland security exceeded 3 trillion dollars. That 6 million to 1 cost-benefit ratio captures the asymmetric nature of the Western ‘war on terror’ very well.

However, the profound psychological impact of terrorism is much more clearly reflected by the growing populist movements in Western Europe and the USA which have chosen muslim immigrants as the perfect scapegoat. As much as I would like to understand the real problems faced by those backing Le Pen and Trump it’s clear that the populist ‘solution’ will only increase the probability of homegrown terrorism. Hereon, my intention is to analyse these problems and present a solution.

The underlying problems:

First, I must say that war is probably the dumbest possible solution to a very complex problem. Second, the current efforts to monitor homegrown terrorism won’t solve the underlying problem which is that the social fabric in Western countries is broken both socially and economically. While a democracy needs a strong middle class and citizens that have shared values, in Western countries both of these pillars are in peril today.

A foolish resistance:

In the USA, the symptoms of a broken social fabric can’t be made clearer by a ‘Resist’ movement, led by well-off intellectuals and businessmen, which defines itself by vilifying Trump supporters. No doubt globalisation and technological unemployment are playing an important role in this socioeconomic divide and it’s only by addressing these underlying problems that we shall find a solution. Amplifying deep socioeconomic divisions via virulent rhetoric, as practised by the ‘Resistance’, will only lead to greater social unrest.

DIY weapons of mass destruction:

Meanwhile, the risks posed by important social unrest are growing as the development of DIY bioweapons becomes easier with each passing year. In 2016 alone, France had more than 10 terrorist attacks. Most of these involved knives but what if biological weapons were used instead? Furthermore, if we consider the number of mass shootings in the USA every year, it’s clear that the threat isn’t strictly Islamist in nature.

As technology becomes more powerful it also leaves a smaller margin for human error. While a knife might allow a person to harm a few others, a bioweapon can potentially allow a few people to eliminate an entire ethnic group, effectively committing genocide. Moreover, due to the dual-use nature of these technologies we can’t ban their development and for this reason we must work seriously towards greater social cohesion. We don’t have another option.

Democracy 2.0:

After thinking carefully about these problems, I propose the following:

  1. Negative income tax: this would address the problem of economic inequality posed by technological unemployment.
  2. Compulsory public service: this would address the problem of a decaying social fabric.

The first solution might seem self-explanatory but the second solution occurred to me empirically, while visiting small towns around Britain. In each town I would talk to shopkeepers who would invariably complain about how the internet had a negative effect on their business. However, a more pernicious consequence of the internet culture is that it has allowed society to become transactional to the detriment of important social bonds. Where in the pre-internet era there might have been lively conversations between shopkeepers and customers, today people might get whatever they need on Amazon or have their supermarket goods home-delivered.

While we expect miracles from our governments the most we expect from ourselves as citizens is to vote every four years and pay our taxes. Clearly, this can’t continue. If everybody volunteered an hour or two every week for community service, we could rebuild an important sense of community, and therein lies the solution. Personally, I’ve been helping kids learn programming at Prewired on a weekly basis but that’s just one way of building a sense of community that isn’t socially stratified in its outlook.


Finally, I’d like to emphasise that it’s definitely within our ability as humans to solve these problems and I believe that these challenges will ultimately drive us to build stronger communities and become better people.

Note 1: If you consider my message important, please share it with your friends and colleagues, either by sharing my post or your version of it.

Note 2: I think that in order to address these issues we’ll have to work collectively, as humans, to address these considerable challenges in an intelligent manner.

Learning integer sequences

Last Friday night I had the chance to watch the 2011 presentation of Demis Hassabis on ‘Systems neuroscience and AGI’ which I found fascinating. One of the intermediate challenges he brought up around the 33.40 minute mark was the problem of predicting the next term in an integer sequence. Given my math background, I thought I’d take a closer look at this problem.

Fanciful arguments:

On the surface this problem appears attractive for several reasons:

  1. It appears that no prior knowledge is required as all the data is contained in the n visible terms in the sequence.
  2. Small data vs Big data: little data is required in order to make reasonable prediction.
  3. It connects machine learning with data compression. In particular, it appears to emphasize the simplest algorithm(i.e. Ockham’s razor).

I shall demonstrate that all of the above preconceptions are mainly false.  Before presenting my arguments, I’d like to point out that there is a Kaggle competition on integer sequence prediction based on the OEIS dataset. However, I’d take the leaderboard with a grain of salt as it’s very easy to collect the sequences from the OEIS database and simply run a pattern-matching algorithm on the set of known sequences.

Examples of sequences:

Assuming that possible integer sequences are of the form (a_n)_{n=1}^\infty,a_n \in \{0,1,2,...,9\}  , here are some examples:

  1. Fibonacci numbers: 0,1,1,2,3,5…
  2. Collatz sequence: 0,1,7,2,5,8,16,3,19,6…number of steps for n to reach 1 in the Collatz process.
  3. Catalan numbers: 1,1,2,5,14…where a_n = \frac{1}{n+1}{2n \choose n}
  4. Khinchin’s constant: 2,6,8,5,4,5…base-10 representation of Khinchin’s constant

These four sequences come from the areas of basic arithmetic, number theory, combinatorics and real analysis but it’s possible to construct an integer sequence from a branch of mathematics that hasn’t been invented yet so the space of possible integer sequences is actually quite large. In fact, the space of computable integer sequences is countably infinite.

Bayesian inference:

I’d like to make the case that this is actually a problem in Bayesian inference which can potentially involve a lot of data. Let me explain.

When trying to predict the next term in an integer sequence,a_{n+1} ,  what we’re actually trying to discover is the underlying number generator and in order to do this we need to discover structure in the data. However, in order to discover any structure in the data we must make the strong assumption that the data wasn’t generated in a random manner. This hypothesis can’t be justified by any single sequence.

Moreover, assuming that there is structure, knowing the author of the sequence is actually very important. If the sequence was beamed to my mobile phone by friendly aliens from a distant galaxy, it would be difficult for me to guessa_{n+1}  with a better than chance probability of being right whereas if the sequence was provided by the local number theorist my odds would be slightly better. The reason is that my prior knowledge of the number theorists’ mathematical training is very useful information.

A reasonable approach would be to define a program that returns a probability distribution over at most ten sequence generators which generate distinct a_{n+1}  conditioned on prior knowledge. The hard part is that the body of the program would necessarily involve an algorithm capable of learning mathematical concepts.

Randomness and Data compression:

At this point someone might try to bring up a clever argument centred around Ockham’s razor. Now, I think that such an argument definitely has some merit. As a general rule it’s reasonable to assume that the sequence generator can be encoded in a language such that its description in that language is as short or shorter than the length of the sequence. Further, if we assume that the author is an organism they are probably highly organised in a spatial and temporal manner. In other words, it’s very unlikely that the sequence is random.

However, this doesn’t constrain the problem space. The necessary and sufficient general approach would be to use an AGI capable of abstract conceptual reasoning beyond that allowed by current machine learning algorithms. This is the only way it could possibly learn and use mathematical concepts. Good luck building that for a Kaggle competition.


The main lesson drawn from this analysis is that in order to make measurable progress in the field of machine learning it’s very important to choose your problems wisely. In fact, I think it’s fair to say that choosing the right machine learning problems to work on is at least as important as the associated algorithmic challenges.

Note: It’s not surprising that nobody is prepared to offer money for such a competition. What I do find surprising is that some have tried to make ‘progress’ on this challenge.

The flatmate conjecture

In the summer of 2015, I had the wonderful opportunity to do research on algorithms that could automatically analyse C. Elegans locomotion. I found a short-term lease for a flat in the Marchmont area of Edinburgh and the whole experience promised to be amazing except for the fact that I didn’t know who I was going to be living with in Marchmont.

Previous flats I’d lived in started fine but flat duties weren’t clearly defined so common goods like the Hallway or Kitchen were eventually neglected. From my conversations with other students, zero flat management is the default option and this inevitably leads to frictions among flat members. For this reason, I wanted to make sure that this time would be different.

Within a couple days I got to meet the three other tenants. Unlike me, they were all PhD students doing research in the areas of Geophysics, Sociology and Philosophy respectively. At first, their relative seniority made the proposals I had in mind seem less likely to succeed. Nevertheless, I offered to make dinner on Thursday night so we could get to know each other better. At this they all agreed.

Everything went well on Thursday evening. I learned that two of the PhD students were trained at ENS and had a French background like myself. The other was a Briton doing research in Philosophy and that evening we had a great time talking about a variety of topics ranging from Mergers and Acquisitions to melting glaciers in the Himalayas.

Now, when dinner was over I explained that we should probably work together to make sure that the flat stayed in good condition. I brought up the subject of a cleaning rota, a flat treasury and the importance of maintaining regular communication in order to avoid frictions which could be achieved by a dinner rota. It wasn’t rocket science but the important part was to make it clear that this system was designed with our common interests in mind. This was followed by a brief discussion of dietary requirements but on the whole everybody agreed that my proposal was a good idea.

Over the weekend I shared my plan with other friends who were in Edinburgh that summer and received interesting responses. Some said it was a bit radical to impose something so rigid on other people and that I shouldn’t expect society to conform to my mathematical frame of mind. Others said that it was a good idea but they doubted it would last more than one week. However, when I pressed them to tell me whether they have actually tried to implement such a simple system none gave me a positive response. I believe this is a very important point. Many people who tell you that X will fail actually have zero experience implementing X.

On the whole, this flat system actually worked out very well. Barring two occasions, every Thursday a different flat member would cook dinner. There was never a problem with deciding who had to buy a basic necessity because our simple treasury system meant that there was always 20 pounds at the beginning of each month to buy light bulbs, sponges…etc. and we never had any problems coordinating what had to be cleaned. This flat experience was without precedent and it meant that each flat member could focus on doing research without dealing with unnecessary frictions.

Now, it’s my final year of university and I can say that I haven’t had a negative flat experience since then. More importantly this experience taught me that social problems can have precise solutions if we are willing to think about them precisely.