Bezoek de website voor leraren en scholieren →

One of my biggest pleasures in life is to watch my children learn things that we take for granted. Some months ago my daughter learned the skill of jumping. Recently, she started a new game to improve this skill. She climbs on the couch, throws one pillow on the ground and then tries to jump on it. This game of trying to land properly on that pillow seems to be an interesting and most challenging task that she engages with a devotion of a professional athlete.

I asked myself how to teach a machine to do this. I do not want to give the computer the first principles from physics as a formula to solve. He should learn it from empirical data. In the following animation, you see a very easy approach to do this.

I have implemented the mechanics of jumping, better say falling, and let the computer try to land on the pillow until he succeeds. Once he succeeded in landing, he is done. He found a solution to the problem that I have posted. My daughter would now vary the distance between couch and pillow and continue to see how the required speed changes (and how far she can push it). Doing that with a computer would however needs some math, which my daughter and I want to avoid (We would need to suggest a functional form between distance and required speed.).

Instead, let us discuss a game that she will most likely pick up in about 4 months. In this game we can see a central aspect of this machine learning. We try to throw some toy on the table with the goal that it lands and stays on it. With my limited parental power I will not be able to stop this from happening, but I should at least be able to convince her of using something soft. For the throw she will have to decide on the distance from the table, as well as the speed and angle of the throw. Let the computer try this game.

Here the computer just takes random values for the three unknowns and repeats until he succeeds in landing. Just observe and see how long it will take him to find a solution. For a computer this endless trial-and-error is fine. We  humans understand that this is not the best approach. What would we do differently?

The algorithm above simply checks whether it was a failure or a success. After a failure he simply starts from stretch. We intelligent beings would try to learn from past experience to get better over time. Let us use experience: we take the best of the earlier attempts and take it as starting point for the next attempts. This creates the huge problem: how to decide which failure is better than others. This is one of the biggest problem for AI and machine learning: what is a good failure? For our game we simply take the one that came closest to the table top and perturb its parameters for the next try slightly.

After some time the solution will be found. Without computations on our side! The power of this approach is that we can use this idea for all kinds of problems. Further, we can easily modify and implement a new problem and find a solution to this new setting. One of the major problems is that we need to recognize a good failure to be able to improve this solution. Playing with the animation above we find two problems that take incredibly long to overcome. Firstly, when we bounced from the underside of the table top, we have found a solution that was very close to the goal on top of the table top and will use as best failure. As we then start from this failure we will spend a long time seeing only bounces. Secondly, if our best failure was a very flat throw that passed just over the table top, it will also require a long time to find a solution. This is part of the central problem of finding a good failure, that can be used to find a solution quickly.

Once we have found a solution, we can continue to use our problem solving machine to find more different solutions and compare them and look for an optimal solution. As a very last example let us try to find the solution that requires the solution with smallest possible energy, so speed of the throw.

What we just saw was a basic example of weak artificial intelligence (AI) used in machine learning. This AI is designed to solve one specific kind of problem and is good as a first example. More complex problems require more complex AI/programs and additional ideas, but the basic idea is the same. Trial and error with a combination of learning from experience and data.

All animations are under creative commons license and we invite everyone to use them in any education/academic and non-commercial contexts. All animations are written in JavaScript and the source can be easily downloaded to be reviewed and modified under the restrictions just stated.

Featured Image by Farzad FARID, found on flickr under CC BY-SA 2.0 licence.

  • Article

    Enigma: a complexity titan••

    In times of war, secure communication can be the difference between life and death, or even winning or losing a war. The first to patent a rotor machine in Europe was Arthur Scherbius in 1918. Scherbius’ version of the rotor machine became a commercial success, unlike the other patented machines. Scherbius named his machine Enigma.
    Read article
  • Article

    Reading mathematics in Braille

    Have you ever wondered how people with a severe visual impairment practice and understand mathematics?
    Read article
  • Update

    Brouwer medal to David Aldous••

    On the 6th of April David Aldous received the Brouwer Medal 2020 for his contributions to probability theory. 
    Read article
  • Article

    AI thinks my dog is a Pig! Want to know why?••

    Applications of machine learning models are everywhere, with many online platforms and major science fields using tools relying on machine learning. Take, for example, image recognition and computer vision. But did you know that the results of supposedly perfect and accurate machine learning models can be deceived by slight perturbations in the data?
    Read article
  • Article

    Trust and other wonderful mistakes humans make

    Trust is required when we buy a used car from a personal connection or via-via. When we vote for a politician we trust that they will act in our favour. In this article we will explore how Game Theory is used in attempts to model trust and cooperation.
    Read article