Will a computer ever compose a symphony, write a prize-winning novel, or paint a masterpiece? And if so, would we be able to tell the difference? As humans, we have an extraordinary ability to create works of art that elevate, expand and transform what it means to be alive. Yet in many other areas, new developments in AI are shaking up the status quo, as we find out how many of the tasks humans engage in can be done equally well, if not better, by machines. But can machines be creative? Will they soon be able to learn from the art that moves us, and understand what distinguishes it from the mundane? In The Creativity Code, Marcus du Sautoy examines the nature of creativity, as well as providing an essential guide into how algorithms work, and the mathematical rules underpinning them. He asks how much of our emotional response to art is a product of our brains reacting to pattern and structure, and exactly what it is to be creative in mathematics, art, language and music. Marcus finds out how long it might be before machines come up with something creative, and whether they might jolt us into being more imaginative in turn. The result is a fascinating and very different exploration into both AI and the essence of what it means to be human.