Constrained ( Variable Length ) Permutation Calculation. I am writing some tracking software, but I think this is pretty purely a math question.  I don't need to know the math to accomplish this with my code, but I like math and I want to learn!  Thus please keep in mind, I fully expect to have to look up definitions of math terms in your answers :-)
I am trying to determine how many possible workflows will exist in my new system. There are 6 "starting" posibilites, 0 or 1 "middle" possibilities, and 5 "ending" possibilities.  So, some workflows are 2 items long, some are 3 items long.  None of these possibilities are the same.  The 6 starting, can only be options for the starting item.  The middle only has 1 possibility, and it is either present or not.  The 5 end possibilites can only be options for the ending position, wether it's the 2nd or 3rd item in the particular instance.
4 instance examples:
    1starting - 1ending
    1starting - 1middle - 1ending
    1starting - 2ending
    1starting - 1middle - 2ending

etc...
How many workflows are possible?  How would this be calculated / what would the formula look like? Thanks!
 A: Let $S_1,S_2,...,S_6$ be the $6$ possible "starting" possibilities, let $M_0,M_1$ be the $2$ possible "middle" possibilities, and let $E_1,E_2,...,E_5$ be the $5$ possible "ending" possibilities. Note that there are $6$ ways to choose the first option, $2$ was to choose the second option, and $5$ ways to choose the last option. Thus, by the Fundamental Counting Principle, the total number of possibilities is:
$$
6 \cdot 2 \cdot 5 = 60
$$
A: You have $6$ possible options for the first position, $2$ for the second and $5$ for the third. Therefore, the number of possible configurations are:
$$6 \cdot 2 \cdot 5=60$$
One way to to think about this is as follows:


*

*First, let us choose the first position. There are $6$ options available for the first position.

*Second, for the middle position we have $2$ options. Thus, for each one of the $6$ choices from point 1, we have $2$ choices for the second which gives us $6 \cdot 2=12$ possible configurations.

*Third, for the last position we have $5$ positions. Thus, for each one of the $12$ possible configurations that arise when we chose positions 1 and 2, we can complete the configuration in $5$ different ways. 

*Therefore, the total number of configurations are: $12 \cdot 5=60$.
A: Just 6 times 2 times 5. You could write software to list them all and check.
`
<pre>
<?php
$count = 0;
for( $i = 1 ; $i <= 6 ; $i++ ) {
  for( $j = 0 ; $j <= 1 ; $j++) {
    for( $k = 1 ; $k <= 5 ; $k++) {
      print("{$i}starting - ");
      if($j) print("{$j}middle - ");
      print("{$k}ending\n");
      $count++;
    }
  }
}
print "$count total\n";
?>
</pre>

