How to caclulate this combination?

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?

The proof is left as an exercise for the student.

… and now I get to :smack: myself for not reading the whole question. Since order does matter, you have a choice of:

  1. Any of the eight ways of doing any of the tasks
  2. Any of the six ways of doing the remaining 3 tasks
  3. Any of the four ways of doing the remaining 2 tasks
  4. Any of the two ways of doing the remaining task.

So tentatively your answer is 864*2 = 384.

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.

Ah, nivlac, I like your explanation. It makes a lot of sense.