Britain’s state schools have begun introducing their students to the world of algorithms, making it the first G20 country to put computer science at the heart of its curriculum.