24 possible combinations? I'm terrible at math. My goal was to try and create $24$ total combinations using a horizontal bar, and a horizontal bar with one break. So that's two bar types. How can I write out the math that tells me how many bars it takes to get $24$ possible combinations if stacked vertically? If that is even possible. 
I'm been drawing the possible combinations to count them, but it's a pain and I don't trust it. How can I write out this mathematically so I can figure it out? I'm trying to do this with two bar types, but when use $3$ if I have two. Any more than that and I will have to abandon the experiment.
Example:
__    --    __    --
__    --    --    __

That's $4$ possible combinations correct?
How many bars(with two types) stacked vertically would it take to get $24$? How could I write out the math so I can try to figure this out? I don't even know the type of math this is called to tag it properly.
 A: For $n$ bars, there can be $2^n$ possible combinations as there are $2$ types of bars.
If you want at least $24$ combinations with $\lceil n\rceil$ bars, you'd need
$$2^n=24$$
$$n=\log_2 24$$
$$n\approx 4.58\ldots$$
$$\implies\lceil n\rceil=5$$
Since you are taking pairs of bars, this means you'd need at least $6$ bars, or $3$ pairs of them. Hope this helps.     
A: AvZ already answered your question, but this is something that might help you in your project. You said you weren't confident about how to draw all the stacks.    Here's something that's not hard to do that can help you generate stacks of bars. It is a method that assigns numbers to stacks in a systematic way, so that each stack gets a different ID number.
Once this is done, it's simple to write down all the stacks: you just write down stack #0, then stack #1, and so on.  Or if you have a bunch of stacks and you want to check for duplicates and omissions, you can turn each one into a number and check the numbers for duplicated or omitted numbers, which is easier to do.
As an example, let's consider stacks of four bars, but the method is the same for different-sized stacks.   There are 16 stacks of 4, because $16 = 2^4 = 2\times 2\times 2\times 2$, and there is a simple correspondence between the 16 stacks and the 16 numbers from 0 to 15.

First we'll see the method for turning a stack into a number.  Say we have the stack $$\begin{array}{c}—\\- -\\- -\\—\end{array}$$and we want to know which is the corresponding number.  Starting at the bottom, label each bar with a number: $$\begin{array}{cr}—&8\\- -&4\\- -&2\\—&1\end{array}$$The labels start with 1 and each one is twice as much as the label below it.
Now cross out the numbers that are next to solid bars:
$$\require{enclose}\def\hs#1{\enclose{horizontalstrike}{#1}}
\begin{array}{cr}—&\hs8\\- -&4\\- -&2\\—&\hs1\end{array}$$
Now add up the numbers that are not crossed out: this is stack number 6. This method assigns every stack of 4 bars a different number from 0 to 15.

Now the reverse process: suppose we have a number  and we want to know which stack corresponds to that number.  The rule is:  


*

*If the number is odd, add a broken bar to the top of the stack, subtract 1, and divide by 2.

*If the number is even, add a solid bar to the top of the stack, and divide by 2.


And do that until you have the desired number of bars.  
For example, let's do 13.  13 is odd, so we write a broken bar, subtract 1 and divide by 2, giving 6: $$\begin{array}{rc}6 & - -\\ 13 & \end{array}$$ Now 6 is even, so we add a solid bar atop the first, and divide by 2, leaving 3:
$$\begin{array}{rc}3 & — \\6 & - -\\ 13 & \end{array}$$ 3 is odd, so we add a broken bar to the top, subtract 1, and divide by 2, leaving 1: $$\begin{array}{rc}1 & - - \\3 & — \\ 6 & - -\\ 13 & \end{array}$$
Finally, 1 is odd, so we add another broken bar, subtract 1, and divide by 2, leaving 0:
$$\begin{array}{rc}0 & - - \\1 & - - \\3 & — \\ 6 & - -\\ 13 & \end{array}$$
If we were making a stack of 5 bars, we would add a solid bar at this point, because 0 is even.
If we reverse the process to find the number that corresponds to this stack, we'll get 13, as desired.
