number of bits of information for n stable states?
Turn it around: How many different states can B bits represent? The answer is 2B.

Therefore, if you want to know how many bits it takes to represent N states, you need to find a value for B for which 2B is at least N.

$$2^B \ge N$$

Take the log2 of both sides:

$$B \ge log_2(N)$$

The binary bit, representing one choice, such as Yes/No, is the smallest unit of "information". Therefore, any number of states can be expressed in terms of the number of bits that carry the equivalent amount of information.

In the general case, this can be fractional. For example, a 10-state system carries log210 = 3.322 bits of information.