 We use computers to do hundreds of different tasks every day, things like searching the internet, editing an image, or finding a route on a map. But have you ever wondered how a computer figures out how to do these things? An algorithm is a step-by-step process which tells a computer how to do a specific task. But there can be many different algorithms for the same problem, kind of like how there can be many different recipes for baking a cake. But as we know, some recipes can be a lot better than others. So we're going to do a little experiment to see if the same thing is true for algorithms. Here we are in front of the University of Canterbury Library, about to start the Great Algorithms Race. Competing today, we have Speedy Spencer and Slow Coach Slade. Their task is to run to the library and find this book by Canuth amongst the millions of books in there. First one to find it wins. Are you ready? Go! Speedy Spencer is off to a flying start, he's searched dozens of books already. He seems to be employing a sequential search algorithm, so he looks at the first book and then continues on and looks at each individual book until he...where's he going? He seems to know exactly what he's looking for. Slade seems to be employing something like a binary search algorithm as his strategy. He's looked at a book at the centre of the library and by looking at that one book, he's realised the book he's looking for can't be in the first half. So by making one query, he's eliminated half of the books in the library. He may be slow, but he's intelligent. Spencer seems to have almost finished his first shelf of books. He's got a few thousand more to go though before he finds the right book. It's a bit like if you took one of the world's fastest computers and gave it one of the world's worst algorithms. Imagine if a fast engine like Google returned results to you by searching through every page on the internet one by one. Now back to Slade. How are you going Slade? Exactly as I planned. I've noted down and should be on this shelf. I already know that the book is on this shelf. There's half the shelf. Excuse me. Bozo, are you searching for the book as well? Yep, I'm doing a Bozo search. How does that work? Well, I take a book and hopefully it's the right book. But what if it isn't the right book? Well, then I'll go look for another book. Excuse me. Congratulations Slade, you've won. Guys, you can stop searching now. Guys, guys, you can stop searching now. Guys, guys, you can stop now. So it looks like the algorithm you choose can make a big difference, particularly with large amounts of data. You see, if the library being twice the size, it would take Speedy Spencer twice as long to find the book. But Slow Coach Slade would have only needed to check one extra book. In this chapter, we'll be looking more at what algorithms are used for and why it's important to choose the right one. So Slow Coach Slade. If you were an algorithm in a program I was writing, I would be the happiest programmer alive. Metagenetics in Argentina and Peru. Hmm, close enough.