Genes normally evolve by tiny mutations, but every now and then something more radical occurs and entire genes along a chromosome get flipped. Understanding gene flipping boils down to solving a problem from pure maths. Colva Roney-Dougal and Vincent Vatter explain, taking us on a journey from waiters sorting pancakes, via one of the richest men in the world, to the genetic similarities of mice and humans.