Lets say I have 4 tasks that need to be done. Each task can be done one of two ways - say A or B. So when composing my “algorithm”, I have a total of 8 methods to choose from:
1A, 1B
2A, 2B
etc.
Now, given the critera that order DOES matter (imagine that these tasks are steps…performing 1,2,3,4 would be different than performing 4,3,2,1) and that the final algorithm must include all 4 tasks, how do I compute the total number of combinations?
Typically, you would envision either a series of black boxes, or a series of forked roads. The number of total paths through the boxes or roads is given by multiplying the number of paths or options at each step.
Sandwiches and outfits are the two most obvious teaching examples here. Consider an outfit of n elements, each of which can be any of m colors. Demonstrate that you can choose from n[sup]m[/sup] outfits.
Given that a Whopper[sup]TM[/sup] consists of a burger and a bun, and that the customer may choose to have (or not to have) each of lettuce, tomato, cheese, ketchup, mayo, mustard, pickle, or onion, (eight choices) how many ways are there to have a Whopper[sup]TM[/sup] sandwich?
Got the same answer as Jurph, but using a different route. Ignoring the two choices for each task, and allowing differences for ordering, there are 4! = 24 permutations of the 4 tasks. Now since each task can be done any of two ways, that means that each of the 24 permutations can be done in 2^4 = 16 ways. So the total number of combinations is 24*16 = 384.