Skip to main content

Demonstrating the benefits of AI in government with the Rubik’s Cube

Posted by: , Posted on: - Categories: Transformation

The world record for solving a scrambled Rubik's cube is 4.22 seconds. But what can this teach us about using AI in government?

Before we explain, let me rephrase the above statement. The human world record for solving a Rubik's Cube is 4.22 seconds, which was set by Feliks Zemdegs in May 2018.

Feliks Zemdegs' Rubik's cube world record

The robot world record is an incredible 0.38 seconds. It was set by a machine built by MIT student Ben Katz in collaboration with software developer Jared Di Carlo. Their machine requires specially adapted cubes, expensive high-speed cameras, and moves so quickly it occasionally makes the cubes explode!

To get a human to solve a cube in a few seconds would take years of dedicated training as they would have to memorise algorithms and learn to be ambidextrous. The best machines in the world are high-cost and fragile. Is there a happy medium to solve a complex physical problem quickly and cheaply?

Yes! We can create a fast and low-cost solution. In a single Saturday afternoon, my wife and I built an elaborate bot using a Lego Mindstorms kit.

Based on the robot developed by David Gilday, ours follows open source principles and the instructions and code are freely available for us to use and adapt. We don't want to be locked-in to proprietary systems, or have to rely on closed standards.

At a recent AI workshop for senior leaders, I challenged participants to solve a cube faster than my robot. People took over a minute to solve a single side of the cube. Our robot solved all six faces of the cube in less than 100 seconds.

The robot is not using machine learning as it does not learn from its mistakes - it cannot be rewarded for good behaviour and it cannot improve upon its pre-programmed algorithms. But it is a cheap training tool to help people understand what government is looking for in AI.

AI within government

Recently, the Department for Transport showed how AI can improve the experience of government services for all users through a cheap and simple AI project which led to a dramatic improvement in the speed and accuracy of their correspondence.  

My robot also helps us demonstrate that computing power is cheap and can readily be applied to many human problems. We can perform complex tasks at a low cost using open source AI solutions. If we want to rent hardware, that's cheap too. We can pay by the minute for high performance resources which only a few years ago would have been ludicrously expensive.

Spreading our AI knowledge

With government releasing increasing amounts of open data it is imperative we have AI systems which can make sense of them. We have a wealth of information which can be released - if only we had the means to process it efficiently.

When inexpensive kit like this can outperform most humans, it's time to realise that AI and robotics are here. We cannot ignore the presence of this technology and we need to make sure that all civil servants understand the benefits and challenges these tools can bring. The GDS Academy is working with departments to develop this shared understanding.

Civil servants also need to understand the limitations of the current state of technology and make sure that they operate with a strong ethical framework. For example, we know that face recognition is often trained on predominantly white male faces and has trouble recognising women and non-white faces.  We must work hard to reduce these biases.

I am fortunate to be part of the first cohort of the Emerging Technology Development Programme being piloted by GDS. Together with my colleague Dr Eloise Taysom, we're touring departments to advise how they can make better use of this exciting technology.

GDS has also published a survey of technology innovation in government, which gives an overview of how government is using emerging technologies to improve our services. Over the next few months we’ll be working with experts from across government, industry and academia to inform a government strategy for the use of innovation in public services.

For more info on our Emerging Technology Development Programme, please contact

Sharing and comments

Share this page


  1. Comment by Marc-Andre Bazergui posted on

    It would have been nice if you gave credit to the creator of this MINDSTORMS robot and software he shares with it. by robotmak3rs' David Gilday

    • Replies to Marc-Andre Bazergui>

      Comment by khidr posted on

      Hi, it was not our intention to leave out a credit. We have now added this in to clarify

  2. Comment by Jerry N posted on

    I've just read this article and watched the video. I feel it is somewhat misleading in the representation of the MindCub3r. One could conclude from this video that the robot was developed in house and that open source software had been utilised to make a Rubik's Cube solver. This is the MindCub3r developed by David Gilday, with no involvement from the government, and should be credited as such.

    • Replies to Jerry N>

      Comment by khidr posted on

      Hi, it was not our intention to leave out a credit. We have now added this in to clarify

  3. Comment by Julian posted on

    Did any discussions or ideas surface on how to safeguard service users from the unintended consequences of decisions made by AI GovTech services? Singapore launched FEAT Principles to promote responsible use of AI in the finance industry. Can public service values be algorithmically baked in? Can they be held accountable by individual citizens?