Chapter 1
When Algorithms Dream: The Quest for Creative Machines
What if a machine could compose music that moves you to tears? Or paint a portrait that captures the essence of human emotion? In 2016, the world watched as DeepMind's AlphaGo defeated 18-time world champion Lee Sedol at the ancient game of Go-a feat many experts believed was decades away. This wasn't just another computer victory like Deep Blue's chess triumph; it represented something far more profound. AlphaGo made moves no human would consider, yet they proved brilliant. Move 37 in the second game was so unexpected that commentator Fan Hui exclaimed, "It's not a human move... So beautiful." We were witnessing not just computational power, but something that looked remarkably like creativity.
In "The Creativity Code," Oxford mathematician Marcus du Sautoy explores the frontier where algorithms and human creativity intersect. The book has become required reading in AI ethics courses at leading universities and was named one of Bill Gates' top five books of 2019. Du Sautoy's investigation comes at a crucial moment when AI systems like DALL-E and ChatGPT are challenging our assumptions about what machines can create, forcing us to reconsider what makes human creativity special-and whether it might be more algorithmic than we care to admit.
Chapter 2
The Lovelace Test: Can Machines Truly Create?
Ada Lovelace, often credited as the first computer programmer, declared in the 1840s that machines could never "originate anything" but could only perform what humans ordered them to do. This limitation became computer science dogma for generations. But recent shifts from top-down to bottom-up programming have changed everything. Modern machine learning allows algorithms to chart their own paths, making surprising discoveries in medicine and finance. Yet creativity-that uniquely human ability to imagine, innovate, and create art-remains the final frontier.
What exactly is creativity? At its core, it involves producing something new, surprising, and valuable. When I made my own mathematical breakthrough, discovering a new symmetrical object that connected to number theory in unexpected ways, I experienced what philosopher Margaret Boden calls "exemplary originality"-an original act that inspires others.
Boden identifies three types of creativity: exploratory (extending boundaries within existing rules), combinational (fusing different constructs), and transformational (game-changing innovations that break rules). Exploratory creativity, which accounts for about 97% of human creativity according to Boden, involves pushing boundaries while adhering to established rules-like Bach exploring tonality or mathematicians classifying symmetry groups. This form seems particularly well-suited for computers, which excel at extensive calculations and pattern recognition.
The romantic myth of the isolated creative genius receiving divine inspiration doesn't hold up to scrutiny. While artists from ancient Greek poets to mathematician Ramanujan have attributed their creativity to supernatural sources, creativity follows logical patterns even when creators can't articulate them. Innovation typically emerges from collective intelligence rather than isolated inspiration-what Brian Eno calls "scenius" rather than genius.
Can creativity be taught, programmed, or learned as a skill? From my experience teaching mathematics PhD candidates to create new mathematical constructs, training and problem-solving provide necessary foundations, but the creative leap isn't guaranteed for everyone. The distinction between "psychological creativity" (novel to the individual) and "historical creativity" (novel to humanity) helps frame how personal creative acts can eventually lead to historically significant innovations.
Chapter 3
When Machines Play Games: AlphaGo's Creative Breakthrough
Mathematics shares much in common with games, particularly Go-an ancient Chinese board game of extraordinary complexity. Unlike chess, which was conquered by computers in 1997 when Deep Blue defeated Garry Kasparov, Go presented a far greater challenge that many mathematicians believed computers could never master. While chess relies on logical, analyzable structures, Go requires pattern recognition and intuition-skills that mirror how mathematicians explore uncharted territory through observation and conjecture.
Enter Demis Hassabis, who as a teenager created the highly successful game Theme Park before attending Cambridge University. When his professor declared that a computer could never play Go due to the game's creative requirements, Hassabis left determined to prove him wrong. His approach was revolutionary: rather than programming Go directly, he would create a meta-program that would learn to play Go through experience.
In 2010, Hassabis co-founded DeepMind with Shane Legg and Mustafa Suleyman. After securing funding from Elon Musk and Peter Thiel, the team first tackled simpler Atari games, developing reinforcement learning algorithms that learned to play games like Breakout purely from pixel data and scores. By 2014, their program outperformed humans on 29 of 49 Atari games, earning them a cover story in Nature. Google acquired DeepMind that same year, giving Hassabis the resources to finally tackle Go.
After AlphaGo's creation, DeepMind secretly tested it against European champion Fan Hui in October 2015, with the program winning all five games. Emboldened by this success, they challenged South Korea's eighteen-time world champion Lee Sedol to a five-game match scheduled for March 2016, with a million-dollar prize.
As 280 million viewers watched, Sedol attempted an unconventional opening strategy, hoping to disrupt AlphaGo's expectations. But the machine, having learned through millions of self-played games, easily adapted. In game two, AlphaGo shocked everyone with move 37-placing a stone on the fifth line, breaking centuries of orthodox play. Fan Hui declared: "It's not a human move... So beautiful." Fifty moves later, that stone proved decisive as AlphaGo claimed its second victory.
After losing the first three games, Sedol played game 4 with newfound freedom. His move 78-placing a white stone between two black ones-completely blindsided AlphaGo. The machine, having assessed such a move as having only a one-in-10,000 chance, responded poorly and spiraled into making nonsensical plays. Sedol claimed victory, prompting wild cheers. His move was dubbed the "hand of god"-a perfect example of transformational creativity that broke conventional patterns.
Move 37 represented genuine creativity-novel, surprising, and ultimately valuable. AlphaGo's innovations have revolutionized Go strategy, with the fifth line now played early for its endgame implications. These games are now considered a treasure trove of new ideas, with AlphaGo successfully employing moves traditionally discouraged. As Hassabis explains, Go had become stuck on a "local maximum," but AlphaGo broke conventions to reveal a higher peak across the valley-measurably better by about two stones.
Chapter 4
The Algorithmic Revolution: From Ancient Greece to Modern Life
Our lives are completely run by algorithms-from internet searches to GPS navigation to Netflix recommendations. Though they power our digital age, algorithms actually predate computers by millennia, going back to Ancient Greece. Mathematics itself was born alongside one of the first algorithms: Euclid's method for finding the greatest common divisor of two numbers.
Google's search algorithm might be the most extraordinary of the modern age. In the early 1990s, the internet had only 3,000 websites. Today, with over 1.2 billion websites, Google processes millions of searches every fifteen seconds. Larry Page and Sergey Brin's breakthrough at Stanford in 1996 was developing an algorithm that ranked websites not just by keyword frequency, but by analyzing which sites were linked to by other respected sites-effectively letting websites "vote" for each other's relevance.
Dating websites proudly declare "We use math to find you dates," and research shows marriages from online matches tend to be happier and more stable. The Nobel Prize-winning Gale-Shapley algorithm, originally designed to solve the "Stable Marriage Problem," forms the foundation of these matching systems. This algorithm now powers everything from matching students to schools to matching patients with organ donations.
Algorithms can produce unexpected consequences when operating without human oversight. A perfect example occurred when a UC Berkeley postdoc discovered Peter Lawrence's out-of-print book "The Making of a Fly" priced at over $1.7 million on Amazon. Two booksellers were using algorithms that created a feedback loop-one programmed to slightly undercut its competitor, while the other was set to mark up prices. The combined effect caused prices to grow exponentially, eventually reaching $23,698,655.93 before a human intervened.
Chapter 5
Machine Learning: The Bottom-Up Revolution
Machine learning represents a fundamental shift in programming approach-instead of explicitly coding solutions, algorithms now learn from data. This revolution has been fueled by the explosion of available data, with 90% of the world's data created in just the last five years. Unlike traditional algorithms, machine learning creates meta-algorithms that improve through experience, learning from mistakes by tweaking their equations.
Computer vision has traditionally been one of AI's greatest challenges. While humans can instantly recognize images like cats, computers analyzing millions of pixels struggled to make sense of visual data. Machine learning has revolutionized this field by training on vast image datasets, gradually building hierarchical questions that can identify objects with increasing accuracy. Microsoft's Xbox Kinect demonstrates this bottom-up learning process by identifying 31 distinct body parts through depth-sensing technology. The algorithm builds decision trees with millions of questions about pixel relationships, creating a system that works without programmers fully understanding why.
Despite impressive advances, these systems can be fooled-researchers have tricked algorithms into seeing rifles instead of turtles or ignoring objects with specially designed "psychedelic patches." Police algorithms confuse desert landscapes with pornography due to sand dunes resembling skin tones and body curves. More concerning are deliberate "hacks"-MIT researchers created 3D-printed turtles that algorithms persistently misidentify as rifles, regardless of viewing angle. These vulnerabilities have serious implications for technologies like self-driving cars and security systems.
Chapter 6
The Evolution of Algorithmic Intelligence
Learning algorithms continually evolve as they interact with users and gather new data. Unlike static programs, these systems refine their recommendations based on changing preferences and new creative outputs. This adaptability is particularly evident in the recommender systems that curate our entertainment choices, which mature and change alongside us.
Recommender algorithms operate on a deceptively simple principle: if you enjoy films A, B, and C, and another user who likes those same films also enjoys film D, you might like film D too. Netflix's famous million-dollar prize challenge in 2006 invited teams to improve recommendation accuracy by 10% using anonymized data from 100 million ratings. The winning approach identified twenty independent traits in films that predicted user preferences, with some traits corresponding to recognizable categories while others represented patterns humans hadn't articulated.
Modern algorithms excel at processing enormous datasets, compensating for human probabilistic intuition failures. However, they often mistake correlation for causation-like pigeons developing superstitious behaviors or the infamous tank-detection algorithm that merely identified cloudy versus clear days. These biases create serious problems: facial recognition failing with darker skin, voice recognition struggling with women's voices, and image software classifying Black people as gorillas.
AlphaGo's development combined supervised learning (studying human Go games) with reinforcement learning (playing against itself). DeepMind later created AlphaZero, which learned without human examples, starting from scratch and defeating the Lee Sedol-beating version of AlphaGo 100-0 after just three days of self-play. In eight hours, it mastered chess and shogi well enough to beat top programs. This "tabula rasa learning" creates algorithms transplantable between domains, moving beyond specific applications toward general intelligence.
Chapter 7
The Art of Algorithms: From Fractals to Rembrandt
Walking into the Serpentine Gallery, I became transfixed by Gerhard Richter's "4900 Farben"-196 paintings arranged as 5x5 grids of colored squares. This pattern-seeking behavior is deeply human-the same instinct that helped our ancestors spot predators now drives us to find meaning in chaos.
Why create art with computers? Isn't art meant to be human expression? Art's origins trace back to early humans-paint kits from South Africa dating 100,000 years ago, hand stencils in Indonesian caves from 40,000 years ago. These existential marks declare "This is my mark. This is man." Modern art challenges whether art represents anything at all-Duchamp's urinal, Cage's silence, Barry's conceptual pieces all question art's boundaries. Computer art similarly challenges us: if you laugh at a computer-generated joke or cry at AI art, does knowing its origin change your emotional response?
Looking beyond humans for creativity, we find curious examples in the animal kingdom. Congo the chimpanzee created paintings that eventually sold for 14,400 at auction (while a Warhol piece went unsold at the same event). In the wild, the Vogelkop gardener bowerbird builds elaborate decorated towers to attract mates, demonstrating skills beyond mere utility. These cases raise important questions about AI-generated art: who owns it, and where is the line between inspiration and infringement?
Fractals-shapes with infinite complexity that maintain their intricacy at any scale-revolutionized computer-generated art. The iconic Mandelbrot set became the backdrop for 1980s club culture, creating dreamlike infinite zooms impossible to discover without computing power. Benoit Mandelbrot's book inspired Loren Carpenter to create "Vol Libre," a fractal landscape animation that so impressed Lucasfilm they hired him immediately. Carpenter later co-founded Pixar, where mathematics and art merged to create lush digital environments.
Harold Cohen's AARON raises profound questions about randomness versus creativity. After Cohen's death in 2016, AARON continues to paint, raising questions about whether Cohen extended his creative life through his program or if AARON has become autonomous. Simon Colton's "The Painting Fool" represents the next evolution, with over 200,000 lines of code designed to be "taken seriously as a creative artist." Unlike AARON, it can articulate its decisions and analyze its output.
Chapter 8
The Next Rembrandt: AI Enters the Art World
Microsoft and Delft University researchers believed Rembrandt's 346 paintings provided sufficient data to create a new portrait in his style. After analyzing 150 gigabytes of digitally rendered graphics, they chose to create a 30-40 year old Caucasian male with facial hair wearing dark clothes and a hat, facing right. Their algorithm analyzed Rembrandt's distinctive approach to painting eyes, noses, mouths, and his characteristic concentrated light source.
The team used 3D printing to replicate Rembrandt's textured paint application, creating a final piece with 148 million pixels across thirteen layers of paint-based UV ink. Despite the technical achievement, art critic Jonathan Jones condemned it as "a tasteless, insensitive and soulless travesty" that missed Rembrandt's true genius-his ability to reveal inner life through art.
Ahmed Elgammal at Rutgers University explored whether artistic competition could generate more interesting AI art by creating a General Adversarial Network. One algorithm was tasked with disrupting known art styles, while another identified whether the output was recognizably art or sufficiently original-mirroring the creative tension in human brains.
This adversarial model parallels the case of Tommy McHugh, a Liverpool builder who, after suffering a stroke in 2001, developed an uncontrollable urge to create art. Neuroscientists discovered our brains balance two competing systems: an exhibitionist creative urge and an inhibitor that critically evaluates ideas. McHugh's stroke had damaged his inhibitory system, leaving only the creative impulse unchecked.
Art's greatest value lies in offering a window into another mind's workings-which may be AI art's true potential, helping us understand computer code's hidden nature. The Google programmers called their process "inceptionism," considering the images to be like algorithm dreams, hence "DeepDream." These psychedelic images provide insight into the algorithm's internal classification processes.
The art world is embracing AI not just as a creator but as the artwork itself. At the Serpentine Gallery, Ian Cheng's "BOB" represents artificial life forms that evolve through visitor interactions. Unlike static gallery pieces, these six initially identical BOBs developed differently based on environmental inputs. Visitors developed emotional connections to BOB, writing comments like "Why doesn't BOB like me?" rather than typical gallery complaints.
Chapter 9
Mathematics as a Creative Art: Can Algorithms Prove Theorems?
Mathematics, like painting or poetry, is fundamentally about creating beautiful patterns-but with ideas rather than colors or words. This revelation came to me at thirteen through G.H. Hardy's "A Mathematician's Apology," which portrayed mathematics as a deeply creative pursuit where aesthetic sensibility matters as much as logical correctness.
For years, I believed this creative aspect protected mathematics from automation. But with algorithms now painting like Rembrandt and creating gallery-worthy art, I wonder: could they soon recreate the mathematics of Riemann or publish in prestigious journals?
Mathematical proof is central to what mathematicians do-creating logical arguments that build from axioms to discover new truths about numbers and geometry. This process resembles games like chess or Go, where axioms are the starting positions and logical deduction provides the rules for movement. The true art of mathematics lies in identifying worthy targets-asking the right questions often matters more than providing answers.
Mathematics emerged from our primal need to understand and predict our environment. Far from being super-calculators, mathematicians are pattern searchers. Our brains evolved to detect patterns because those who missed them didn't survive-this pattern recognition appears in our earliest art, like the Lascaux cave paintings where dots representing moon phases tracked seasonal hunting opportunities.
Mathematical proof, the true essence of mathematics, began with the Ancient Greeks who discovered how logical argument could reveal eternal truths about numbers and shapes. Like chess, mathematical proof begins with an opening position (axioms)-statements considered self-evidently true. From these starting points, logical deduction rules allow mathematicians to establish new truths.
The beauty of mathematics as a game lies in its simple setup and rules yielding infinitely rich possibilities. Unlike tic-tac-toe, which quickly becomes repetitive, the mathematical landscape offers endless new territories to explore, making it intellectually satisfying in ways similar to chess or Go.
Chapter 10
Computers as Mathematical Partners: The Mathematician's Telescope
While I worry about computers replacing mathematicians, I've found them invaluable tools. Beyond simple calculations, computers have become partners in proving complex theorems for nearly half a century. The Four-Colour Map Problem was first solved in 1976 when Appel and Haken used a computer to analyze 1936 different map configurations over 1000 hours-work impossible for humans alone.
These computer-aided proofs initially met resistance from mathematical purists concerned about hidden bugs in programs. The Annals of Mathematics took eight years to accept Thomas Hales' proof of Kepler's Conjecture with "99 percent certainty"-an uncomfortable level of doubt for a discipline built on absolute certainty.
As computer-dependent proofs became more common, mathematicians needed a way to verify these programs' conclusions. In the late 1980s, French mathematicians developed the Calculus of Constructions (CoC), soon nicknamed "Coq." Georges Gonthier at Microsoft Research Cambridge used Coq to verify both the computer and human portions of the Four-Colour Map Theorem, a process that took five years for the human element alone.
Mathematics has reached such complexity that young researchers might spend their entire PhD just understanding the problem they've been assigned. I find it remarkable how much mathematics has remained within human cognitive reach. That we constructed the Monster Symmetry Group, which requires 196,883-dimensional space, using only our minds, pencils and paper is extraordinary.
Vladimir Voevodsky's creativity was truly transformative, not just incremental but introducing completely new perspectives that changed mathematics' landscape. Despite winning the Fields Medal, Voevodsky identified two looming crises in mathematics: the separation of pure and applied mathematics in an era of budget constraints, and the increasing complexity making verification impossible. His revolutionary vision of computers playing a central role in mathematics remains controversial, but he believed it inevitable.
Chapter 11
The Algorithmic Composer: Music as Mathematical Expression
Music and mathematics share deep connections through pattern recognition and structure. Leibniz observed that "Music is the pleasure the human mind experiences from counting without being aware that it is counting." Bach deserves recognition as one of the first musical coders, with compositions that could be mapped mathematically. His Musical Offering exemplifies this algorithmic approach, originating from a challenge by Frederick the Great in 1747.
The fugue operates as an algorithmic process-a sophisticated version of a canon where a tune is shifted in time to create harmony. Bach's algorithm takes a tune X with a time delay S and plays X + SX + SSX, creating three harmonized voices. Bach was clearly aware of the mathematical structures in his music, being a member of the Corresponding Society of Musical Sciences that explored connections between mathematics and music.
David Cope's Emmy program analyzed musical compositions by measuring tension created by intervals. Emmy's recombination system connected musical fragments that matched grammatically, using mathematical formulas rather than randomness to make choices when multiple options existed. To test Emmy's capabilities, Cope and mathematician Douglas Hofstadter organized "The Game"-a musical Turing test at the University of Oregon. When audiences heard three pieces (one by Bach, one by Emmy imitating Bach, and one by music professor Steve Larson also imitating Bach), they consistently misidentified the computer composition as genuine Bach while dismissing the real Bach as computer-generated.
In Cope's musical Turing tests, audiences consistently failed to distinguish between human and computer compositions. Hofstadter himself was shaken by Emmy's emotionally evocative Chopin-esque piece, wondering how a program that "never lived a moment of life" could create such moving music.
DeepBach, developed by Gaetan Hadjeres, analyzes Bach's chorales as two-dimensional geometric structures rather than linear progressions. In blind tests, listeners couldn't distinguish between real Bach chorales and DeepBach compositions 50% of the time. Even trained composition students misidentified DeepBach's work 45% of the time.
Chapter 12
The Future of Algorithmic Creativity
Creativity and consciousness are inextricably linked. The author argues that genuinely new phenomena can emerge from combinations of existing elements-consciousness from neurons, wetness from water molecules-suggesting creativity might similarly emerge from algorithmic processes. Yet machines still lack self-reflection and judgment about their output, though adversarial algorithms show this might be possible.
The fundamental barrier to machine creativity remains the absence of self-motivation-algorithms create only what humans program them to express. Human creativity stems from our free will and consciousness, our desire to break routines and assert we aren't machines. Our creative expressions help us understand our place in the world and share our inner experiences with others who cannot directly access them.
Human creativity is also tied to mortality-our finite existence drives us to leave something meaningful behind. If algorithms could endlessly produce perfect Chopin mazurkas, it would devalue the composer's actual choices and works. Until machines develop consciousness with feedback qualities similar to the human brain's awake state, they will remain tools for extending human creativity rather than truly creative entities.
Perhaps the most profound question isn't whether machines can be creative, but what their creativity teaches us about ourselves. As algorithms increasingly mimic human creative processes, we're forced to confront uncomfortable truths about our own minds. If a machine can compose music that moves us or paint art that speaks to us, what does that reveal about the nature of human creativity itself? Maybe the ultimate value of creative AI isn't in what it produces, but in how it helps us understand the algorithms running in our own heads-the patterns, processes, and beautiful mathematics that make us human.