d) For 5-bit, there are 2^5=32 possibilities of sequences. Using the logic in c), since it’s a 5-digit sequence, we know that one ticket can at most cover one difference in each digit and the sequence which looks exactly the same as itself. So, one ticket can cover 6 possibilities. 32÷6=5…2, so the possible smallest number of tickets we need to buy is 5+1=6 to cover all the possibilities. Now I want to illustrate that buying only 6 tickets is not doable:(it’s a little bit elongated and weird) Imagine a five dimensional coordinate system with coordinates in form of (a,b,c,d,e), and a, b, c, d and e can either be 0 or 1. So we have 32 points in total If we dye 6 points red in this system, and we assume that every red point will turn the points which are just 1 unit away from them to become blue. So, as long as a point is dyed, no matter it is blue or red, that means this possibility is covered Then the problem is equivalent to “is possible to let every point have color with just 6 red points.” First, we assume that it is possible. Since every point is equivalent, we assume that (1,1,1,1,1) is a red point. Then we assume that there’re “a” red points with five “1”s for its coordinate, and “b” red points with four “1”s, “c” red points with three “1”s, “d” red points with two “1”s, “e” red points with two 1s, and “f” red points with one “1”. So a+b+c+d+e=6 For those red points with five “1”s, they can just dye the points with four “1”s. For those red points with three “1”s, they can just dye the points with two “1”s and four “1”s. So we can have these relationships: 1) a+b≥1 2) 5a+b+2c≥5 3) 4b+c+3d≥10 4) 3c+d+4e≥10 5) 2d+e+5f≥5 6) e+f≥1 Since we assume that (1,1,1,1,1) is a red point, so a≥1. So the first and the second inequalities are satisfied. Since there’s just one point with zero “1”, so f ‘s maximum value is one. Case 1: If f=1, then the fifth and the sixth inequalities are satisfied. Then we add 3) and 4), then we get b+c+d+e≥5. That is to say, except the two red points (1,1,1,1,1) and (0, 0, 0, 0, 0), there must be another 5 red points, which contradict with my assumption that there’re just 6 points. Case 2: If f=0 Then we plug in f=0, and we have there relationships: 1) 4b+c+3d≥10 2) 3c+d+4e≥10 3) 2d+e≥5 4) e≥1
5) b+c+d+e=6-a=6-1=5 Then we just have two solution for (a,b,c,d,e,f): (1,0,1,3,1,0) and (1,1,0,2,2,0) . And when the relationship are satisfied, 4b+c+3d=10 and 3c+d+4e=10, which means I cannot dye blue any points with three “1”s or two “1”s, or there will be some points with three “1”s or two “1”s are not dyed at all. For (1,1,0,2,2,0), it is apparently impossible because for any two points with one “1”, they will have a mutual neighbor point with two “1”s (For example, (0,0,0,0,1) and (1,0,0,0,0) has a mutual neighbor (1,0,0,0,1) ), and the mutual neighbor point will be dyed twice. For (1,0,1,3,1,0), without the loss of generality, we can assume that the only red point with three “1”s is (1,1,1,0,0), and it’s neighbor points which have two “1”s are (1,1,0,0,0), (1,0,1,0,0), and (0,1,1,0,0). Since we can dye those points blue twice, so the red points with two “1”s cannot be neighbors of these three points. So the last two digits of their coordinate must at least contain one “1”. Then we consider the red point with just one “1”. If the “1” is in the first three digits of its coordinate, then it will be the neighbor of one of the points among (1,1,0,0,0), (1,0,1,0,0), and (0,1,1,0,0). So the one-“1” red point and a three-“1” red point dye another 2-one point twice, and it is not allowed. If the “1” is in the last two digits of its coordinate, without the loss of generality, assume the red point is (0,0,0,0,1). Then except the blue points dyed by one-“1” red point and a three-“1” red points, the remaining points are the red points: (1,0,0,1,0), (0,1,0,1,0), and (0,0,1,1,0). The last two points have a mutual neighbor point (0,1,1,1,0) and it is a three-“1” point. So it is also not right (If we go back to the lottery ticket circumstance, we can also illustrate that these two solutions are impossible. A legit solution should cover all 32 possible sequences. First, For (1,1,0,2,2,0): According to this solution, we have two different sequences with four “0”s and one “1”, so these two sequences can at most have 2 different digits. So among the possibilities each ticket can cover, they must cover one sequence which contains two “1”s twice. Since the total possibilities 6 tickets can cover is 36, now it’s just 36-1=35. Since they both cover 00000, so 00000 is covered twice. Now it’s 35-1=34. Since we have 11111 and another four-“1” sequence, 11111 is covered twice. 34-1=33. The four-“1” sequence itself is covered twice by itself and by 11111. 33-1=32. Since we have two two-“1” sequences. If they just there’s one “1” in the same digit in both 2 sequences, another two-“1” sequence must be covered twice. 32-1=31. If the two “1”s are in totally different digit in the two sequences, and we have two 1-one sequence, so there must be a 1-one sequence and a two-“1” sequence in which there’s a “1” in the same digit in both sequences. Thus, there must be another sequence that is covered twice by these two sequences. So it’s also 32-1=31 31 is not enough to cover 32 possibilities. So this solution is not right. The same logic can also be applied for (1,0,1,3,1,0). ) So, both in Case 1 and in Case 6, dying every point with just 6 red points is impossible. So, the smallest possible number is 7.
And here’s an example when we can just buy 7 tickets but cover all the possibilities: After one hour’s trying, I get one solution for 7: Buy: 11111, 01111, 10111, 11000, 00100, 00010, 00001 Here’s the table for this solution(red sequences are the sequences we buy, and black sequences are the possibilities they can cover. And I cross some sequences to let every sequence only appear ones ) 11111 11111 01111 10111 11011 11101 11110 01111 01111 11111 00111 01011 01101 01110 10111 10111 00111 11111 10011 10101 10110 11000 11000 01000 10000 11100 11010 11001 00100 00100 10100 01100 00000 00110 00101 00010 00010 10010 01010 00110 00000 00011 00001 00001 10001 01001 00101 00011 00000