Using linking cubes, how many distinct towers of height n can be made with two different colors?
We can see after finding all possible dual-colored towers of heights 1, 2, 3 and 4, we have totals of 2, 4, 8, and 16. The number of towers of height n is going to be the nth power of 2. Investigating in more detail, we find that the towers of height 2 have 1 tower that is all light-blue, 2 towers that only have 1 light-blue cube, and 1 tower with 0 light-blue cubes. Continuing, we see that for the towers of height 3 there is 1 tower that is all green, 3 towers with 2 green cubes, 3 towers with 1 green cube, and 1 tower with 0 green cubes. Finally, in our towers of height 4, 1 of them is completely purple, 4 have three purple cubes, 6 have exactly 2 purple cubes, 4 have 1 purple cube, and 1 has 0 purple cubes. Again we are seeing the pattern in Pascal's triangle! In this case, since we are making towers of height n with only two colors, we must ask the binary question "Color 1 or Color 2?" every time we add a cube to the tower.
As with the Trains problem, we can systematically generate all our towers by first creating the towers of height 1. Once we do this, we can generate all the towers of height 2 by duplicating the set of towers of height 1 and adding another block of one color to the top of one set and the second color to the top of the second set. If we repeat this process, we can easily generate all the unique towers.