# Fill In Function – Design of Computer Programs Now I want to talk about a strategy for defining the function fillin,which takes an unfilled formula and returns all the possible filled in formulas. What do we have to do? Well, let’s consider a formula, and I’m going to take one that’s simpler than one we’ve seen before. I’m going to take the formula I plus I equals me. What we have to do then is find out what all the letters are in this formula and fill in all possible values for digits for those letters. It seems like a good thing is to collect all the letters, and in this particular formula the letters should be IME. What are the possible digits that we want to replace these three letters with? Well, we can just iterate through all the 3-digit numbers, but make sure that we’re not duplicating any of those numbers. So maybe we’ll start with 123, then 124, and so on, 120, and then 13. We wouldn’t do 131, because we already have a 1 there, so 132, 13–can’t do 133, so 134, and so on and so on. We just have all these possibilities. How many possibilities are there? Well, there’s 10 possible first digits. Then we don’t want to repeat a digit, so 9 possible second digits, and 8 possible third digits, so that’s 720 possibilities. Not very many at all. It should be really fast to go through all these possibilities. Now, what function gives me all the possible sets of numbers in order–so order matters. 120, for, example is different than 012 or 201 and so on. What function is it that we give it the list of digits? so we want some function F, we give it the list of digits, and we give it the number that we want, and there are three letters in this particular formula, so we want three of them. What function F takes that and then returns this sequence of all possible sets of numbers? Maybe it returns it as a tuple or a list or whatever. The question is what function can do that. Is it combinations, permutations, factorial, or some other function?