Describe an arithmetic coding algorithm to encode random bit strings of length N and weight K (i.e., K ones and N -K zeroes) where N and K are given.
For the case N =5, K =2, show in detail the intervals corresponding to all source substrings of lengths 1-5.