In: Advanced Math
4. Consider bit strings with length l and weight k (so strings of l 0’s and 1’s, including k 1’s). We know how to count the number of these for a fixed l and k. Now, we will count the number of strings for which the sum of the length and the weight is fixed. For example, let’s count all the bit strings for which l + k = 11.
(a) Find examples of these strings of different lengths. What is the longest string possible? What is the shortest?
(b) How many strings are there of each of these lengths. Use this to count the total number of strings (with sum 11).
(c) The other approach: Let n = l + p vary. How many strings have sum n = 1? How many have sum n = 2? And so on. Find and explain a recurrence relation for the sequence (an) which gives the number of strings with sum n.
(d) Describe what you have found above in terms of Pascal’s Triangle. What patter have you discovered?
I'd really appreciate the help on solving this problem as there were no similar example problems in the book to even help me start this problem. Thank you!
Also some background information on this problem to hopefully help someone at least start answering this problem. For this problem we previously went over sequences such as recursive and closed. Also if they were arithmetic or geometric. The last chapter did cover binomial coefficients if that has some prevalence here.
a) Examples: The strings and are of lengths respectively. The weights are , respectively. Thus, we have in both cases.
The longest possible is when (so that ). Longest length is .
For any string with , we have so that . Thus, the shortest possible string is when . Thus, shortest length is .
b) The only string of length is the all string. Hence, there is just 1.
The number of string of length having is the number of ways to pick a place for the unique such a string must contain, of the available places; this number is
Now, for any such string with , there are of 's out of length . Thus, number of such strings is
Thus, total number of such strings is
c) If then the only possible way is ; thus, there is one such string, namely . Hence, .
If then the only possible ways are and ; thus, there are two such strings, namely corresponding to first way, and corresponding to second. Hence, .
In general, consider any string with . Then, we can get a string with by appending a to , because has same as . These are all strings that ends in . On the other hand, any string with , correspond in a unique way to a string with . Thus, . Thus, the recurrence is
d) The pattern is
extended infinitely.