二進数のコードで圧縮の実施

まだ算数の圧縮に間して学んでいます。
I have been reading about how, given the probability distribution of the letters in a message, the half-open interval [0,1) can be partitioned for the letters. For example, say there are three possible letters in a three letter message, each appearing once (probability 1/3). Say the letters are A,B, and C, and the message is "ABC". Then the first letter will be in [0,1/3). Then this interval is partitioned into [0,1/9),[1/9,2/9),[2/9,1/3). As the second letter is B, the interval [1/9,2/9) is divided into [1/9,4/27),[4/27,5/27),[5/27,6/27). As the last character is C, we know that the interval for our code must fall in [5/27,6/27). Say we choose 5/27. The decoder will see this value and, given 3 partitions of [0,1), see that 5/27<1/3, so that the first letter is A. Then, given 3 partitions of [0,1/3), see that 5/27 falls in [1/9,2/9), so that the second letter is B. Then, given 3 partitions of [1/9,2/9), see that 5/27 falls in [5/27,6/27), so that the last letter is C. Thus, there is only one possible decoding. The question is how to choose a value to express this code which minimizes the number of bits used. The article I am reading claims that the [5/27,6/27) interval can be written in binary as [1011110,1110001), which is [94,113) in decimal. I am not sure how this mapping is carried out. If it is accurate, then the number 111 (binary) falls in this range, so the encoding requires only 3 bits.
It seems that, if we write 5/27 as a binary fraction, it could be approximated as .00101111. Likewise, 6/27 could be approximated as .001110001. Thus, if we shift both of the binary fractions left 9 bits, we obtain [1011110,1110001).